Example usage for org.eclipse.jdt.internal.compiler.codegen CodeStream iconst_1

List of usage examples for org.eclipse.jdt.internal.compiler.codegen CodeStream iconst_1

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.codegen CodeStream iconst_1.

Prototype

public void iconst_1() 

Source Link

Usage

From source file:org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.transformer.RoleMigrationImplementor.java

License:Open Source License

static void genAddOrRemoveRole(CodeStream codeStream, Scope scope, ReferenceBinding iboundBase,
        boolean isAdding) {
    codeStream.aload_0(); // this
    // OTDYN: Slightly different methods depending on the weaving strategy:
    switch (scope.compilerOptions().weavingScheme) {
    case OTDRE://from  w ww.  ja va 2  s  .  c  o  m
        // _OT$addOrRemoveRole(role, isAdding)
        if (isAdding)
            codeStream.iconst_1(); // isAdding=true
        else
            codeStream.iconst_0(); // isAdding=false   
        codeStream.invoke(Opcodes.OPC_invokeinterface,
                iboundBase.getMethod(scope, IOTConstants.ADD_REMOVE_ROLE), iboundBase);
        break;
    case OTRE:
        // _OT$addRole(role) or _OT$removeRole(role):
        codeStream.invoke(Opcodes.OPC_invokeinterface,
                isAdding ? iboundBase.getMethod(scope, IOTConstants.ADD_ROLE)
                        : iboundBase.getMethod(scope, IOTConstants.REMOVE_ROLE),
                iboundBase);
    }
}