@@ -389,7 +389,7 @@ Object newRange(RubyClass rubyClass, Object begin, Object end, Object maybeExclu
389
389
@ Cached BooleanCastWithDefaultNode booleanCastWithDefaultNode ,
390
390
@ Cached NewRangeNode newRangeNode ) {
391
391
final boolean excludeEnd = booleanCastWithDefaultNode .execute (this , maybeExcludeEnd , false );
392
- return newRangeNode .execute (rubyClass , begin , end , excludeEnd );
392
+ return newRangeNode .execute (this , rubyClass , begin , end , excludeEnd );
393
393
}
394
394
}
395
395
@@ -407,7 +407,7 @@ public abstract static class RangeLiteralNode extends RubyContextSourceNode {
407
407
@ Specialization
408
408
Object doRange (Object begin , Object end ,
409
409
@ Cached NewRangeNode newRangeNode ) {
410
- return newRangeNode .execute (coreLibrary ().rangeClass , begin , end , getExcludeEnd ());
410
+ return newRangeNode .execute (this , coreLibrary ().rangeClass , begin , end , getExcludeEnd ());
411
411
}
412
412
413
413
@ Override
@@ -418,37 +418,40 @@ public RubyNode cloneUninitialized() {
418
418
}
419
419
}
420
420
421
+ @ GenerateCached (false )
422
+ @ GenerateInline
421
423
public abstract static class NewRangeNode extends RubyBaseNode {
422
424
423
- public abstract Object execute (RubyClass rubyClass , Object begin , Object end , boolean excludeEnd );
425
+ public abstract Object execute (Node node , RubyClass rubyClass , Object begin , Object end , boolean excludeEnd );
424
426
425
427
@ Specialization (guards = "rubyClass == getRangeClass()" )
426
- RubyIntRange intRange (RubyClass rubyClass , int begin , int end , boolean excludeEnd ) {
428
+ static RubyIntRange intRange (RubyClass rubyClass , int begin , int end , boolean excludeEnd ) {
427
429
return new RubyIntRange (excludeEnd , begin , end );
428
430
}
429
431
430
432
@ Specialization (guards = { "rubyClass == getRangeClass()" , "fitsInInteger(begin)" , "fitsInInteger(end)" })
431
- RubyIntRange longFittingIntRange (RubyClass rubyClass , long begin , long end , boolean excludeEnd ) {
433
+ static RubyIntRange longFittingIntRange (RubyClass rubyClass , long begin , long end , boolean excludeEnd ) {
432
434
return new RubyIntRange (excludeEnd , (int ) begin , (int ) end );
433
435
}
434
436
435
437
@ Specialization (guards = { "rubyClass == getRangeClass()" , "!fitsInInteger(begin) || !fitsInInteger(end)" })
436
- RubyLongRange longRange (RubyClass rubyClass , long begin , long end , boolean excludeEnd ) {
438
+ static RubyLongRange longRange (RubyClass rubyClass , long begin , long end , boolean excludeEnd ) {
437
439
return new RubyLongRange (excludeEnd , begin , end );
438
440
}
439
441
440
442
@ Specialization (guards = { "!standardClass || (!isImplicitLong(begin) || !isImplicitLong(end))" })
441
- RubyObjectRange objectRange (RubyClass rubyClass , Object begin , Object end , boolean excludeEnd ,
442
- @ Cached DispatchNode compare ,
443
+ static RubyObjectRange objectRange (Node node , RubyClass rubyClass , Object begin , Object end , boolean excludeEnd ,
444
+ @ Cached ( inline = false ) DispatchNode compare ,
443
445
@ Bind ("rubyClass == getRangeClass()" ) boolean standardClass ) {
444
446
445
447
if (compare .call (begin , "<=>" , end ) == nil && end != nil && begin != nil ) {
446
- throw new RaiseException (getContext (), coreExceptions ().argumentError ("bad value for range" , this ));
448
+ throw new RaiseException (getContext (node ),
449
+ coreExceptions (node ).argumentError ("bad value for range" , node ));
447
450
}
448
451
449
- final Shape shape = getLanguage ().objectRangeShape ;
452
+ final Shape shape = getLanguage (node ).objectRangeShape ;
450
453
final RubyObjectRange range = new RubyObjectRange (rubyClass , shape , excludeEnd , begin , end , standardClass );
451
- AllocationTracing .trace (range , this );
454
+ AllocationTracing .trace (range , node );
452
455
return range ;
453
456
}
454
457
0 commit comments