@@ -38,7 +38,7 @@ public abstract class WrapNode extends RubyBaseNode {
38
38
public abstract TruffleObject execute (Object value );
39
39
40
40
@ Specialization
41
- public TruffleObject wrapLong (long value ,
41
+ public ValueWrapper wrapLong (long value ,
42
42
@ Cached ("create()" ) BranchProfile smallFixnumProfile ) {
43
43
if (value >= ValueWrapperManager .MIN_FIXNUM_VALUE && value <= ValueWrapperManager .MAX_FIXNUM_VALUE ) {
44
44
smallFixnumProfile .enter ();
@@ -50,40 +50,40 @@ public TruffleObject wrapLong(long value,
50
50
}
51
51
52
52
@ Specialization
53
- public TruffleObject wrapDouble (double value ) {
53
+ public ValueWrapper wrapDouble (double value ) {
54
54
return getContext ().getValueWrapperManager ().doubleWrapper (value );
55
55
}
56
56
57
57
@ Specialization
58
- public TruffleObject wrapBoolean (boolean value ) {
58
+ public ValueWrapper wrapBoolean (boolean value ) {
59
59
return new ValueWrapper (value , value ? TRUE_HANDLE : FALSE_HANDLE );
60
60
}
61
61
62
62
@ Specialization
63
- public TruffleObject wrapUndef (NotProvided value ) {
63
+ public ValueWrapper wrapUndef (NotProvided value ) {
64
64
return new ValueWrapper (value , UNDEF_HANDLE );
65
65
}
66
66
67
67
@ Specialization
68
- public TruffleObject wrapWrappedValue (ValueWrapper value ) {
68
+ public ValueWrapper wrapWrappedValue (ValueWrapper value ) {
69
69
throw new RaiseException (getContext (), coreExceptions ().argumentError (RopeOperations .encodeAscii ("Wrapping wrapped object" , UTF8Encoding .INSTANCE ), this ));
70
70
}
71
71
72
72
@ Specialization (guards = "isNil(value)" )
73
- public TruffleObject wrapNil (DynamicObject value ) {
73
+ public ValueWrapper wrapNil (DynamicObject value ) {
74
74
return new ValueWrapper (nil (), NIL_HANDLE );
75
75
}
76
76
77
77
@ Specialization (guards = { "isRubyBasicObject(value)" , "!isNil(value)" })
78
- public TruffleObject wrapValue (DynamicObject value ,
78
+ public ValueWrapper wrapValue (DynamicObject value ,
79
79
@ Cached ("createReader()" ) ReadObjectFieldNode readWrapperNode ,
80
80
@ Cached ("createWriter()" ) WriteObjectFieldNode writeWrapperNode ,
81
81
@ Cached ("create()" ) BranchProfile noHandleProfile ) {
82
- TruffleObject wrapper = (TruffleObject ) readWrapperNode .execute (value );
82
+ ValueWrapper wrapper = (ValueWrapper ) readWrapperNode .execute (value );
83
83
if (wrapper == null ) {
84
84
noHandleProfile .enter ();
85
85
synchronized (value ) {
86
- wrapper = (DynamicObject ) readWrapperNode .execute (value );
86
+ wrapper = (ValueWrapper ) readWrapperNode .execute (value );
87
87
if (wrapper == null ) {
88
88
wrapper = new ValueWrapper (value , UNSET_HANDLE );
89
89
writeWrapperNode .write (value , wrapper );
@@ -106,8 +106,4 @@ public WriteObjectFieldNode createWriter() {
106
106
return WriteObjectFieldNodeGen .create (Layouts .VALUE_WRAPPER_IDENTIFIER );
107
107
}
108
108
109
- public boolean isWrapped (TruffleObject value ) {
110
- return value instanceof ValueWrapper ;
111
- }
112
-
113
109
}
0 commit comments