Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/TypedNode.java @ 12752:71991b7a0f14
SL: Enhanced SimpleLanguage with support for if statements, function calls, function caching + inlining and builtins.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 11 Nov 2013 21:34:44 +0100 |
parents | 1964871a642d |
children |
comparison
equal
deleted
inserted
replaced
12712:882a0aadfed6 | 12752:71991b7a0f14 |
---|---|
22 */ | 22 */ |
23 package com.oracle.truffle.sl.nodes; | 23 package com.oracle.truffle.sl.nodes; |
24 | 24 |
25 import java.math.*; | 25 import java.math.*; |
26 | 26 |
27 import com.oracle.truffle.api.*; | |
27 import com.oracle.truffle.api.frame.*; | 28 import com.oracle.truffle.api.frame.*; |
28 import com.oracle.truffle.api.nodes.*; | 29 import com.oracle.truffle.api.nodes.*; |
29 import com.oracle.truffle.sl.*; | 30 import com.oracle.truffle.sl.*; |
31 import com.oracle.truffle.sl.runtime.*; | |
30 | 32 |
31 public abstract class TypedNode extends ConditionNode { | 33 public abstract class TypedNode extends ConditionNode { |
32 | 34 |
33 @Override | 35 @Override |
34 public final boolean executeCondition(VirtualFrame frame) { | 36 public final boolean executeCondition(VirtualFrame frame) { |
55 | 57 |
56 public String executeString(VirtualFrame frame) throws UnexpectedResultException { | 58 public String executeString(VirtualFrame frame) throws UnexpectedResultException { |
57 return SLTypesGen.SLTYPES.expectString(executeGeneric(frame)); | 59 return SLTypesGen.SLTYPES.expectString(executeGeneric(frame)); |
58 } | 60 } |
59 | 61 |
62 public CallTarget executeCallTarget(VirtualFrame frame) throws UnexpectedResultException { | |
63 return SLTypesGen.SLTYPES.expectCallTarget(executeGeneric(frame)); | |
64 } | |
65 | |
66 public Object[] executeArray(VirtualFrame frame) throws UnexpectedResultException { | |
67 return SLTypesGen.SLTYPES.expectObjectArray(executeGeneric(frame)); | |
68 } | |
69 | |
70 public SLNull executeNull(VirtualFrame frame) throws UnexpectedResultException { | |
71 return SLTypesGen.SLTYPES.expectSLNull(executeGeneric(frame)); | |
72 } | |
73 | |
60 @Override | 74 @Override |
61 public void executeVoid(VirtualFrame frame) { | 75 public final void executeVoid(VirtualFrame frame) { |
62 executeGeneric(frame); | 76 executeGeneric(frame); |
63 } | 77 } |
64 | 78 |
65 public boolean isString(Object a, Object b) { | 79 public boolean isString(Object a, Object b) { |
66 return a instanceof String || b instanceof String; | 80 return a instanceof String || b instanceof String; |
67 } | 81 } |
68 | 82 |
69 @SuppressWarnings("unused") | |
70 public Object executeEvaluated(VirtualFrame frame, Object val1) { | |
71 return executeGeneric(frame); | |
72 } | |
73 | |
74 @SuppressWarnings("unused") | |
75 public Object executeEvaluated(VirtualFrame frame, Object val1, Object val2) { | |
76 return executeEvaluated(frame, val1); | |
77 } | |
78 | |
79 @SuppressWarnings("unused") | |
80 public Object executeEvaluated(VirtualFrame frame, Object val1, Object val2, Object val3) { | |
81 return executeEvaluated(frame, val1, val2); | |
82 } | |
83 | |
84 } | 83 } |