Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/FrameSlotTypeSpecializationTest.java @ 14628:a08b8694f556
Truffle: Node API changes
deprecate adoptChild, no longer needed in constructor
add Node#insert for inserting new nodes into the tree (previously adoptChild)
add Node#adoptChildren() helper method that adopts all (direct and indirect) children of a node, automatically called in TruffleRuntime#createCallTarget
author | Andreas Woess <andreas.woess@jku.at> |
---|---|
date | Wed, 19 Mar 2014 23:11:46 +0100 |
parents | ac5b0f31f7a2 |
children | 64dcb92ee75a |
comparison
equal
deleted
inserted
replaced
14627:46c020971d9c | 14628:a08b8694f556 |
---|---|
62 @Child TestChildNode left; | 62 @Child TestChildNode left; |
63 @Child TestChildNode right; | 63 @Child TestChildNode right; |
64 | 64 |
65 public TestRootNode(FrameDescriptor descriptor, TestChildNode left, TestChildNode right) { | 65 public TestRootNode(FrameDescriptor descriptor, TestChildNode left, TestChildNode right) { |
66 super(null, descriptor); | 66 super(null, descriptor); |
67 this.left = adoptChild(left); | 67 this.left = left; |
68 this.right = adoptChild(right); | 68 this.right = right; |
69 } | 69 } |
70 | 70 |
71 @Override | 71 @Override |
72 public Object execute(VirtualFrame frame) { | 72 public Object execute(VirtualFrame frame) { |
73 left.execute(frame); | 73 left.execute(frame); |
106 | 106 |
107 @Child private TestChildNode value; | 107 @Child private TestChildNode value; |
108 | 108 |
109 IntAssignLocal(FrameSlot slot, TestChildNode value) { | 109 IntAssignLocal(FrameSlot slot, TestChildNode value) { |
110 super(slot); | 110 super(slot); |
111 this.value = adoptChild(value); | 111 this.value = value; |
112 } | 112 } |
113 | 113 |
114 @Override | 114 @Override |
115 Object execute(VirtualFrame frame) { | 115 Object execute(VirtualFrame frame) { |
116 Object o = value.execute(frame); | 116 Object o = value.execute(frame); |
128 | 128 |
129 @Child private TestChildNode value; | 129 @Child private TestChildNode value; |
130 | 130 |
131 ObjectAssignLocal(FrameSlot slot, TestChildNode value) { | 131 ObjectAssignLocal(FrameSlot slot, TestChildNode value) { |
132 super(slot); | 132 super(slot); |
133 this.value = adoptChild(value); | 133 this.value = value; |
134 } | 134 } |
135 | 135 |
136 @Override | 136 @Override |
137 Object execute(VirtualFrame frame) { | 137 Object execute(VirtualFrame frame) { |
138 Object o = value.execute(frame); | 138 Object o = value.execute(frame); |