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 ByteConstant extends Constant {
15 public ByteConstant(byte value) {
21 public void push(MethodBuilder mb) {
22 mb.loadConstant(value);
26 public String toString() {
27 return String.valueOf(value);
30 public byte getValue() {
35 public int hashCode() {
40 public boolean equals(Object obj) {
45 if (getClass() != obj.getClass())
47 ByteConstant other = (ByteConstant) obj;
48 if (value != other.value)
54 public void deconstruct(MethodBuilder mb, IVal parameter, Cont success,
56 mb.push(parameter, Types.BYTE);
57 mb.loadConstant(value);
58 mb.ifComparisonBranch(failure, "!=", TypeDesc.BYTE);
63 public int constructorTag() {
68 public Object realizeValue(TransientClassBuilder classBuilder) {