1 package org.simantics.scl.compiler.constants;
3 import org.cojen.classfile.TypeDesc;
4 import org.simantics.scl.compiler.internal.codegen.references.IVal;
5 import org.simantics.scl.compiler.internal.codegen.types.JavaTypeTranslator;
6 import org.simantics.scl.compiler.internal.codegen.utils.MethodBuilder;
7 import org.simantics.scl.compiler.internal.codegen.utils.TransientClassBuilder;
8 import org.simantics.scl.compiler.types.Type;
10 public class GetPrimitiveConstant extends Constant {
15 public GetPrimitiveConstant(Type type, IVal val, TypeDesc typeDesc) {
18 this.typeDesc = typeDesc;
22 public void push(MethodBuilder mb) {
23 if(typeDesc != TypeDesc.VOID) {
25 mb.convert(JavaTypeTranslator.toObjectType(typeDesc), typeDesc);
30 public Object realizeValue(TransientClassBuilder classLoader) {
31 return val.realizeValue(classLoader);