@@ -109,43 +109,45 @@ private static void raiseError(long handle) {
109
109
}
110
110
111
111
@ GenerateUncached
112
+ @ GenerateInline
113
+ @ GenerateCached (false )
112
114
@ ImportStatic (ValueWrapperManager .class )
113
115
public abstract static class NativeToWrapperNode extends RubyBaseNode {
114
116
115
- public abstract ValueWrapper execute (long handle );
117
+ public abstract ValueWrapper execute (Node node , long handle );
116
118
117
119
@ Specialization (guards = "handle == FALSE_HANDLE" )
118
- protected ValueWrapper unwrapFalse (long handle ) {
120
+ protected static ValueWrapper unwrapFalse (long handle ) {
119
121
return new ValueWrapper (false , FALSE_HANDLE , null );
120
122
}
121
123
122
124
@ Specialization (guards = "handle == TRUE_HANDLE" )
123
- protected ValueWrapper unwrapTrue (long handle ) {
125
+ protected static ValueWrapper unwrapTrue (long handle ) {
124
126
return new ValueWrapper (true , TRUE_HANDLE , null );
125
127
}
126
128
127
129
@ Specialization (guards = "handle == UNDEF_HANDLE" )
128
- protected ValueWrapper unwrapUndef (long handle ) {
130
+ protected static ValueWrapper unwrapUndef (long handle ) {
129
131
return new ValueWrapper (NotProvided .INSTANCE , UNDEF_HANDLE , null );
130
132
}
131
133
132
134
@ Specialization (guards = "handle == NIL_HANDLE" )
133
- protected ValueWrapper unwrapNil (long handle ) {
135
+ protected static ValueWrapper unwrapNil (long handle ) {
134
136
return nil .getValueWrapper ();
135
137
}
136
138
137
139
@ Specialization (guards = "isTaggedLong(handle)" )
138
- protected ValueWrapper unwrapTaggedLong (long handle ) {
140
+ protected static ValueWrapper unwrapTaggedLong (long handle ) {
139
141
return new ValueWrapper (null , handle , null );
140
142
}
141
143
142
144
@ Specialization (guards = "isTaggedObject(handle)" )
143
- protected ValueWrapper unwrapTaggedObject (long handle ) {
144
- return getContext ().getValueWrapperManager ().getWrapperFromHandleMap (handle , getLanguage ());
145
+ protected static ValueWrapper unwrapTaggedObject (Node node , long handle ) {
146
+ return getContext (node ).getValueWrapperManager ().getWrapperFromHandleMap (handle , getLanguage (node ));
145
147
}
146
148
147
149
@ Fallback
148
- protected ValueWrapper unWrapUnexpectedHandle (long handle ) {
150
+ protected static ValueWrapper unWrapUnexpectedHandle (long handle ) {
149
151
// Avoid throwing a specialization exception when given an uninitialized or corrupt
150
152
// handle.
151
153
return null ;
@@ -165,7 +167,7 @@ protected ValueWrapper wrappedValueWrapper(ValueWrapper value) {
165
167
@ Specialization
166
168
protected ValueWrapper longToWrapper (long value ,
167
169
@ Cached @ Shared NativeToWrapperNode nativeToWrapperNode ) {
168
- return nativeToWrapperNode .execute (value );
170
+ return nativeToWrapperNode .execute (this , value );
169
171
}
170
172
171
173
@ Fallback
@@ -180,7 +182,7 @@ protected ValueWrapper genericToWrapper(Object value,
180
182
unsupportedProfile .enter (this );
181
183
throw new RaiseException (getContext (), coreExceptions ().argumentError (e .getMessage (), this , e ));
182
184
}
183
- return nativeToWrapperNode .execute (handle );
185
+ return nativeToWrapperNode .execute (this , handle );
184
186
}
185
187
186
188
protected int getCacheLimit () {
0 commit comments