comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/BigIntegerLiteralNode.java @ 12390:5151a7588384

SL: fixed literals generate unnecessary code.
author Christian Humer <christian.humer@gmail.com>
date Wed, 02 Oct 2013 15:57:17 +0200
parents 79041ab43660
children
comparison
equal deleted inserted replaced
12389:9d1a5d61cc11 12390:5151a7588384
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.dsl.*; 27 import com.oracle.truffle.api.frame.*;
28 import com.oracle.truffle.api.nodes.*;
28 29
29 public abstract class BigIntegerLiteralNode extends TypedNode { 30 public final class BigIntegerLiteralNode extends TypedNode {
30 31
31 private final BigInteger value; 32 private final BigInteger value;
32 33
33 public BigIntegerLiteralNode(BigInteger value) { 34 public BigIntegerLiteralNode(BigInteger value) {
34 this.value = value; 35 this.value = value;
35 } 36 }
36 37
37 @Specialization 38 @Override
38 public BigInteger doBigInteger() { 39 public BigInteger executeBigInteger(VirtualFrame frame) throws UnexpectedResultException {
39 return value; 40 return value;
40 } 41 }
42
43 @Override
44 public Object executeGeneric(VirtualFrame frame) {
45 return value;
46 }
47
41 } 48 }