File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
src/vm/jvm/runtime/org/perl6/nqp/truffle/nodes/expression Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change 2
2
import com .oracle .truffle .api .frame .VirtualFrame ;
3
3
import com .oracle .truffle .api .nodes .NodeInfo ;
4
4
import org .perl6 .nqp .truffle .nodes .NQPNode ;
5
- import org .perl6 .nqp .truffle .nodes .NQPIntNode ;
5
+ import org .perl6 .nqp .truffle .nodes .NQPNodeWithSTableGetting ;
6
6
7
7
import org .perl6 .nqp .truffle .sixmodel .TypeObject ;
8
8
9
9
import org .perl6 .nqp .dsl .Deserializer ;
10
10
11
11
@ NodeInfo (shortName = "can" )
12
- public final class NQPCanNode extends NQPIntNode {
12
+ public final class NQPCanNode extends NQPNodeWithSTableGetting {
13
13
@ Child private NQPNode invocantNode ;
14
14
@ Child private NQPNode nameNode ;
15
15
@@ -24,13 +24,12 @@ public long executeInt(VirtualFrame frame) {
24
24
Object invocant = invocantNode .execute (frame );
25
25
String name = nameNode .executeStr (frame );
26
26
27
- if (invocant instanceof TypeObject ) {
28
- System .out .println ("can on typeobject: " + name );
29
- TypeObject typeObject = (TypeObject ) invocant ;
30
- return typeObject .stable .methodCache .containsKey (name ) ? 1 : 0 ;
31
- } else {
32
- System .out .println ("nqp::can on " + invocant );
33
- return 0 ;
34
- }
27
+ // TODO not authorative method caches
28
+ return getStable (invocant ).methodCache .containsKey (name ) ? 1 : 0 ;
29
+ }
30
+
31
+ @ Override
32
+ public void executeVoid (VirtualFrame frame ) {
33
+ executeInt (frame );
35
34
}
36
35
}
You can’t perform that action at this time.
0 commit comments