Mercurial > hg > truffle
comparison truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/nodes/SafeReplaceTest.java @ 22003:5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
author | Jaroslav Tulach <jaroslav.tulach@oracle.com> |
---|---|
date | Sat, 18 Jul 2015 18:03:36 +0200 |
parents | 9c8c0937da41 |
children | dc83cc1f94f2 |
comparison
equal
deleted
inserted
replaced
22002:324997830dc9 | 22003:5bc7f7b867ab |
---|---|
26 | 26 |
27 import org.junit.*; | 27 import org.junit.*; |
28 | 28 |
29 import com.oracle.truffle.api.frame.*; | 29 import com.oracle.truffle.api.frame.*; |
30 import com.oracle.truffle.api.nodes.*; | 30 import com.oracle.truffle.api.nodes.*; |
31 import com.oracle.truffle.api.test.TestingLanguage; | |
31 | 32 |
32 /** | 33 /** |
33 * Tests optional method for ensuring that a node replacement is type safe. Ordinary node | 34 * Tests optional method for ensuring that a node replacement is type safe. Ordinary node |
34 * replacement is performed by unsafe assignment of a parent node's child field. | 35 * replacement is performed by unsafe assignment of a parent node's child field. |
35 */ | 36 */ |
79 | 80 |
80 @Child TestNode child; | 81 @Child TestNode child; |
81 | 82 |
82 private int executed; | 83 private int executed; |
83 | 84 |
85 public TestRootNode() { | |
86 super(TestingLanguage.class, null, null); | |
87 } | |
88 | |
84 @Override | 89 @Override |
85 public Object execute(VirtualFrame frame) { | 90 public Object execute(VirtualFrame frame) { |
86 executed++; | 91 executed++; |
87 child.execute(); | 92 child.execute(); |
88 return null; | 93 return null; |