Add hook for primitive procedure profiling.
authorChris Hanson <org/chris-hanson/cph>
Wed, 29 Apr 1987 13:51:11 +0000 (13:51 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 29 Apr 1987 13:51:11 +0000 (13:51 +0000)
v7/src/microcode/prims.h
v7/src/microcode/version.h
v8/src/microcode/version.h

index 4d5af00115a1b6069d138dec36561b4968dbcb88..b54d73a0d7ab556bea43532ad0b9f787be109fce 100644 (file)
@@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/prims.h,v 9.22 1987/04/16 02:27:43 jinx Exp $ */
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/prims.h,v 9.23 1987/04/29 13:50:24 cph Exp $ */
 
 /* This file contains some macros for defining primitives,
    for argument type or value checking, and for accessing
@@ -50,27 +50,55 @@ Pointer C_Name()
  * local variables for fast access.
  */
 
-#define Primitive_0_Args()
-
-#define Primitive_1_Args()     fast Pointer Arg1 = Stack_Ref(0)
-
-#define Primitive_2_Args()      Primitive_1_Args();                    \
-                               fast Pointer Arg2 = Stack_Ref(1)
-
-#define Primitive_3_Args()      Primitive_2_Args();                    \
-                               fast Pointer Arg3 = Stack_Ref(2)
-
-#define Primitive_4_Args()      Primitive_3_Args();                    \
-                               fast Pointer Arg4 = Stack_Ref(3)
-
-#define Primitive_5_Args()      Primitive_4_Args();                    \
-                               fast Pointer Arg5 = Stack_Ref(4)
-
-#define Primitive_6_Args()      Primitive_5_Args();                    \
-                               fast Pointer Arg6 = Stack_Ref(5)
-
-#define Primitive_7_Args()      Primitive_6_Args();                    \
-                               fast Pointer Arg7 = Stack_Ref(6)
+#ifdef ENABLE_PRIMITIVE_PROFILING
+#define primitive_entry_hook() record_primitive_entry (Fetch_Expression ())
+#else
+#define primitive_entry_hook() {}
+#endif
+
+#define Primitive_0_Args()     primitive_entry_hook ()
+
+#define Primitive_1_Args()     fast Pointer Arg1 = Stack_Ref(0);       \
+                               primitive_entry_hook ()
+
+#define Primitive_2_Args()     fast Pointer Arg1 = Stack_Ref(0);       \
+                               fast Pointer Arg2 = Stack_Ref(1);       \
+                               primitive_entry_hook ()
+
+#define Primitive_3_Args()     fast Pointer Arg1 = Stack_Ref(0);       \
+                               fast Pointer Arg2 = Stack_Ref(1);       \
+                               fast Pointer Arg3 = Stack_Ref(2);       \
+                               primitive_entry_hook ()
+
+#define Primitive_4_Args()     fast Pointer Arg1 = Stack_Ref(0);       \
+                               fast Pointer Arg2 = Stack_Ref(1);       \
+                               fast Pointer Arg3 = Stack_Ref(2);       \
+                               fast Pointer Arg4 = Stack_Ref(3);       \
+                               primitive_entry_hook ()
+
+#define Primitive_5_Args()     fast Pointer Arg1 = Stack_Ref(0);       \
+                               fast Pointer Arg2 = Stack_Ref(1);       \
+                               fast Pointer Arg3 = Stack_Ref(2);       \
+                               fast Pointer Arg4 = Stack_Ref(3);       \
+                               fast Pointer Arg5 = Stack_Ref(4);       \
+                               primitive_entry_hook ()
+
+#define Primitive_6_Args()     fast Pointer Arg1 = Stack_Ref(0);       \
+                               fast Pointer Arg2 = Stack_Ref(1);       \
+                               fast Pointer Arg3 = Stack_Ref(2);       \
+                               fast Pointer Arg4 = Stack_Ref(3);       \
+                               fast Pointer Arg5 = Stack_Ref(4);       \
+                               fast Pointer Arg6 = Stack_Ref(5);       \
+                               primitive_entry_hook ()
+
+#define Primitive_7_Args()     fast Pointer Arg1 = Stack_Ref(0);       \
+                               fast Pointer Arg2 = Stack_Ref(1);       \
+                               fast Pointer Arg3 = Stack_Ref(2);       \
+                               fast Pointer Arg4 = Stack_Ref(3);       \
+                               fast Pointer Arg5 = Stack_Ref(4);       \
+                               fast Pointer Arg6 = Stack_Ref(5);       \
+                               fast Pointer Arg7 = Stack_Ref(6);       \
+                               primitive_entry_hook ()
 
 #define Primitive_1_Arg()      Primitive_1_Args()
 \f
index 4ae12e5afc5a29dbc72ba703afda08901cc9a7bf..c754f2f516b493a7e1c917bd6e37d3fe60acec09 100644 (file)
@@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 9.46 1987/04/25 20:24:28 cph Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 9.47 1987/04/29 13:51:11 cph Exp $
 
 This file contains version information for the microcode. */
 \f
@@ -46,7 +46,7 @@ This file contains version information for the microcode. */
 #define VERSION                9
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     46
+#define SUBVERSION     47
 #endif
 
 #ifndef UCODE_TABLES_FILENAME
index e8eaf79f4fe7c30049f91af14c887f070019fde9..d48fb8b5a00fc9f2efd1dde1c7dc859563ac197b 100644 (file)
@@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 9.46 1987/04/25 20:24:28 cph Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 9.47 1987/04/29 13:51:11 cph Exp $
 
 This file contains version information for the microcode. */
 \f
@@ -46,7 +46,7 @@ This file contains version information for the microcode. */
 #define VERSION                9
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     46
+#define SUBVERSION     47
 #endif
 
 #ifndef UCODE_TABLES_FILENAME