@@ -147,18 +147,18 @@ public abstract static class ObjectLiteralMemberNode extends JavaScriptBaseNode
147
147
148
148
protected final boolean isStatic ;
149
149
protected final byte attributes ;
150
- protected final boolean isField ;
150
+ protected final boolean isFieldOrStaticBlock ;
151
151
protected final boolean isAnonymousFunctionDefinition ;
152
152
153
153
public ObjectLiteralMemberNode (boolean isStatic , int attributes ) {
154
154
this (isStatic , attributes , false , false );
155
155
}
156
156
157
- public ObjectLiteralMemberNode (boolean isStatic , int attributes , boolean isField , boolean isAnonymousFunctionDefinition ) {
157
+ public ObjectLiteralMemberNode (boolean isStatic , int attributes , boolean isFieldOrStaticBlock , boolean isAnonymousFunctionDefinition ) {
158
158
assert attributes == (attributes & JSAttributes .ATTRIBUTES_MASK );
159
159
this .isStatic = isStatic ;
160
160
this .attributes = (byte ) attributes ;
161
- this .isField = isField ;
161
+ this .isFieldOrStaticBlock = isFieldOrStaticBlock ;
162
162
this .isAnonymousFunctionDefinition = isAnonymousFunctionDefinition ;
163
163
}
164
164
@@ -180,8 +180,8 @@ public final boolean isStatic() {
180
180
return isStatic ;
181
181
}
182
182
183
- public final boolean isField () {
184
- return isField ;
183
+ public final boolean isFieldOrStaticBlock () {
184
+ return isFieldOrStaticBlock ;
185
185
}
186
186
187
187
public final boolean isAnonymousFunctionDefinition () {
@@ -218,9 +218,9 @@ private abstract static class CachingObjectLiteralMemberNode extends ObjectLiter
218
218
protected final Object name ;
219
219
@ CompilationFinal private DynamicObjectLibrary dynamicObjectLibrary ;
220
220
221
- CachingObjectLiteralMemberNode (Object name , boolean isStatic , int attributes , boolean isField ) {
222
- super (isStatic , attributes , isField , false );
223
- assert JSRuntime .isPropertyKey (name ) || (name == null && isStatic && isField ) : name ;
221
+ CachingObjectLiteralMemberNode (Object name , boolean isStatic , int attributes , boolean isFieldOrStaticBlock ) {
222
+ super (isStatic , attributes , isFieldOrStaticBlock , false );
223
+ assert JSRuntime .isPropertyKey (name ) || (name == null && isStatic && isFieldOrStaticBlock ) : name ;
224
224
this .name = name ;
225
225
}
226
226
@@ -243,8 +243,8 @@ protected final DynamicObjectLibrary dynamicObjectLibrary(JSContext context) {
243
243
private static class ObjectLiteralDataMemberNode extends CachingObjectLiteralMemberNode {
244
244
@ Child protected JavaScriptNode valueNode ;
245
245
246
- ObjectLiteralDataMemberNode (Object name , boolean isStatic , int attributes , JavaScriptNode valueNode , boolean isField ) {
247
- super (name , isStatic , attributes , isField );
246
+ ObjectLiteralDataMemberNode (Object name , boolean isStatic , int attributes , JavaScriptNode valueNode , boolean isFieldOrStaticBlock ) {
247
+ super (name , isStatic , attributes , isFieldOrStaticBlock );
248
248
this .valueNode = valueNode ;
249
249
}
250
250
@@ -260,7 +260,7 @@ public Object evaluateValue(VirtualFrame frame, DynamicObject homeObject) {
260
260
}
261
261
262
262
private void execute (DynamicObject obj , Object value , JSContext context ) {
263
- if (isField ) {
263
+ if (isFieldOrStaticBlock ) {
264
264
return ;
265
265
}
266
266
DynamicObjectLibrary dynamicObjectLib = dynamicObjectLibrary (context );
@@ -269,7 +269,7 @@ private void execute(DynamicObject obj, Object value, JSContext context) {
269
269
270
270
@ Override
271
271
protected ObjectLiteralMemberNode copyUninitialized (Set <Class <? extends Tag >> materializedTags ) {
272
- return new ObjectLiteralDataMemberNode (name , isStatic , attributes , JavaScriptNode .cloneUninitialized (valueNode , materializedTags ), isField );
272
+ return new ObjectLiteralDataMemberNode (name , isStatic , attributes , JavaScriptNode .cloneUninitialized (valueNode , materializedTags ), isFieldOrStaticBlock );
273
273
}
274
274
}
275
275
@@ -338,7 +338,7 @@ public abstract static class ComputedObjectLiteralDataMemberNode extends ObjectL
338
338
}
339
339
340
340
@ SuppressWarnings ("unused" )
341
- @ Specialization (guards = {"!isField " , "!isAnonymousFunctionDefinition" , "setFunctionName==null" , "!isMethodNode(valueNode)" }, limit = "3" )
341
+ @ Specialization (guards = {"!isFieldOrStaticBlock " , "!isAnonymousFunctionDefinition" , "setFunctionName==null" , "!isMethodNode(valueNode)" }, limit = "3" )
342
342
public final void doNoFieldNoFunctionDef (VirtualFrame frame , DynamicObject receiver , DynamicObject homeObject , JSContext context ,
343
343
@ CachedLibrary ("receiver" ) DynamicObjectLibrary dynamicObject ) {
344
344
Object key = evaluateKey (frame );
@@ -349,7 +349,7 @@ public final void doNoFieldNoFunctionDef(VirtualFrame frame, DynamicObject recei
349
349
@ SuppressWarnings ("unused" )
350
350
@ Specialization
351
351
public final void doGeneric (VirtualFrame frame , DynamicObject receiver , DynamicObject homeObject , JSContext context ) {
352
- if (isField ) {
352
+ if (isFieldOrStaticBlock ) {
353
353
return ;
354
354
}
355
355
Object key = evaluateKey (frame );
@@ -382,7 +382,7 @@ public Object evaluateValue(VirtualFrame frame, DynamicObject homeObject) {
382
382
@ Override
383
383
protected ObjectLiteralMemberNode copyUninitialized (Set <Class <? extends Tag >> materializedTags ) {
384
384
return ObjectLiteralNodeFactory .ComputedObjectLiteralDataMemberNodeGen .create (JavaScriptNode .cloneUninitialized (propertyKey , materializedTags ), isStatic , attributes ,
385
- JavaScriptNode .cloneUninitialized (valueNode , materializedTags ), isField , isAnonymousFunctionDefinition );
385
+ JavaScriptNode .cloneUninitialized (valueNode , materializedTags ), isFieldOrStaticBlock , isAnonymousFunctionDefinition );
386
386
}
387
387
}
388
388
0 commit comments