@@ -1857,10 +1857,10 @@ protected Object getValue(Object thisObj, Object receiver, Object defaultValue,
18571857 * @param property The particular entry of the property being accessed.
18581858 */
18591859 @ Override
1860- protected GetCacheNode createCachedPropertyNode (Property property , Object thisObj , int depth , Object value , GetCacheNode currentHead ) {
1860+ protected GetCacheNode createCachedPropertyNode (Property property , Object thisObj , JSDynamicObject proto , int depth , Object value , GetCacheNode currentHead ) {
18611861 assert !isOwnProperty () || depth == 0 ;
18621862 if (!(JSDynamicObject .isJSDynamicObject (thisObj ))) {
1863- return createCachedPropertyNodeNotJSObject (property , thisObj , depth );
1863+ return createCachedPropertyNodeNotJSObject (property , thisObj , proto , depth );
18641864 }
18651865
18661866 JSDynamicObject thisJSObj = (JSDynamicObject ) thisObj ;
@@ -1898,16 +1898,16 @@ protected GetCacheNode createCachedPropertyNode(Property property, Object thisOb
18981898
18991899 if (JSProperty .isData (property ) && !JSProperty .isDataSpecial (property )) {
19001900 if (isEligibleForFinalSpecialization (cacheShape , thisJSObj , depth , isConstantObjectFinal )) {
1901- return createFinalDataPropertySpecialization (property , cacheShape , thisJSObj , depth , isConstantObjectFinal );
1901+ return createFinalDataPropertySpecialization (property , cacheShape , thisJSObj , proto , depth , isConstantObjectFinal );
19021902 }
19031903 } else if (JSProperty .isAccessor (property )) {
19041904 if (isEligibleForFinalSpecialization (cacheShape , thisJSObj , depth , isConstantObjectFinal )) {
1905- return createFinalAccessorSpecialization (property , cacheShape , thisJSObj , depth , isConstantObjectFinal );
1905+ return createFinalAccessorSpecialization (property , cacheShape , thisJSObj , proto , depth , isConstantObjectFinal );
19061906 }
19071907 }
19081908 }
19091909
1910- AbstractShapeCheckNode shapeCheck = createShapeCheckNode (cacheShape , thisJSObj , depth , false , false );
1910+ AbstractShapeCheckNode shapeCheck = createShapeCheckNode (cacheShape , thisJSObj , proto , depth , false , false );
19111911 if (JSProperty .isData (property )) {
19121912 return createSpecializationFromDataProperty (property , shapeCheck , context );
19131913 } else {
@@ -1928,15 +1928,15 @@ private boolean isEligibleForFinalSpecialization(Shape cacheShape, JSDynamicObje
19281928 }
19291929 }
19301930
1931- private GetCacheNode createCachedPropertyNodeNotJSObject (Property property , Object thisObj , int depth ) {
1931+ private GetCacheNode createCachedPropertyNodeNotJSObject (Property property , Object thisObj , JSDynamicObject proto , int depth ) {
19321932 final ReceiverCheckNode receiverCheck ;
19331933 if (depth == 0 ) {
19341934 if (isMethod () && Strings .isTString (thisObj ) && context .isOptionNashornCompatibilityMode ()) {
19351935 // This hack ensures we get the Java method instead of the JavaScript property
19361936 // for length in s.length() where s is a java.lang.String. Required by Nashorn.
19371937 // We do this only for depth 0, because JavaScript prototype functions in turn
19381938 // are preferred over Java methods with the same name.
1939- GetCacheNode javaPropertyNode = createJavaPropertyNodeMaybe (thisObj , depth );
1939+ GetCacheNode javaPropertyNode = createJavaPropertyNodeMaybe (thisObj , proto , depth );
19401940 if (javaPropertyNode != null ) {
19411941 return javaPropertyNode ;
19421942 }
@@ -1948,7 +1948,7 @@ private GetCacheNode createCachedPropertyNodeNotJSObject(Property property, Obje
19481948 return new StringLengthPropertyGetNode (property , receiverCheck );
19491949 }
19501950 } else {
1951- receiverCheck = createPrimitiveReceiverCheck (thisObj , depth );
1951+ receiverCheck = createPrimitiveReceiverCheck (thisObj , proto , depth );
19521952 }
19531953
19541954 if (JSProperty .isData (property )) {
@@ -1996,8 +1996,8 @@ private static GetCacheNode createSpecializationFromDataProperty(Property proper
19961996 }
19971997 }
19981998
1999- private GetCacheNode createFinalDataPropertySpecialization (Property property , Shape cacheShape , JSDynamicObject thisObj , int depth , boolean isConstantObjectFinal ) {
2000- AbstractShapeCheckNode finalShapeCheckNode = createShapeCheckNode (cacheShape , thisObj , depth , isConstantObjectFinal , false );
1999+ private GetCacheNode createFinalDataPropertySpecialization (Property property , Shape cacheShape , JSDynamicObject thisObj , JSDynamicObject proto , int depth , boolean isConstantObjectFinal ) {
2000+ AbstractShapeCheckNode finalShapeCheckNode = createShapeCheckNode (cacheShape , thisObj , proto , depth , isConstantObjectFinal , false );
20012001 finalShapeCheckNode .adoptChildren ();
20022002 JSDynamicObject store = finalShapeCheckNode .getStore (thisObj );
20032003
@@ -2024,8 +2024,8 @@ private GetCacheNode createFinalDataPropertySpecialization(Property property, Sh
20242024 }
20252025 }
20262026
2027- private GetCacheNode createFinalAccessorSpecialization (Property property , Shape cacheShape , JSDynamicObject thisObj , int depth , boolean isConstantObjectFinal ) {
2028- AbstractShapeCheckNode finalShapeCheckNode = createShapeCheckNode (cacheShape , thisObj , depth , isConstantObjectFinal , false );
2027+ private GetCacheNode createFinalAccessorSpecialization (Property property , Shape cacheShape , JSDynamicObject thisObj , JSDynamicObject proto , int depth , boolean isConstantObjectFinal ) {
2028+ AbstractShapeCheckNode finalShapeCheckNode = createShapeCheckNode (cacheShape , thisObj , proto , depth , isConstantObjectFinal , false );
20292029 finalShapeCheckNode .adoptChildren ();
20302030 JSDynamicObject store = finalShapeCheckNode .getStore (thisObj );
20312031 Accessor accessor = (Accessor ) property .getLocation ().get (store , null );
@@ -2034,47 +2034,47 @@ private GetCacheNode createFinalAccessorSpecialization(Property property, Shape
20342034 }
20352035
20362036 @ Override
2037- protected GetCacheNode createJavaPropertyNodeMaybe (Object thisObj , int depth ) {
2037+ protected GetCacheNode createJavaPropertyNodeMaybe (Object thisObj , JSDynamicObject proto , int depth ) {
20382038 if (JavaPackage .isJavaPackage (thisObj )) {
2039- return new JavaPackagePropertyGetNode (createJSClassCheck (thisObj , depth ));
2039+ return new JavaPackagePropertyGetNode (createJSClassCheck (thisObj , proto , depth ));
20402040 } else if (JavaImporter .isJavaImporter (thisObj )) {
2041- return new UnspecializedPropertyGetNode (createJSClassCheck (thisObj , depth ));
2041+ return new UnspecializedPropertyGetNode (createJSClassCheck (thisObj , proto , depth ));
20422042 }
20432043 if (JSConfig .SubstrateVM ) {
20442044 return null ;
20452045 }
20462046 if (context .isOptionNashornCompatibilityMode () && getRealm ().isJavaInteropEnabled ()) {
20472047 if (Strings .isTString (thisObj ) && isMethod ()) {
2048- return new JavaStringMethodGetNode (createPrimitiveReceiverCheck (thisObj , depth ));
2048+ return new JavaStringMethodGetNode (createPrimitiveReceiverCheck (thisObj , proto , depth ));
20492049 }
20502050 }
20512051 return null ;
20522052 }
20532053
20542054 @ Override
2055- protected GetCacheNode createUndefinedPropertyNode (Object thisObj , Object store , int depth , Object value ) {
2056- GetCacheNode javaPropertyNode = createJavaPropertyNodeMaybe (thisObj , depth );
2055+ protected GetCacheNode createUndefinedPropertyNode (Object thisObj , Object store , JSDynamicObject proto , int depth , Object value ) {
2056+ GetCacheNode javaPropertyNode = createJavaPropertyNodeMaybe (thisObj , proto , depth );
20572057 if (javaPropertyNode != null ) {
20582058 return javaPropertyNode ;
20592059 }
20602060
20612061 if (JSDynamicObject .isJSDynamicObject (thisObj )) {
20622062 JSDynamicObject jsobject = (JSDynamicObject ) thisObj ;
20632063 if (JSAdapter .isJSAdapter (store )) {
2064- return new JSAdapterPropertyGetNode (createJSClassCheck (thisObj , depth ));
2064+ return new JSAdapterPropertyGetNode (createJSClassCheck (thisObj , proto , depth ));
20652065 } else if (JSProxy .isJSProxy (store ) && JSRuntime .isPropertyKey (key )) {
2066- return createJSProxyCache (createJSClassCheck (thisObj , depth ));
2066+ return createJSProxyCache (createJSClassCheck (thisObj , proto , depth ));
20672067 } else {
2068- return createUndefinedJSObjectPropertyNode (jsobject , depth );
2068+ return createUndefinedJSObjectPropertyNode (jsobject , proto , depth );
20692069 }
20702070 } else if (JSProxy .isJSProxy (store )) {
2071- ReceiverCheckNode receiverCheck = createPrimitiveReceiverCheck (thisObj , depth );
2071+ ReceiverCheckNode receiverCheck = createPrimitiveReceiverCheck (thisObj , proto , depth );
20722072 return createJSProxyCache (receiverCheck );
20732073 } else {
20742074 if (thisObj == null ) {
20752075 return new TypeErrorPropertyGetNode (new NullCheckNode ());
20762076 } else {
2077- ReceiverCheckNode receiverCheck = createPrimitiveReceiverCheck (thisObj , depth );
2077+ ReceiverCheckNode receiverCheck = createPrimitiveReceiverCheck (thisObj , proto , depth );
20782078 return createUndefinedOrErrorPropertyNode (receiverCheck );
20792079 }
20802080 }
@@ -2101,8 +2101,8 @@ private boolean isProxyHandlerGetNode() {
21012101 return (parent instanceof JSProxyPropertyGetNode );
21022102 }
21032103
2104- private GetCacheNode createUndefinedJSObjectPropertyNode (JSDynamicObject jsobject , int depth ) {
2105- AbstractShapeCheckNode shapeCheck = createShapeCheckNode (jsobject .getShape (), jsobject , depth , false , false );
2104+ private GetCacheNode createUndefinedJSObjectPropertyNode (JSDynamicObject jsobject , JSDynamicObject proto , int depth ) {
2105+ AbstractShapeCheckNode shapeCheck = createShapeCheckNode (jsobject .getShape (), jsobject , proto , depth , false , false );
21062106 if (JSRuntime .isObject (jsobject )) {
21072107 if (context .isOptionNashornCompatibilityMode () && !(key instanceof Symbol )) {
21082108 if ((!context .getNoSuchMethodUnusedAssumption ().isValid () && JSObject .hasProperty (jsobject , JSObject .NO_SUCH_METHOD_NAME )) ||
0 commit comments