38
38
import com .oracle .truffle .espresso .impl .Method ;
39
39
import com .oracle .truffle .espresso .impl .ObjectKlass ;
40
40
import com .oracle .truffle .espresso .meta .Meta ;
41
- import com .oracle .truffle .espresso .nodes .bytecodes .InitCheck ;
42
41
import com .oracle .truffle .espresso .runtime .EspressoContext ;
43
42
import com .oracle .truffle .espresso .runtime .staticobject .StaticObject ;
44
43
import com .oracle .truffle .espresso .substitutions .EspressoSubstitutions ;
@@ -61,38 +60,34 @@ static StaticObject doDefault(@SuppressWarnings("unused") StaticObject self, @Ja
61
60
@ Bind ("getContext()" ) EspressoContext context ,
62
61
@ Cached ("create(context.getMeta().jvmci.EspressoResolvedInstanceType_init.getCallTarget())" ) DirectCallNode objectTypeConstructor ,
63
62
@ Cached ("create(context.getMeta().jvmci.EspressoResolvedArrayType_init.getCallTarget())" ) DirectCallNode arrayTypeConstructor ,
64
- @ Cached ("create(context.getMeta().jvmci.EspressoResolvedPrimitiveType_forBasicType.getCallTarget())" ) DirectCallNode forBasicType ,
65
- @ Cached InitCheck initCheck ) {
63
+ @ Cached ("create(context.getMeta().jvmci.EspressoResolvedPrimitiveType_forBasicType.getCallTarget())" ) DirectCallNode forBasicType ) {
66
64
assert context .getLanguage ().isInternalJVMCIEnabled ();
67
65
Meta meta = context .getMeta ();
68
66
if (StaticObject .isNull (clazz )) {
69
67
throw meta .throwIllegalArgumentExceptionBoundary ("Class parameter was null" );
70
68
}
71
69
Klass klass = clazz .getMirrorKlass (meta );
72
- return toJVMCIType (klass , objectTypeConstructor , arrayTypeConstructor , forBasicType , initCheck , context , meta );
70
+ return toJVMCIType (klass , objectTypeConstructor , arrayTypeConstructor , forBasicType , context , meta );
73
71
}
74
72
}
75
73
76
- static StaticObject toJVMCIType (Klass klass , DirectCallNode objectTypeConstructor , DirectCallNode arrayTypeConstructor , DirectCallNode forBasicType , InitCheck initCheck , EspressoContext context ,
77
- Meta meta ) {
74
+ static StaticObject toJVMCIType (Klass klass , DirectCallNode objectTypeConstructor , DirectCallNode arrayTypeConstructor , DirectCallNode forBasicType , EspressoContext context , Meta meta ) {
78
75
if (klass .isArray ()) {
79
76
StaticObject jvmciMirror = meta .jvmci .EspressoResolvedArrayType .allocateInstance (context );
80
77
ArrayKlass arrayKlass = (ArrayKlass ) klass ;
81
- arrayTypeConstructor .call (jvmciMirror , toJVMCIElementalType (arrayKlass .getElementalType (), objectTypeConstructor , forBasicType , initCheck , context , meta ), arrayKlass .getDimension (),
78
+ arrayTypeConstructor .call (jvmciMirror , toJVMCIElementalType (arrayKlass .getElementalType (), objectTypeConstructor , forBasicType , context , meta ), arrayKlass .getDimension (),
82
79
arrayKlass .mirror ());
83
80
return jvmciMirror ;
84
81
} else {
85
- return toJVMCIElementalType (klass , objectTypeConstructor , forBasicType , initCheck , context , meta );
82
+ return toJVMCIElementalType (klass , objectTypeConstructor , forBasicType , context , meta );
86
83
}
87
84
}
88
85
89
- static StaticObject toJVMCIObjectType (Klass klass , DirectCallNode objectTypeConstructor , DirectCallNode arrayTypeConstructor , DirectCallNode forBasicType , InitCheck initCheck ,
90
- EspressoContext context ,
91
- Meta meta ) {
86
+ static StaticObject toJVMCIObjectType (Klass klass , DirectCallNode objectTypeConstructor , DirectCallNode arrayTypeConstructor , DirectCallNode forBasicType , EspressoContext context , Meta meta ) {
92
87
if (klass .isArray ()) {
93
88
StaticObject jvmciMirror = meta .jvmci .EspressoResolvedArrayType .allocateInstance (context );
94
89
ArrayKlass arrayKlass = (ArrayKlass ) klass ;
95
- arrayTypeConstructor .call (jvmciMirror , toJVMCIElementalType (arrayKlass .getElementalType (), objectTypeConstructor , forBasicType , initCheck , context , meta ), arrayKlass .getDimension (),
90
+ arrayTypeConstructor .call (jvmciMirror , toJVMCIElementalType (arrayKlass .getElementalType (), objectTypeConstructor , forBasicType , context , meta ), arrayKlass .getDimension (),
96
91
arrayKlass .mirror ());
97
92
return jvmciMirror ;
98
93
} else {
@@ -111,9 +106,9 @@ static StaticObject toJVMCIObjectType(Klass klass, Meta meta) {
111
106
}
112
107
}
113
108
114
- static StaticObject toJVMCIElementalType (Klass klass , DirectCallNode objectTypeConstructor , DirectCallNode forBasicType , InitCheck initCheck , EspressoContext context , Meta meta ) {
109
+ static StaticObject toJVMCIElementalType (Klass klass , DirectCallNode objectTypeConstructor , DirectCallNode forBasicType , EspressoContext context , Meta meta ) {
115
110
if (klass .isPrimitive ()) {
116
- return toJVMCIPrimitiveType (klass .getJavaKind (), forBasicType , initCheck , meta );
111
+ return toJVMCIPrimitiveType (klass .getJavaKind (), forBasicType , meta );
117
112
} else {
118
113
return toJVMCIInstanceType ((ObjectKlass ) klass , objectTypeConstructor , context , meta );
119
114
}
@@ -127,15 +122,14 @@ static StaticObject toJVMCIElementalType(Klass klass, Meta meta) {
127
122
}
128
123
}
129
124
130
- static StaticObject toJVMCIPrimitiveType (JavaKind kind , DirectCallNode forBasicType , InitCheck initCheck , Meta meta ) {
131
- initCheck . execute ( meta .jvmci .EspressoResolvedPrimitiveType );
125
+ static StaticObject toJVMCIPrimitiveType (JavaKind kind , DirectCallNode forBasicType , Meta meta ) {
126
+ meta .jvmci .EspressoResolvedPrimitiveType . safeInitialize ( );
132
127
StaticObject result = (StaticObject ) forBasicType .call (kind .getBasicType ());
133
128
assert !StaticObject .isNull (result );
134
129
return result ;
135
130
}
136
131
137
132
static StaticObject toJVMCIPrimitiveType (JavaKind kind , Meta meta ) {
138
- meta .jvmci .EspressoResolvedPrimitiveType .initialize ();
139
133
StaticObject result = (StaticObject ) meta .jvmci .EspressoResolvedPrimitiveType_forBasicType .invokeDirectStatic (kind .getBasicType ());
140
134
assert !StaticObject .isNull (result );
141
135
return result ;
@@ -158,6 +152,7 @@ static StaticObject toJVMCIInstanceType(ObjectKlass klass, Meta meta) {
158
152
static StaticObject toJVMCIUnresolvedType (ByteSequence symbol , DirectCallNode createUnresolved , Meta meta ) {
159
153
assert Validation .validTypeDescriptor (symbol , true );
160
154
assert (symbol .byteAt (0 ) == 'L' && symbol .byteAt (symbol .length () - 1 ) == ';' ) || symbol .byteAt (0 ) == '[' : symbol ;
155
+ meta .jvmci .UnresolvedJavaType .safeInitialize ();
161
156
return (StaticObject ) createUnresolved .call (meta .toGuestString (symbol ));
162
157
}
163
158
0 commit comments