X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Fconstants%2Fsingletons%2FIncreaseByOne.java;h=f174512fd28d529cf3572ad7a588d84006c4b13a;hp=3d2878a480fc82d09beac7d88fb1bc3a4b2c2b5f;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/constants/singletons/IncreaseByOne.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/constants/singletons/IncreaseByOne.java index 3d2878a48..f174512fd 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/constants/singletons/IncreaseByOne.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/constants/singletons/IncreaseByOne.java @@ -1,31 +1,31 @@ -package org.simantics.scl.compiler.constants.singletons; - -import org.objectweb.asm.Opcodes; -import org.simantics.scl.compiler.constants.FunctionValue; -import org.simantics.scl.compiler.internal.codegen.references.Val; -import org.simantics.scl.compiler.internal.codegen.utils.MethodBuilder; -import org.simantics.scl.compiler.types.TVar; -import org.simantics.scl.compiler.types.Type; -import org.simantics.scl.compiler.types.Types; - -public class IncreaseByOne extends FunctionValue { - - public static final IncreaseByOne INSTANCE = new IncreaseByOne(); - - private IncreaseByOne() { - super(TVar.EMPTY_ARRAY, Types.NO_EFFECTS, Types.INTEGER, Types.INTEGER); - } - - @Override - public Type applyExact(MethodBuilder mb, Val[] parameters) { - parameters[0].push(mb); - mb.loadConstant(1); - mb.math(Opcodes.IADD); - return Types.INTEGER; - } - - @Override - public String toString() { - return "increaseByOne"; - } -} +package org.simantics.scl.compiler.constants.singletons; + +import org.objectweb.asm.Opcodes; +import org.simantics.scl.compiler.constants.FunctionValue; +import org.simantics.scl.compiler.internal.codegen.references.Val; +import org.simantics.scl.compiler.internal.codegen.utils.MethodBuilder; +import org.simantics.scl.compiler.types.TVar; +import org.simantics.scl.compiler.types.Type; +import org.simantics.scl.compiler.types.Types; + +public class IncreaseByOne extends FunctionValue { + + public static final IncreaseByOne INSTANCE = new IncreaseByOne(); + + private IncreaseByOne() { + super(TVar.EMPTY_ARRAY, Types.NO_EFFECTS, Types.INTEGER, Types.INTEGER); + } + + @Override + public Type applyExact(MethodBuilder mb, Val[] parameters) { + parameters[0].push(mb); + mb.loadConstant(1); + mb.math(Opcodes.IADD); + return Types.INTEGER; + } + + @Override + public String toString() { + return "increaseByOne"; + } +}