comparison truffle/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/Specialization.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
242 * </p> 242 * </p>
243 * <p> 243 * <p>
244 * <b>Example usage:</b> 244 * <b>Example usage:</b>
245 * 245 *
246 * <pre> 246 * <pre>
247 * static boolean acceptOperand(int operand) { 247 * static boolean acceptOperand(int operand) { assert operand <= 42; return operand & 1 ==
248 * assert operand <= 42; 248 * 1; } &#064;Specialization(guards = {"operand <= 42", "acceptOperand(operand)"}) void
249 * return operand & 1 == 1; 249 * doSpecialization(int operand) {...}
250 * }
251 * &#064;Specialization(guards = {"operand <= 42", "acceptOperand(operand)"})
252 * void doSpecialization(int operand) {...}
253 * </pre> 250 * </pre>
254 * 251 *
255 * </p> 252 * </p>
256 * 253 *
257 * @see Cached 254 * @see Cached
285 * 282 *
286 * <p> 283 * <p>
287 * <b>Example usage:</b> 284 * <b>Example usage:</b>
288 * 285 *
289 * <pre> 286 * <pre>
290 * static abstract class DynamicObject() { 287 * static abstract class DynamicObject() { abstract Shape getShape(); ... } static
291 * abstract Shape getShape(); 288 * abstract class Shape() { abstract Assumption getUnmodifiedAssuption(); ... }
292 * ... 289 * &#064;Specialization(guards = "operand.getShape() == cachedShape", assumptions =
293 * } 290 * "cachedShape.getUnmodifiedAssumption()") void doAssumeUnmodifiedShape(DynamicObject
294 * static abstract class Shape() { 291 * operand, @Cached("operand.getShape()") Shape cachedShape) {...}
295 * abstract Assumption getUnmodifiedAssuption();
296 * ...
297 * }
298 * &#064;Specialization(guards = "operand.getShape() == cachedShape", assumptions = "cachedShape.getUnmodifiedAssumption()")
299 * void doAssumeUnmodifiedShape(DynamicObject operand, @Cached("operand.getShape()") Shape cachedShape) {...}
300 * </pre> 292 * </pre>
301 * 293 *
302 * </p> 294 * </p>
303 * 295 *
304 * @see Cached 296 * @see Cached
333 * 325 *
334 * <p> 326 * <p>
335 * <b>Example usage:</b> 327 * <b>Example usage:</b>
336 * 328 *
337 * <pre> 329 * <pre>
338 * static int getCacheLimit() { 330 * static int getCacheLimit() { return
339 * return Integer.parseInt(System.getProperty("language.cacheLimit")); 331 * Integer.parseInt(System.getProperty("language.cacheLimit")); } &#064;Specialization(guards =
340 * } 332 * "operand == cachedOperand", limit = "getCacheLimit()") void doCached(Object
341 * &#064;Specialization(guards = "operand == cachedOperand", limit = "getCacheLimit()") 333 * operand, @Cached("operand") Object cachedOperand) {...}
342 * void doCached(Object operand, @Cached("operand") Object cachedOperand) {...}
343 * </pre> 334 * </pre>
344 * 335 *
345 * </p> 336 * </p>
346 * 337 *
347 * @see #guards() 338 * @see #guards()