1 package org.simantics.scl.compiler.constants;
3 import org.cojen.classfile.TypeDesc;
4 import org.objectweb.asm.Label;
5 import org.simantics.scl.compiler.internal.codegen.continuations.Cont;
6 import org.simantics.scl.compiler.internal.codegen.references.IVal;
7 import org.simantics.scl.compiler.internal.codegen.utils.MethodBuilder;
8 import org.simantics.scl.compiler.internal.codegen.utils.TransientClassBuilder;
9 import org.simantics.scl.compiler.types.Types;
11 public class LongConstant extends Constant {
14 public LongConstant(long value) {
20 public void push(MethodBuilder mb) {
21 mb.loadConstant(value);
25 public String toString() {
26 return String.valueOf(value);
30 public int hashCode() {
33 result = prime * result + (int) (value ^ (value >>> 32));
38 public boolean equals(Object obj) {
43 if (getClass() != obj.getClass())
45 LongConstant other = (LongConstant) obj;
46 if (value != other.value)
52 public void deconstruct(MethodBuilder mb, IVal parameter, Cont success,
54 mb.push(parameter, Types.LONG);
55 mb.loadConstant(value);
56 mb.ifComparisonBranch(failure, "!=", TypeDesc.LONG);
60 public int constructorTag() {
65 public Object realizeValue(TransientClassBuilder classBuilder) {