зеркало из https://github.com/github/ruby.git
Use designated initializers for compile_status
to make it easier to understand what values are grouped. Just cosmetic changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
8b1241d877
Коммит
92b0331bcf
|
@ -203,24 +203,19 @@ bool
|
|||
mjit_compile(FILE *f, const rb_iseq_t *iseq, const char *funcname)
|
||||
{
|
||||
const struct rb_iseq_constant_body *body = iseq->body;
|
||||
|
||||
struct compile_status status;
|
||||
status.success = true;
|
||||
status.local_stack_p = !body->catch_except_p;
|
||||
status.stack_size_for_pos = (int *)alloca(sizeof(int) * body->iseq_size);
|
||||
struct compile_status status = {
|
||||
.success = true,
|
||||
.local_stack_p = !body->catch_except_p,
|
||||
.stack_size_for_pos = (int *)alloca(sizeof(int) * body->iseq_size),
|
||||
.cc_entries = (body->ci_size + body->ci_kw_size) > 0 ?
|
||||
alloca(sizeof(struct rb_call_cache) * (body->ci_size + body->ci_kw_size)) : NULL,
|
||||
.is_entries = (body->is_size > 0) ?
|
||||
alloca(sizeof(union iseq_inline_storage_entry) * body->is_size) : NULL,
|
||||
};
|
||||
memset(status.stack_size_for_pos, NOT_COMPILED_STACK_SIZE, sizeof(int) * body->iseq_size);
|
||||
|
||||
status.cc_entries = NULL;
|
||||
if ((body->ci_size + body->ci_kw_size) > 0)
|
||||
status.cc_entries = alloca(sizeof(struct rb_call_cache) * (body->ci_size + body->ci_kw_size));
|
||||
status.is_entries = NULL;
|
||||
if (body->is_size > 0)
|
||||
status.is_entries = alloca(sizeof(union iseq_inline_storage_entry) * body->is_size);
|
||||
|
||||
if ((status.cc_entries != NULL || status.is_entries != NULL)
|
||||
&& !mjit_copy_cache_from_main_thread(iseq, status.cc_entries, status.is_entries)) {
|
||||
&& !mjit_copy_cache_from_main_thread(iseq, status.cc_entries, status.is_entries))
|
||||
return false;
|
||||
}
|
||||
|
||||
/* For performance, we verify stack size only on compilation time (mjit_compile.inc.erb) without --jit-debug */
|
||||
if (!mjit_opts.debug) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче