mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	Rename get/setinlinecache to opt_get/opt_setinlinecache
The instructions are just for optimization. To clarity the intention, this change adds the prefix "opt_", like "opt_case_dispatch". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									c8cfd78b40
								
							
						
					
					
						commit
						b06649b912
					
				
					 3 changed files with 9 additions and 9 deletions
				
			
		
							
								
								
									
										12
									
								
								compile.c
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								compile.c
									
										
									
									
									
								
							| 
						 | 
					@ -6829,9 +6829,9 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
 | 
				
			||||||
	    LABEL *lend = NEW_LABEL(line);
 | 
						    LABEL *lend = NEW_LABEL(line);
 | 
				
			||||||
	    int ic_index = body->is_size++;
 | 
						    int ic_index = body->is_size++;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	    ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index));
 | 
						    ADD_INSN2(ret, line, opt_getinlinecache, lend, INT2FIX(ic_index));
 | 
				
			||||||
	    ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_vid));
 | 
						    ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_vid));
 | 
				
			||||||
	    ADD_INSN1(ret, line, setinlinecache, INT2FIX(ic_index));
 | 
						    ADD_INSN1(ret, line, opt_setinlinecache, INT2FIX(ic_index));
 | 
				
			||||||
	    ADD_LABEL(ret, lend);
 | 
						    ADD_LABEL(ret, lend);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	else {
 | 
						else {
 | 
				
			||||||
| 
						 | 
					@ -7187,7 +7187,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
 | 
				
			||||||
	    CHECK(compile_const_prefix(iseq, node, pref, body));
 | 
						    CHECK(compile_const_prefix(iseq, node, pref, body));
 | 
				
			||||||
	    if (LIST_INSN_SIZE_ZERO(pref)) {
 | 
						    if (LIST_INSN_SIZE_ZERO(pref)) {
 | 
				
			||||||
		if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
 | 
							if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
 | 
				
			||||||
		    ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index));
 | 
							    ADD_INSN2(ret, line, opt_getinlinecache, lend, INT2FIX(ic_index));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		else {
 | 
							else {
 | 
				
			||||||
		    ADD_INSN(ret, line, putnil);
 | 
							    ADD_INSN(ret, line, putnil);
 | 
				
			||||||
| 
						 | 
					@ -7196,7 +7196,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
 | 
				
			||||||
		ADD_SEQ(ret, body);
 | 
							ADD_SEQ(ret, body);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
 | 
							if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
 | 
				
			||||||
		    ADD_INSN1(ret, line, setinlinecache, INT2FIX(ic_index));
 | 
							    ADD_INSN1(ret, line, opt_setinlinecache, INT2FIX(ic_index));
 | 
				
			||||||
		    ADD_LABEL(ret, lend);
 | 
							    ADD_LABEL(ret, lend);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	    }
 | 
						    }
 | 
				
			||||||
| 
						 | 
					@ -7224,7 +7224,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* add cache insn */
 | 
						/* add cache insn */
 | 
				
			||||||
	if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
 | 
						if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
 | 
				
			||||||
	    ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index));
 | 
						    ADD_INSN2(ret, line, opt_getinlinecache, lend, INT2FIX(ic_index));
 | 
				
			||||||
	    ADD_INSN(ret, line, pop);
 | 
						    ADD_INSN(ret, line, pop);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7232,7 +7232,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
 | 
				
			||||||
	ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_mid));
 | 
						ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_mid));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
 | 
						if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
 | 
				
			||||||
	    ADD_INSN1(ret, line, setinlinecache, INT2FIX(ic_index));
 | 
						    ADD_INSN1(ret, line, opt_setinlinecache, INT2FIX(ic_index));
 | 
				
			||||||
	    ADD_LABEL(ret, lend);
 | 
						    ADD_LABEL(ret, lend);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -985,7 +985,7 @@ branchnil
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* push inline-cached value and go to dst if it is valid */
 | 
					/* push inline-cached value and go to dst if it is valid */
 | 
				
			||||||
DEFINE_INSN
 | 
					DEFINE_INSN
 | 
				
			||||||
getinlinecache
 | 
					opt_getinlinecache
 | 
				
			||||||
(OFFSET dst, IC ic)
 | 
					(OFFSET dst, IC ic)
 | 
				
			||||||
()
 | 
					()
 | 
				
			||||||
(VALUE val)
 | 
					(VALUE val)
 | 
				
			||||||
| 
						 | 
					@ -1001,7 +1001,7 @@ getinlinecache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* set inline cache */
 | 
					/* set inline cache */
 | 
				
			||||||
DEFINE_INSN
 | 
					DEFINE_INSN
 | 
				
			||||||
setinlinecache
 | 
					opt_setinlinecache
 | 
				
			||||||
(IC ic)
 | 
					(IC ic)
 | 
				
			||||||
(VALUE val)
 | 
					(VALUE val)
 | 
				
			||||||
(VALUE val)
 | 
					(VALUE val)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -444,7 +444,7 @@ class TestJIT < Test::Unit::TestCase
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def test_compile_insn_inlinecache
 | 
					  def test_compile_insn_inlinecache
 | 
				
			||||||
    assert_compile_once('Struct', result_inspect: 'Struct', insns: %i[getinlinecache setinlinecache])
 | 
					    assert_compile_once('Struct', result_inspect: 'Struct', insns: %i[opt_getinlinecache opt_setinlinecache])
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def test_compile_insn_once
 | 
					  def test_compile_insn_once
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue