Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLLogicalOrNode.java @ 18785:93016f2f3f16
Truffle-DSL: optimize generated code for nodes with a single specialization. (GRAAL-602 #resolve)
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 05 Jan 2015 20:23:22 +0100 |
parents | abe7128ca473 |
children | c0455554d45b |
comparison
equal
deleted
inserted
replaced
18784:3c7d543d758d | 18785:93016f2f3f16 |
---|---|
21 * questions. | 21 * questions. |
22 */ | 22 */ |
23 package com.oracle.truffle.sl.nodes.expression; | 23 package com.oracle.truffle.sl.nodes.expression; |
24 | 24 |
25 import com.oracle.truffle.api.dsl.*; | 25 import com.oracle.truffle.api.dsl.*; |
26 import com.oracle.truffle.api.frame.*; | |
26 import com.oracle.truffle.api.nodes.*; | 27 import com.oracle.truffle.api.nodes.*; |
27 import com.oracle.truffle.api.source.*; | 28 import com.oracle.truffle.api.source.*; |
28 import com.oracle.truffle.sl.nodes.*; | 29 import com.oracle.truffle.sl.nodes.*; |
29 | 30 |
30 /** | 31 /** |
46 @ShortCircuit("rightNode") | 47 @ShortCircuit("rightNode") |
47 protected boolean needsRightNode(Object left) { | 48 protected boolean needsRightNode(Object left) { |
48 return left instanceof Boolean && needsRightNode(((Boolean) left).booleanValue()); | 49 return left instanceof Boolean && needsRightNode(((Boolean) left).booleanValue()); |
49 } | 50 } |
50 | 51 |
51 @Specialization | 52 @Specialization(rewriteOn = RuntimeException.class) |
52 protected boolean doBoolean(boolean left, boolean hasRight, boolean right) { | 53 protected boolean doBoolean(boolean left, boolean hasRight, boolean right) { |
53 return left || right; | 54 return left || right; |
54 } | 55 } |
55 } | 56 } |