diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2020-06-20 17:13:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-20 17:13:03 -0700 |
commit | 7561db8c009bb79a75024fa4ed0350bfb3d0626c (patch) | |
tree | e11e51b98e795e09d51b3062d7f71987d7225187 /compile.c | |
parent | d95249ade34626dc3ae82f8bfc84e1668b1b8d01 (diff) |
Introduce Primitive.attr! to annotate 'inline' (#3242)
[Feature #15589]
Notes
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -7274,6 +7274,11 @@ compile_call(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, co GET_VM()->builtin_inline_index++; return COMPILE_OK; } + else if (strcmp("attr!", builtin_func) == 0) { + // There's only "inline" attribute for now + iseq->body->builtin_inline_p = true; + return COMPILE_OK; + } if (1) { rb_bug("can't find builtin function:%s", builtin_func); @@ -10815,6 +10820,7 @@ ibf_dump_iseq_each(struct ibf_dump *dump, const rb_iseq_t *iseq) ibf_dump_write_small_value(dump, body->ci_size); ibf_dump_write_small_value(dump, body->stack_max); ibf_dump_write_small_value(dump, body->catch_except_p); + ibf_dump_write_small_value(dump, body->builtin_inline_p); #undef IBF_BODY_OFFSET @@ -10920,6 +10926,7 @@ ibf_load_iseq_each(struct ibf_load *load, rb_iseq_t *iseq, ibf_offset_t offset) const unsigned int ci_size = (unsigned int)ibf_load_small_value(load, &reading_pos); const unsigned int stack_max = (unsigned int)ibf_load_small_value(load, &reading_pos); const char catch_except_p = (char)ibf_load_small_value(load, &reading_pos); + const bool builtin_inline_p = (bool)ibf_load_small_value(load, &reading_pos); #undef IBF_BODY_OFFSET @@ -10958,6 +10965,7 @@ ibf_load_iseq_each(struct ibf_load *load, rb_iseq_t *iseq, ibf_offset_t offset) load_body->location.code_location.end_pos.lineno = location_code_location_end_pos_lineno; load_body->location.code_location.end_pos.column = location_code_location_end_pos_column; load_body->catch_except_p = catch_except_p; + load_body->builtin_inline_p = builtin_inline_p; load_body->is_entries = ZALLOC_N(union iseq_inline_storage_entry, is_size); ibf_load_ci_entries(load, ci_entries_offset, ci_size, &load_body->call_data); |