src/compiler/BytecodeEmitter.cpp
changeset 220 5df4a112967d
parent 195 c1ba166f3fc4
child 222 0cde1379b29f
     1.1 --- a/src/compiler/BytecodeEmitter.cpp	Sun Nov 18 22:18:23 2012 -0800
     1.2 +++ b/src/compiler/BytecodeEmitter.cpp	Mon Nov 19 01:13:44 2012 -0800
     1.3 @@ -216,6 +216,7 @@
     1.4  void
     1.5  BytecodeEmitter::getlocal(VariableSymbol *var)
     1.6  {
     1.7 +    assert(var->storage() == VariableSymbol::Local);
     1.8      ensure(OP_GETLOCAL_LENGTH);
     1.9      writeOp(OP_GETLOCAL);
    1.10      writeUint32(var->slot());
    1.11 @@ -226,6 +227,7 @@
    1.12  void
    1.13  BytecodeEmitter::setlocal(VariableSymbol *var)
    1.14  {
    1.15 +    assert(var->storage() == VariableSymbol::Local);
    1.16      ensure(OP_SETLOCAL_LENGTH);
    1.17      writeOp(OP_SETLOCAL);
    1.18      writeUint32(var->slot());
    1.19 @@ -233,6 +235,28 @@
    1.20          markOop(1);
    1.21  }
    1.22  
    1.23 +void
    1.24 +BytecodeEmitter::getarg(VariableSymbol *var)
    1.25 +{
    1.26 +    assert(var->storage() == VariableSymbol::Arg);
    1.27 +    ensure(OP_GETARG_LENGTH);
    1.28 +    writeOp(OP_GETARG);
    1.29 +    writeUint32(var->slot());
    1.30 +    if (var->type()->isTraceable())
    1.31 +        markOop(1);
    1.32 +}
    1.33 +
    1.34 +void
    1.35 +BytecodeEmitter::setarg(VariableSymbol *var)
    1.36 +{
    1.37 +    assert(var->storage() == VariableSymbol::Arg);
    1.38 +    ensure(OP_SETARG_LENGTH);
    1.39 +    writeOp(OP_SETARG);
    1.40 +    writeUint32(var->slot());
    1.41 +    if (var->type()->isTraceable())
    1.42 +        markOop(1);
    1.43 +}
    1.44 +
    1.45  bool
    1.46  BytecodeEmitter::allocate(VariableSymbol *sym)
    1.47  {