summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-17 01:20:22 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-17 01:20:22 +0000
commit6eac885ebef2b5189bb68acadcba0530bcc4bfb1 (patch)
tree845db20125e97134d4275794c98d2ace48cf9439 /compile.c
parentfcf6fa8781fe236a9761ad5d75fa1b87f1afeea2 (diff)
* compile.c (iseq_compile_each): check
iseq->compile_data->option->specialized_instruction for opt_* insn. * test/ruby/test_iseq.rb: check no specialized_instructions option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/compile.c b/compile.c
index 8672c0e..393590e 100644
--- a/compile.c
+++ b/compile.c
@@ -4406,8 +4406,8 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
*/
if (node->nd_recv && nd_type(node->nd_recv) == NODE_STR &&
node->nd_mid == idFreeze && node->nd_args == NULL &&
- iseq->compile_data->current_block == Qfalse)
- {
+ iseq->compile_data->current_block == Qfalse &&
+ iseq->compile_data->option->specialized_instruction) {
VALUE str = rb_fstring(node->nd_recv->nd_lit);
iseq_add_mark_object(iseq, str);
ADD_INSN1(ret, line, opt_str_freeze, str);
@@ -4422,8 +4422,8 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
if (node->nd_mid == idAREF && !private_recv_p(node) && node->nd_args &&
nd_type(node->nd_args) == NODE_ARRAY && node->nd_args->nd_alen == 1 &&
nd_type(node->nd_args->nd_head) == NODE_STR &&
- iseq->compile_data->current_block == Qfalse)
- {
+ iseq->compile_data->current_block == Qfalse &&
+ iseq->compile_data->option->specialized_instruction) {
VALUE str = rb_fstring(node->nd_args->nd_head->nd_lit);
node->nd_args->nd_head->nd_lit = str;
COMPILE(ret, "recv", node->nd_recv);
@@ -5419,7 +5419,8 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
if (node->nd_mid == idASET && !private_recv_p(node) && node->nd_args &&
nd_type(node->nd_args) == NODE_ARRAY && node->nd_args->nd_alen == 2 &&
nd_type(node->nd_args->nd_head) == NODE_STR &&
- iseq->compile_data->current_block == Qfalse)
+ iseq->compile_data->current_block == Qfalse &&
+ iseq->compile_data->option->specialized_instruction)
{
VALUE str = rb_fstring(node->nd_args->nd_head->nd_lit);
node->nd_args->nd_head->nd_lit = str;