Commits

Anonymous committed fbb4a40

forgot to add header file and header generator earlier

Comments (0)

Files changed (2)

src/gen_header.py

+import sys
+sys.path.append('../scripts')
+from acts import *
+
+def print_string_array(l, name, file=None):
+    print("const char* {0}[] = {{".format(name), file=file)
+    for s in l:
+        print('    "{0}",'.format(s), file=file)
+    print("};", file=file)
+    print(file=file);
+
+f = open('tracevis_gen.h', 'w')
+print_string_array(states, 'state_names', file=f)
+print_string_array(reasons, 'reason_names', file=f)
+f.close()
+/* Must contain no more than 16 items. */
+enum mon_State {
+    S_EXITLAST,
+    S_INTERP,
+    S_MONITOR,
+    S_RECORD,
+    S_COMPILE,
+    S_EXECUTE,
+    S_NATIVE,
+
+    S_COUNT
+};
+
+/* Reason for an exit to the interpreter. */
+enum mon_ExitReason {
+    R_NONE,
+    R_ABORT,
+    /* Reasons in js_MonitorLoopEdge */
+    R_INNER_SIDE_EXIT,
+    R_DOUBLES,
+    R_CALLBACK_PENDING,
+    R_OOM_GETANCHOR,
+    R_BACKED_OFF,
+    R_COLD,
+    R_FAIL_RECORD_TREE,
+    R_MAX_PEERS,
+    R_FAIL_EXECUTE_TREE,
+    R_FAIL_STABILIZE,
+    R_FAIL_EXTEND_FLUSH,
+    R_FAIL_EXTEND_MAX_BRANCHES,
+    R_FAIL_EXTEND_START,
+    R_FAIL_EXTEND_COLD,
+    R_NO_EXTEND_OUTER,
+    R_MISMATCH_EXIT,
+    R_OOM_EXIT,
+    R_OVERFLOW_EXIT,
+    R_TIMEOUT_EXIT,
+    R_DEEP_BAIL_EXIT,
+    R_STATUS_EXIT,
+    R_OTHER_EXIT,
+
+    R_COUNT
+};
+
+const unsigned long long MS64_MASK = 0xfllu << 60;
+const unsigned long long MR64_MASK = 0x1fllu << 55;
+const unsigned long long MT64_MASK = ~(MS64_MASK | MR64_MASK);