summaryrefslogtreecommitdiff
path: root/mini_builtin.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2021-06-14 17:32:42 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2021-06-16 14:09:09 -0700
commitc10d5085a247266c6399dc6fb68706d87cbdab05 (patch)
tree83e8bb48cf75b3e569fa789ee59af2f6f4170df9 /mini_builtin.c
parent2b17d2f2970d382ac61d15d66f46d1c56f8f2598 (diff)
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.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4573
Diffstat (limited to 'mini_builtin.c')
-rw-r--r--mini_builtin.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/mini_builtin.c b/mini_builtin.c
index 86803e1656..eade34710d 100644
--- a/mini_builtin.c
+++ b/mini_builtin.c
@@ -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);