Enable frozen_string_literal in builtin_iseq_load

Currently this has a fairly minor effect as strings are not used heavily
inside the builtins (outside of warnings, requires, and errors).
Hopefully this allows us to use strings in the future where appropriate.
This commit is contained in:
John Hawthorn 2021-06-14 17:32:42 -07:00 коммит произвёл Aaron Patterson
Родитель 2b17d2f297
Коммит c10d5085a2
1 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -23,7 +23,20 @@ builtin_iseq_load(const char *feature_name, const struct rb_builtin_function *ta
vm->builtin_function_table = table;
vm->builtin_inline_index = 0;
const rb_iseq_t *iseq = rb_iseq_new(&ast->body, name_str, name_str, Qnil, NULL, ISEQ_TYPE_TOP);
static const rb_compile_option_t optimization = {
TRUE, /* int inline_const_cache; */
TRUE, /* int peephole_optimization; */
FALSE,/* int tailcall_optimization; */
TRUE, /* int specialized_instruction; */
TRUE, /* int operands_unification; */
TRUE, /* int instructions_unification; */
TRUE, /* int stack_caching; */
TRUE, /* int frozen_string_literal; */
FALSE, /* int debug_frozen_string_literal; */
FALSE, /* unsigned int coverage_enabled; */
0, /* int debug_level; */
};
const rb_iseq_t *iseq = rb_iseq_new_with_opt(&ast->body, name_str, name_str, Qnil, INT2FIX(0), NULL, 0, ISEQ_TYPE_TOP, &optimization);
GET_VM()->builtin_function_table = NULL;
rb_ast_dispose(ast);