4040 */
4141package com .oracle .truffle .js .nodes .interop ;
4242
43+ import com .oracle .truffle .api .dsl .Cached ;
4344import com .oracle .truffle .api .dsl .GenerateUncached ;
4445import com .oracle .truffle .api .dsl .Specialization ;
4546import com .oracle .truffle .api .object .DynamicObject ;
4647import com .oracle .truffle .js .nodes .JavaScriptBaseNode ;
47- import com .oracle .truffle .js .runtime .JSRuntime ;
48+ import com .oracle .truffle .js .nodes .access .GetPrototypeNode ;
49+ import com .oracle .truffle .js .nodes .access .IsExtensibleNode ;
50+ import com .oracle .truffle .js .nodes .unary .IsCallableNode ;
4851import com .oracle .truffle .js .runtime .builtins .JSProxy ;
4952import com .oracle .truffle .js .runtime .objects .JSObject ;
5053import com .oracle .truffle .js .runtime .objects .Null ;
@@ -71,10 +74,13 @@ public abstract class KeyInfoNode extends JavaScriptBaseNode {
7174 public abstract boolean execute (DynamicObject receiver , String key , int query );
7275
7376 @ Specialization
74- static boolean member (DynamicObject target , String key , int query ) {
77+ static boolean member (DynamicObject target , String key , int query ,
78+ @ Cached GetPrototypeNode getPrototype ,
79+ @ Cached IsCallableNode isCallable ,
80+ @ Cached IsExtensibleNode isExtensible ) {
7581 PropertyDescriptor desc = null ;
7682 boolean isProxy = false ;
77- for (DynamicObject proto = target ; proto != Null .instance ; proto = JSObject . getPrototype (proto )) {
83+ for (DynamicObject proto = target ; proto != Null .instance ; proto = getPrototype . executeJSObject (proto )) {
7884 desc = JSObject .getOwnProperty (proto , key );
7985 if (JSProxy .isJSProxy (proto )) {
8086 isProxy = true ;
@@ -85,7 +91,7 @@ static boolean member(DynamicObject target, String key, int query) {
8591 }
8692 }
8793 if (desc == null ) {
88- if ((query & INSERTABLE ) != 0 && JSObject . isExtensible (target )) {
94+ if ((query & INSERTABLE ) != 0 && isExtensible . executeBoolean (target )) {
8995 return true ;
9096 }
9197 return false ;
@@ -109,7 +115,7 @@ static boolean member(DynamicObject target, String key, int query) {
109115 if ((query & WRITE_SIDE_EFFECTS ) != 0 && writeSideEffects ) {
110116 return true ;
111117 }
112- if ((query & INVOCABLE ) != 0 && desc .isDataDescriptor () && JSRuntime . isCallable (desc .getValue ())) {
118+ if ((query & INVOCABLE ) != 0 && desc .isDataDescriptor () && isCallable . executeBoolean (desc .getValue ())) {
113119 return true ;
114120 }
115121 if ((query & REMOVABLE ) != 0 && desc .getConfigurable ()) {
0 commit comments