File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
src/main/java/org/truffleruby Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,13 @@ public static Assumption getAssumption(FrameDescriptor descriptor) {
51
51
return (Assumption ) descriptor .getInfo ();
52
52
}
53
53
54
+ public static boolean isSpecialVariableAssumption (Assumption assumption ) {
55
+ return assumption .getName () == ASSUMPTION_NAME ;
56
+ }
57
+
54
58
public static boolean hasSpecialVariableAssumption (FrameDescriptor descriptor ) {
55
59
var info = descriptor .getInfo ();
56
- return info instanceof Assumption assumption && assumption . getName () == ASSUMPTION_NAME ;
60
+ return info instanceof Assumption assumption && isSpecialVariableAssumption ( assumption ) ;
57
61
}
58
62
59
63
public static boolean hasSpecialVariableStorageSlot (Frame frame ) {
@@ -65,7 +69,7 @@ private static boolean hasSpecialVariableStorageSlot(FrameDescriptor descriptor)
65
69
assert SLOT_INDEX < descriptor .getNumberOfSlots ();
66
70
assert descriptor .getSlotName (SLOT_INDEX ) == SLOT_NAME ;
67
71
Assumption assumption = (Assumption ) descriptor .getInfo ();
68
- return assumption . getName () == ASSUMPTION_NAME ;
72
+ return isSpecialVariableAssumption ( assumption ) ;
69
73
}
70
74
71
75
/** $~ */
Original file line number Diff line number Diff line change 15
15
import com .oracle .truffle .api .nodes .ExplodeLoop ;
16
16
import org .truffleruby .language .threadlocal .SpecialVariableStorage ;
17
17
18
- import static org .truffleruby .language .threadlocal .SpecialVariableStorage .ASSUMPTION_NAME ;
19
-
20
18
public final class BlockFrameDescriptorInfo {
21
19
22
20
@ ExplodeLoop
@@ -33,12 +31,11 @@ public static FrameDescriptor getDeclarationFrameDescriptor(FrameDescriptor topD
33
31
private final Assumption specialVariableAssumption ;
34
32
35
33
public BlockFrameDescriptorInfo (Assumption specialVariableAssumption ) {
36
- assert specialVariableAssumption != null && specialVariableAssumption . getName () == ASSUMPTION_NAME ;
34
+ assert SpecialVariableStorage . isSpecialVariableAssumption ( specialVariableAssumption ) ;
37
35
this .specialVariableAssumption = specialVariableAssumption ;
38
36
}
39
37
40
38
public BlockFrameDescriptorInfo (FrameDescriptor descriptor ) {
41
- assert descriptor != null && descriptor .getInfo () != null ;
42
39
this .descriptor = descriptor ;
43
40
this .specialVariableAssumption = getSpecialVariableAssumptionFromDescriptor (descriptor );
44
41
}
Original file line number Diff line number Diff line change @@ -191,7 +191,6 @@ private static FrameDescriptor.Builder newFrameDescriptorBuilderForMethod(Assump
191
191
return builder ;
192
192
}
193
193
194
-
195
194
public static FrameDescriptor .Builder newFrameDescriptorBuilderForMethod () {
196
195
var specialVariableAssumption = createSpecialVariableAssumption ();
197
196
return newFrameDescriptorBuilderForMethod (specialVariableAssumption );
You can’t perform that action at this time.
0 commit comments