4343import com .oracle .truffle .api .dsl .Bind ;
4444import com .oracle .truffle .api .dsl .Cached ;
4545import com .oracle .truffle .api .dsl .GenerateUncached ;
46+ import com .oracle .truffle .api .dsl .ImportStatic ;
4647import com .oracle .truffle .api .dsl .Specialization ;
4748import com .oracle .truffle .api .library .CachedLibrary ;
4849import com .oracle .truffle .api .object .DynamicObjectLibrary ;
6869/**
6970 * This node implements the {@code isMember*} messages.
7071 */
72+ @ ImportStatic (Strings .class )
7173@ GenerateUncached
7274public abstract class KeyInfoNode extends JavaScriptBaseNode {
7375 public static final int READABLE = 1 << 0 ;
@@ -85,13 +87,13 @@ public abstract class KeyInfoNode extends JavaScriptBaseNode {
8587 public abstract boolean execute (JSDynamicObject receiver , String key , int query );
8688
8789 @ Specialization (guards = {"!isJSProxy(target)" , "property != null" }, limit = "2" )
88- static boolean cachedOwnProperty (JSDynamicObject target , String key , int query ,
90+ static boolean cachedOwnProperty (JSDynamicObject target , @ SuppressWarnings ( "unused" ) String key , int query ,
8991 @ CachedLibrary ("target" ) DynamicObjectLibrary objectLibrary ,
90- @ Bind ("objectLibrary.getProperty(target, key)" ) Property property ,
92+ @ Cached @ SuppressWarnings ("unused" ) TruffleString .FromJavaStringNode fromJavaStringNode ,
93+ @ Bind ("fromJavaString(fromJavaStringNode, key)" ) TruffleString tStringKey ,
94+ @ Bind ("objectLibrary.getProperty(target, tStringKey)" ) Property property ,
9195 @ Cached IsCallableNode isCallable ,
92- @ Cached BranchProfile proxyBranch ,
93- @ Cached TruffleString .FromJavaStringNode fromJavaStringNode ) {
94- TruffleString tStringKey = Strings .fromJavaString (fromJavaStringNode , key );
96+ @ Cached BranchProfile proxyBranch ) {
9597 if (JSProperty .isAccessor (property )) {
9698 Accessor accessor = (Accessor ) Properties .getOrDefault (objectLibrary , target , tStringKey , null );
9799 if ((query & READABLE ) != 0 && accessor .hasGetter ()) {
0 commit comments