aboutsummaryrefslogtreecommitdiffstats
path: root/mjit.h
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-14 05:26:46 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-14 05:26:46 +0000
commitfa13bb1a6f0894d92b85337385058330eb071eea (patch)
tree884135eef1c0c6db8e93e04ba495053bc3ef075a /mjit.h
parent19513c88d5f923abb7f226520192aef9f3fcc1c7 (diff)
downloadruby-fa13bb1a6f0894d92b85337385058330eb071eea.tar.gz
Unify comment styles across MJIT sources
I'm writing `//` comments in newer MJIT code after C99 enablement (because I write 1-line comments more often than multi-line comments and `//` requires fewer chars on 1-line) and then they are mixed with `/* */` now. For consistency and to avoid the conversion in future changes, let me finish the rewrite in MJIT-related code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit.h')
-rw-r--r--mjit.h64
1 files changed, 32 insertions, 32 deletions
diff --git a/mjit.h b/mjit.h
index 2e135287e2..4cdb81aab2 100644
--- a/mjit.h
+++ b/mjit.h
@@ -14,44 +14,44 @@
#if USE_MJIT
-/* Special address values of a function generated from the
- corresponding iseq by MJIT: */
+// Special address values of a function generated from the
+// corresponding iseq by MJIT:
enum rb_mjit_iseq_func {
- /* ISEQ was not queued yet for the machine code generation */
+ // ISEQ was not queued yet for the machine code generation
NOT_ADDED_JIT_ISEQ_FUNC = 0,
- /* ISEQ is already queued for the machine code generation but the
- code is not ready yet for the execution */
+ // ISEQ is already queued for the machine code generation but the
+ // code is not ready yet for the execution
NOT_READY_JIT_ISEQ_FUNC = 1,
- /* ISEQ included not compilable insn, some internal assertion failed
- or the unit is unloaded */
+ // ISEQ included not compilable insn, some internal assertion failed
+ // or the unit is unloaded
NOT_COMPILED_JIT_ISEQ_FUNC = 2,
- /* End mark */
+ // End mark
LAST_JIT_ISEQ_FUNC = 3
};
-/* MJIT options which can be defined on the MRI command line. */
+// MJIT options which can be defined on the MRI command line.
struct mjit_options {
- /* Converted from "jit" feature flag to tell the enablement
- information to ruby_show_version(). */
+ // Converted from "jit" feature flag to tell the enablement
+ // information to ruby_show_version().
char on;
- /* Save temporary files after MRI finish. The temporary files
- include the pre-compiled header, C code file generated for ISEQ,
- and the corresponding object file. */
+ // Save temporary files after MRI finish. The temporary files
+ // include the pre-compiled header, C code file generated for ISEQ,
+ // and the corresponding object file.
char save_temps;
- /* Print MJIT warnings to stderr. */
+ // Print MJIT warnings to stderr.
char warnings;
- /* Disable compiler optimization and add debug symbols. It can be
- very slow. */
+ // Disable compiler optimization and add debug symbols. It can be
+ // very slow.
char debug;
- /* If not 0, all ISeqs are synchronously compiled. For testing. */
+ // If not 0, all ISeqs are synchronously compiled. For testing.
unsigned int wait;
- /* Number of calls to trigger JIT compilation. For testing. */
+ // Number of calls to trigger JIT compilation. For testing.
unsigned int min_calls;
- /* Force printing info about MJIT work of level VERBOSE or
- less. 0=silence, 1=medium, 2=verbose. */
+ // Force printing info about MJIT work of level VERBOSE or
+ // less. 0=silence, 1=medium, 2=verbose.
int verbose;
- /* Maximal permitted number of iseq JIT codes in a MJIT memory
- cache. */
+ // Maximal permitted number of iseq JIT codes in a MJIT memory
+ // cache.
int max_cache_size;
};
@@ -88,11 +88,11 @@ extern void mjit_cont_free(struct mjit_cont *cont);
extern void mjit_add_class_serial(rb_serial_t class_serial);
extern void mjit_remove_class_serial(rb_serial_t class_serial);
-/* A threshold used to reject long iseqs from JITting as such iseqs
- takes too much time to be compiled. */
+// A threshold used to reject long iseqs from JITting as such iseqs
+// takes too much time to be compiled.
#define JIT_ISEQ_SIZE_THRESHOLD 1000
-/* Return TRUE if given ISeq body should be compiled by MJIT */
+// Return TRUE if given ISeq body should be compiled by MJIT
static inline int
mjit_target_iseq_p(struct rb_iseq_constant_body *body)
{
@@ -100,8 +100,8 @@ mjit_target_iseq_p(struct rb_iseq_constant_body *body)
&& body->iseq_size < JIT_ISEQ_SIZE_THRESHOLD;
}
-/* Try to execute the current iseq in ec. Use JIT code if it is ready.
- If it is not, add ISEQ to the compilation queue and return Qundef. */
+// Try to execute the current iseq in ec. Use JIT code if it is ready.
+// If it is not, add ISEQ to the compilation queue and return Qundef.
static inline VALUE
mjit_exec(rb_execution_context_t *ec)
{
@@ -142,7 +142,7 @@ mjit_exec(rb_execution_context_t *ec)
case NOT_COMPILED_JIT_ISEQ_FUNC:
RB_DEBUG_COUNTER_INC(mjit_exec_not_compiled);
return Qundef;
- default: /* to avoid warning with LAST_JIT_ISEQ_FUNC */
+ default: // to avoid warning with LAST_JIT_ISEQ_FUNC
break;
}
}
@@ -158,7 +158,7 @@ mjit_exec(rb_execution_context_t *ec)
void mjit_child_after_fork(void);
-#else /* USE_MJIT */
+#else // USE_MJIT
static inline struct mjit_cont *mjit_cont_new(rb_execution_context_t *ec){return NULL;}
static inline void mjit_cont_free(struct mjit_cont *cont){}
static inline void mjit_postponed_job_register_start_hook(void){}
@@ -172,5 +172,5 @@ static inline void mjit_remove_class_serial(rb_serial_t class_serial){}
static inline VALUE mjit_exec(rb_execution_context_t *ec) { return Qundef; /* unreachable */ }
static inline void mjit_child_after_fork(void){}
-#endif /* USE_MJIT */
-#endif /* RUBY_MJIT_H */
+#endif // USE_MJIT
+#endif // RUBY_MJIT_H