Mercurial > hg > truffle
comparison truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/MaxMinObject.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 | a88981c5ce8b |
children | e7c2d36daf72 |
comparison
equal
deleted
inserted
replaced
22002:324997830dc9 | 22003:5bc7f7b867ab |
---|---|
25 package com.oracle.truffle.tck; | 25 package com.oracle.truffle.tck; |
26 | 26 |
27 import com.oracle.truffle.api.CallTarget; | 27 import com.oracle.truffle.api.CallTarget; |
28 import com.oracle.truffle.api.CompilerDirectives; | 28 import com.oracle.truffle.api.CompilerDirectives; |
29 import com.oracle.truffle.api.Truffle; | 29 import com.oracle.truffle.api.Truffle; |
30 import com.oracle.truffle.api.TruffleLanguage; | |
30 import com.oracle.truffle.api.dsl.NodeChild; | 31 import com.oracle.truffle.api.dsl.NodeChild; |
31 import com.oracle.truffle.api.dsl.NodeChildren; | 32 import com.oracle.truffle.api.dsl.NodeChildren; |
32 import com.oracle.truffle.api.dsl.Specialization; | 33 import com.oracle.truffle.api.dsl.Specialization; |
33 import com.oracle.truffle.api.frame.VirtualFrame; | 34 import com.oracle.truffle.api.frame.VirtualFrame; |
34 import com.oracle.truffle.api.interop.ForeignAccess; | 35 import com.oracle.truffle.api.interop.ForeignAccess; |
173 @NodeChildren({@NodeChild(value = "firstNode", type = UnboxNode.class), @NodeChild(value = "secondNode", type = UnboxNode.class)}) | 174 @NodeChildren({@NodeChild(value = "firstNode", type = UnboxNode.class), @NodeChild(value = "secondNode", type = UnboxNode.class)}) |
174 abstract static class MaxMinNode extends RootNode { | 175 abstract static class MaxMinNode extends RootNode { |
175 private final boolean max; | 176 private final boolean max; |
176 | 177 |
177 MaxMinNode(boolean max) { | 178 MaxMinNode(boolean max) { |
179 super(MMLanguage.class, null, null); | |
178 this.max = max; | 180 this.max = max; |
179 } | 181 } |
180 | 182 |
181 @Specialization | 183 @Specialization |
182 public int execute(int first, int second) { | 184 public int execute(int first, int second) { |
192 public double execute(double first, double second) { | 194 public double execute(double first, double second) { |
193 return max ? Math.max(first, second) : Math.min(first, second); | 195 return max ? Math.max(first, second) : Math.min(first, second); |
194 } | 196 } |
195 } | 197 } |
196 | 198 |
199 private abstract class MMLanguage extends TruffleLanguage { | |
200 public MMLanguage(Env env) { | |
201 super(env); | |
202 } | |
203 } | |
197 } | 204 } |