mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	Do not JIT inline builtin methods
It's probably not worth it because there's nothing we can optimize in such builtin methods. It's worth JIT only when inlined.
This commit is contained in:
		
							parent
							
								
									ab62aa7037
								
							
						
					
					
						commit
						bb4a2351cb
					
				
					 2 changed files with 5 additions and 0 deletions
				
			
		
							
								
								
									
										1
									
								
								mjit.h
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								mjit.h
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -108,6 +108,7 @@ static inline int
 | 
			
		|||
mjit_target_iseq_p(struct rb_iseq_constant_body *body)
 | 
			
		||||
{
 | 
			
		||||
    return (body->type == ISEQ_TYPE_METHOD || body->type == ISEQ_TYPE_BLOCK)
 | 
			
		||||
        && !body->builtin_inline_p
 | 
			
		||||
        && body->iseq_size < JIT_ISEQ_SIZE_THRESHOLD;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1007,6 +1007,10 @@ class TestJIT < Test::Unit::TestCase
 | 
			
		|||
    end;
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def test_builtin_frame_omitted_inlining
 | 
			
		||||
    assert_eval_with_jit('0.zero?; 0.zero?; 3.times { p 0.zero? }', stdout: "true\ntrue\ntrue\n", success_count: 1, min_calls: 2)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def test_program_counter_with_regexpmatch
 | 
			
		||||
    assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: "aa", success_count: 1)
 | 
			
		||||
    begin;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue