jitcraft/BytecodeEmitter.h
changeset 46 735503e448a0
parent 33 95baf120f7d4
child 47 050939c6181e
     1.1 --- a/jitcraft/BytecodeEmitter.h	Tue Jul 03 09:25:18 2012 -0700
     1.2 +++ b/jitcraft/BytecodeEmitter.h	Tue Jul 03 13:53:34 2012 -0400
     1.3 @@ -117,6 +117,11 @@
     1.4          return &objects_;
     1.5      }
     1.6  
     1.7 +    void drop(unsigned amt) {
     1.8 +        assert(amt <= stackDepth_);
     1.9 +        stackDepth_ -= amt;
    1.10 +    }
    1.11 +
    1.12    public:
    1.13      // A label represents a local control-flow target in the bytecode. A label
    1.14      // may be in three states:
    1.15 @@ -267,13 +272,10 @@
    1.16      void stop() {
    1.17          singleByteOp(OP_STOP);
    1.18      }
    1.19 -    void callglobal(unsigned nargs, unsigned index) {
    1.20 +    void callglobal(unsigned index) {
    1.21          ensure(OP_CALLGLOBAL_LENGTH);
    1.22          writeOp(OP_CALLGLOBAL);
    1.23 -        writeUint32(nargs);
    1.24          writeUint32(index);
    1.25 -
    1.26 -        stackDepth_ -= nargs;
    1.27      }
    1.28      void getarray(PrimitiveType type) {
    1.29          switch (type) {