1 package org.simantics.scl.compiler.internal.codegen.utils;
3 import org.cojen.classfile.TypeDesc;
4 import org.simantics.scl.runtime.SCLContext;
6 public enum SCLContextPreparationStep implements PreparationStep<LocalVariable> {
9 public final static TypeDesc SCL_CONTEXT = TypeDesc.forClass(SCLContext.class);
11 public static LocalVariable getCurrent(MethodBuilder mb) {
12 LocalVariable var = mb.getPreparation(INSTANCE);
14 var = mb.createLocalVariable("sclContext", SCL_CONTEXT);
15 mb.invokeStatic(SCL_CONTEXT, "getCurrent", SCL_CONTEXT, Constants.EMPTY_TYPEDESC_ARRAY);
17 mb.addPreparation(INSTANCE, var);