package com.ninty.runtime;

import java.nio.ByteBuffer;

/**
 * Created by ninty on 2017/7/12.
 */
public class NiFrame {
    NiFrame prevFrame;

    LocalVars localVars;
    OperandStack operandStack;

    ByteBuffer bb;

    public NiFrame(int localVarsSize, int operandStackSize, byte[] codes) {
        localVars = new LocalVars(localVarsSize);
        operandStack = new OperandStack(operandStackSize);
        bb = ByteBuffer.wrap(codes);
    }

    public NiFrame getPrevFrame() {
        return prevFrame;
    }

    public LocalVars getLocalVars() {
        return localVars;
    }

    public OperandStack getOperandStack() {
        return operandStack;
    }

    public ByteBuffer getCode() {
        return bb;
    }

    @Override
    public String toString() {
        return "NiFrame{" +
                "localVars=" + localVars +
                ", operandStack=" + operandStack +
                '}';
    }
}

@@ -21,16 +21,57 @@
 ntime;%0A%0A
+import com.ninty.runtime.heap.NiMethod;%0A%0A
 import j
@@ -160,16 +160,23 @@
 e %7B%0A    
+public 
 NiFrame 
@@ -191,16 +191,54 @@
 e;%0A%0A    
+private NiMethod method;%0A%0A    private 
 LocalVar
@@ -254,16 +254,24 @@
 rs;%0A    
+private 
 OperandS
@@ -294,16 +294,24 @@
 k;%0A%0A    
+private 
 ByteBuff
@@ -341,61 +341,23 @@
 ame(
-int localVarsSize, int operandStackSize, byte%5B%5D codes
+NiMethod method
 ) %7B%0A
@@ -394,21 +394,29 @@
 ars(
-localVarsSize
+method.getMaxLocals()
 );%0A 
@@ -458,24 +458,28 @@
 ack(
-operand
+method.getMax
 Stack
-Size
+()
 );%0A 
@@ -494,29 +494,24 @@
 b = 
-ByteBuffer.wrap(c
+method.getC
 odes
+(
 );%0A 
@@ -792,24 +792,88 @@
  bb;%0A    %7D%0A%0A
+    public NiMethod getMethod() %7B%0A        return method;%0A    %7D%0A%0A
     @Overrid

add reference for method