Java 类org.mozilla.javascript.ScriptRuntime.NoSuchMethodShim 实例源码

项目:HL4A    文件:Interpreter.java   
/**
 * Call __noSuchMethod__.
 */
private static CallFrame initFrameForNoSuchMethod(Context cx,
        CallFrame frame, int indexReg, Object[] stack, double[] sDbl,
        int stackTop, int op, Scriptable funThisObj, Scriptable calleeScope,
        NoSuchMethodShim noSuchMethodShim, InterpretedFunction ifun)
{
    // create an args array from the stack
    Object[] argsArray = null;
    // exactly like getArgsArray except that the first argument
    // is the method name from the shim
    int shift = stackTop + 2;
    Object[] elements = new Object[indexReg];
    for (int i=0; i < indexReg; ++i, ++shift) {
        Object val = stack[shift];
        if (val == DOUBLE_MARK) {
            val = ScriptRuntime.wrapNumber(sDbl[shift]);
        }
        elements[i] = val;
    }
    argsArray = new Object[2];
    argsArray[0] = noSuchMethodShim.methodName;
    argsArray[1] = cx.newArray(calleeScope, elements);

    // exactly the same as if it's a regular InterpretedFunction
    CallFrame callParentFrame = frame;
    CallFrame calleeFrame = new CallFrame();
    if (op == Icode_TAIL_CALL) {
        callParentFrame = frame.parentFrame;
        exitFrame(cx, frame, null);
    }
    // init the frame with the underlying method with the
    // adjusted args array and shim's function
    initFrame(cx, calleeScope, funThisObj, argsArray, null,
      0, 2, ifun, callParentFrame, calleeFrame);
    if (op != Icode_TAIL_CALL) {
        frame.savedStackTop = stackTop;
        frame.savedCallOp = op;
    }
    return calleeFrame;
}
项目:whackpad    文件:Interpreter.java   
/**
 * Call __noSuchMethod__.
 */
private static CallFrame initFrameForNoSuchMethod(Context cx,
        CallFrame frame, int indexReg, Object[] stack, double[] sDbl,
        int stackTop, int op, Scriptable funThisObj, Scriptable calleeScope,
        NoSuchMethodShim noSuchMethodShim, InterpretedFunction ifun)
{
    // create an args array from the stack
    Object[] argsArray = null;
    // exactly like getArgsArray except that the first argument
    // is the method name from the shim
    int shift = stackTop + 2;
    Object[] elements = new Object[indexReg];
    for (int i=0; i < indexReg; ++i, ++shift) {
        Object val = stack[shift];
        if (val == UniqueTag.DOUBLE_MARK) {
            val = ScriptRuntime.wrapNumber(sDbl[shift]);
        }
        elements[i] = val;
    }
    argsArray = new Object[2];
    argsArray[0] = noSuchMethodShim.methodName;
    argsArray[1] = cx.newArray(calleeScope, elements);

    // exactly the same as if it's a regular InterpretedFunction
    CallFrame callParentFrame = frame;
    CallFrame calleeFrame = new CallFrame();
    if (op == Icode_TAIL_CALL) {
        callParentFrame = frame.parentFrame;
        exitFrame(cx, frame, null);
    }
    // init the frame with the underlying method with the 
    // adjusted args array and shim's function
    initFrame(cx, calleeScope, funThisObj, argsArray, null,
      0, 2, ifun, callParentFrame, calleeFrame);
    if (op != Icode_TAIL_CALL) {
        frame.savedStackTop = stackTop;
        frame.savedCallOp = op;
    }
    return calleeFrame;
}
项目:TaleCraft    文件:Interpreter.java   
/**
 * Call __noSuchMethod__.
 */
private static CallFrame initFrameForNoSuchMethod(Context cx,
        CallFrame frame, int indexReg, Object[] stack, double[] sDbl,
        int stackTop, int op, Scriptable funThisObj, Scriptable calleeScope,
        NoSuchMethodShim noSuchMethodShim, InterpretedFunction ifun)
{
    // create an args array from the stack
    Object[] argsArray = null;
    // exactly like getArgsArray except that the first argument
    // is the method name from the shim
    int shift = stackTop + 2;
    Object[] elements = new Object[indexReg];
    for (int i=0; i < indexReg; ++i, ++shift) {
        Object val = stack[shift];
        if (val == DOUBLE_MARK) {
            val = ScriptRuntime.wrapNumber(sDbl[shift]);
        }
        elements[i] = val;
    }
    argsArray = new Object[2];
    argsArray[0] = noSuchMethodShim.methodName;
    argsArray[1] = cx.newArray(calleeScope, elements);

    // exactly the same as if it's a regular InterpretedFunction
    CallFrame callParentFrame = frame;
    CallFrame calleeFrame = new CallFrame();
    if (op == Icode_TAIL_CALL) {
        callParentFrame = frame.parentFrame;
        exitFrame(cx, frame, null);
    }
    // init the frame with the underlying method with the
    // adjusted args array and shim's function
    initFrame(cx, calleeScope, funThisObj, argsArray, null,
      0, 2, ifun, callParentFrame, calleeFrame);
    if (op != Icode_TAIL_CALL) {
        frame.savedStackTop = stackTop;
        frame.savedCallOp = op;
    }
    return calleeFrame;
}
项目:code404    文件:Interpreter.java   
/**
 * Call __noSuchMethod__.
 */
private static CallFrame initFrameForNoSuchMethod(Context cx,
        CallFrame frame, int indexReg, Object[] stack, double[] sDbl,
        int stackTop, int op, Scriptable funThisObj, Scriptable calleeScope,
        NoSuchMethodShim noSuchMethodShim, InterpretedFunction ifun)
{
    // create an args array from the stack
    Object[] argsArray = null;
    // exactly like getArgsArray except that the first argument
    // is the method name from the shim
    int shift = stackTop + 2;
    Object[] elements = new Object[indexReg];
    for (int i=0; i < indexReg; ++i, ++shift) {
        Object val = stack[shift];
        if (val == DOUBLE_MARK) {
            val = ScriptRuntime.wrapNumber(sDbl[shift]);
        }
        elements[i] = val;
    }
    argsArray = new Object[2];
    argsArray[0] = noSuchMethodShim.methodName;
    argsArray[1] = cx.newArray(calleeScope, elements);

    // exactly the same as if it's a regular InterpretedFunction
    CallFrame callParentFrame = frame;
    CallFrame calleeFrame = new CallFrame();
    if (op == Icode_TAIL_CALL) {
        callParentFrame = frame.parentFrame;
        exitFrame(cx, frame, null);
    }
    // init the frame with the underlying method with the
    // adjusted args array and shim's function
    initFrame(cx, calleeScope, funThisObj, argsArray, null,
      0, 2, ifun, callParentFrame, calleeFrame);
    if (op != Icode_TAIL_CALL) {
        frame.savedStackTop = stackTop;
        frame.savedCallOp = op;
    }
    return calleeFrame;
}
项目:rhino-jscover    文件:Interpreter.java   
/**
 * Call __noSuchMethod__.
 */
private static CallFrame initFrameForNoSuchMethod(Context cx,
        CallFrame frame, int indexReg, Object[] stack, double[] sDbl,
        int stackTop, int op, Scriptable funThisObj, Scriptable calleeScope,
        NoSuchMethodShim noSuchMethodShim, InterpretedFunction ifun)
{
    // create an args array from the stack
    Object[] argsArray = null;
    // exactly like getArgsArray except that the first argument
    // is the method name from the shim
    int shift = stackTop + 2;
    Object[] elements = new Object[indexReg];
    for (int i=0; i < indexReg; ++i, ++shift) {
        Object val = stack[shift];
        if (val == DOUBLE_MARK) {
            val = ScriptRuntime.wrapNumber(sDbl[shift]);
        }
        elements[i] = val;
    }
    argsArray = new Object[2];
    argsArray[0] = noSuchMethodShim.methodName;
    argsArray[1] = cx.newArray(calleeScope, elements);

    // exactly the same as if it's a regular InterpretedFunction
    CallFrame callParentFrame = frame;
    CallFrame calleeFrame = new CallFrame();
    if (op == Icode_TAIL_CALL) {
        callParentFrame = frame.parentFrame;
        exitFrame(cx, frame, null);
    }
    // init the frame with the underlying method with the
    // adjusted args array and shim's function
    initFrame(cx, calleeScope, funThisObj, argsArray, null,
      0, 2, ifun, callParentFrame, calleeFrame);
    if (op != Icode_TAIL_CALL) {
        frame.savedStackTop = stackTop;
        frame.savedCallOp = op;
    }
    return calleeFrame;
}
项目:LoboEvolution    文件:Interpreter.java   
/**
 * Call __noSuchMethod__.
 */
private static CallFrame initFrameForNoSuchMethod(Context cx,
        CallFrame frame, int indexReg, Object[] stack, double[] sDbl,
        int stackTop, int op, Scriptable funThisObj, Scriptable calleeScope,
        NoSuchMethodShim noSuchMethodShim, InterpretedFunction ifun)
{
    // create an args array from the stack
    Object[] argsArray = null;
    // exactly like getArgsArray except that the first argument
    // is the method name from the shim
    int shift = stackTop + 2;
    Object[] elements = new Object[indexReg];
    for (int i=0; i < indexReg; ++i, ++shift) {
        Object val = stack[shift];
        if (val == DOUBLE_MARK) {
            val = ScriptRuntime.wrapNumber(sDbl[shift]);
        }
        elements[i] = val;
    }
    argsArray = new Object[2];
    argsArray[0] = noSuchMethodShim.methodName;
    argsArray[1] = cx.newArray(calleeScope, elements);

    // exactly the same as if it's a regular InterpretedFunction
    CallFrame callParentFrame = frame;
    CallFrame calleeFrame = new CallFrame();
    if (op == Icode_TAIL_CALL) {
        callParentFrame = frame.parentFrame;
        exitFrame(cx, frame, null);
    }
    // init the frame with the underlying method with the
    // adjusted args array and shim's function
    initFrame(cx, calleeScope, funThisObj, argsArray, null,
      0, 2, ifun, callParentFrame, calleeFrame);
    if (op != Icode_TAIL_CALL) {
        frame.savedStackTop = stackTop;
        frame.savedCallOp = op;
    }
    return calleeFrame;
}
项目:astor    文件:Interpreter.java   
/**
 * Call __noSuchMethod__.
 */
private static CallFrame initFrameForNoSuchMethod(Context cx,
        CallFrame frame, int indexReg, Object[] stack, double[] sDbl,
        int stackTop, int op, Scriptable funThisObj, Scriptable calleeScope,
        NoSuchMethodShim noSuchMethodShim, InterpretedFunction ifun)
{
    // create an args array from the stack
    Object[] argsArray = null;
    // exactly like getArgsArray except that the first argument
    // is the method name from the shim
    int shift = stackTop + 2;
    Object[] elements = new Object[indexReg];
    for (int i=0; i < indexReg; ++i, ++shift) {
        Object val = stack[shift];
        if (val == DOUBLE_MARK) {
            val = ScriptRuntime.wrapNumber(sDbl[shift]);
        }
        elements[i] = val;
    }
    argsArray = new Object[2];
    argsArray[0] = noSuchMethodShim.methodName;
    argsArray[1] = cx.newArray(calleeScope, elements);

    // exactly the same as if it's a regular InterpretedFunction
    CallFrame callParentFrame = frame;
    CallFrame calleeFrame = new CallFrame();
    if (op == Icode_TAIL_CALL) {
        callParentFrame = frame.parentFrame;
        exitFrame(cx, frame, null);
    }
    // init the frame with the underlying method with the
    // adjusted args array and shim's function
    initFrame(cx, calleeScope, funThisObj, argsArray, null,
      0, 2, ifun, callParentFrame, calleeFrame);
    if (op != Icode_TAIL_CALL) {
        frame.savedStackTop = stackTop;
        frame.savedCallOp = op;
    }
    return calleeFrame;
}
项目:Rhino-Prov-Mod    文件:Interpreter.java   
/**
 * Call __noSuchMethod__.
 */
private static CallFrame initFrameForNoSuchMethod(Context cx,
        CallFrame frame, int indexReg, Object[] stack, double[] sDbl,
        int stackTop, int op, Scriptable funThisObj, Scriptable calleeScope,
        NoSuchMethodShim noSuchMethodShim, InterpretedFunction ifun)
{
    // create an args array from the stack
    Object[] argsArray = null;
    // exactly like getArgsArray except that the first argument
    // is the method name from the shim
    int shift = stackTop + 2;
    Object[] elements = new Object[indexReg];
    for (int i=0; i < indexReg; ++i, ++shift) {
        Object val = stack[shift];
        if (val == DOUBLE_MARK) {
            val = ScriptRuntime.wrapNumber(sDbl[shift]);
        }
        elements[i] = val;
    }
    argsArray = new Object[2];
    argsArray[0] = noSuchMethodShim.methodName;
    argsArray[1] = cx.newArray(calleeScope, elements);

    // exactly the same as if it's a regular InterpretedFunction
    CallFrame callParentFrame = frame;
    CallFrame calleeFrame = new CallFrame();
    if (op == Icode_TAIL_CALL) {
        callParentFrame = frame.parentFrame;
        exitFrame(cx, frame, null);
    }
    // init the frame with the underlying method with the
    // adjusted args array and shim's function
    initFrame(cx, calleeScope, funThisObj, argsArray, null,
      0, 2, ifun, callParentFrame, calleeFrame);
    if (op != Icode_TAIL_CALL) {
        frame.savedStackTop = stackTop;
        frame.savedCallOp = op;
    }
    return calleeFrame;
}
项目:android-js    文件:Interpreter.java   
/**
 * Call __noSuchMethod__.
 */
private static CallFrame initFrameForNoSuchMethod(Context cx,
        CallFrame frame, int indexReg, Object[] stack, double[] sDbl,
        int stackTop, int op, Scriptable funThisObj, Scriptable calleeScope,
        NoSuchMethodShim noSuchMethodShim, InterpretedFunction ifun)
{
    // create an args array from the stack
    Object[] argsArray = null;
    // exactly like getArgsArray except that the first argument
    // is the method name from the shim
    int shift = stackTop + 2;
    Object[] elements = new Object[indexReg];
    for (int i=0; i < indexReg; ++i, ++shift) {
        Object val = stack[shift];
        if (val == DOUBLE_MARK) {
            val = ScriptRuntime.wrapNumber(sDbl[shift]);
        }
        elements[i] = val;
    }
    argsArray = new Object[2];
    argsArray[0] = noSuchMethodShim.methodName;
    argsArray[1] = cx.newArray(calleeScope, elements);

    // exactly the same as if it's a regular InterpretedFunction
    CallFrame callParentFrame = frame;
    CallFrame calleeFrame = new CallFrame();
    if (op == Icode_TAIL_CALL) {
        callParentFrame = frame.parentFrame;
        exitFrame(cx, frame, null);
    }
    // init the frame with the underlying method with the
    // adjusted args array and shim's function
    initFrame(cx, calleeScope, funThisObj, argsArray, null,
      0, 2, ifun, callParentFrame, calleeFrame);
    if (op != Icode_TAIL_CALL) {
        frame.savedStackTop = stackTop;
        frame.savedCallOp = op;
    }
    return calleeFrame;
}
项目:closure-compiler-old    文件:Interpreter.java   
/**
 * Call __noSuchMethod__.
 */
private static CallFrame initFrameForNoSuchMethod(Context cx,
        CallFrame frame, int indexReg, Object[] stack, double[] sDbl,
        int stackTop, int op, Scriptable funThisObj, Scriptable calleeScope,
        NoSuchMethodShim noSuchMethodShim, InterpretedFunction ifun)
{
    // create an args array from the stack
    Object[] argsArray = null;
    // exactly like getArgsArray except that the first argument
    // is the method name from the shim
    int shift = stackTop + 2;
    Object[] elements = new Object[indexReg];
    for (int i=0; i < indexReg; ++i, ++shift) {
        Object val = stack[shift];
        if (val == DOUBLE_MARK) {
            val = ScriptRuntime.wrapNumber(sDbl[shift]);
        }
        elements[i] = val;
    }
    argsArray = new Object[2];
    argsArray[0] = noSuchMethodShim.methodName;
    argsArray[1] = cx.newArray(calleeScope, elements);

    // exactly the same as if it's a regular InterpretedFunction
    CallFrame callParentFrame = frame;
    CallFrame calleeFrame = new CallFrame();
    if (op == Icode_TAIL_CALL) {
        callParentFrame = frame.parentFrame;
        exitFrame(cx, frame, null);
    }
    // init the frame with the underlying method with the
    // adjusted args array and shim's function
    initFrame(cx, calleeScope, funThisObj, argsArray, null,
      0, 2, ifun, callParentFrame, calleeFrame);
    if (op != Icode_TAIL_CALL) {
        frame.savedStackTop = stackTop;
        frame.savedCallOp = op;
    }
    return calleeFrame;
}
项目:closure-compiler-copy    文件:Interpreter.java   
/**
 * Call __noSuchMethod__.
 */
private static CallFrame initFrameForNoSuchMethod(Context cx,
        CallFrame frame, int indexReg, Object[] stack, double[] sDbl,
        int stackTop, int op, Scriptable funThisObj, Scriptable calleeScope,
        NoSuchMethodShim noSuchMethodShim, InterpretedFunction ifun)
{
    // create an args array from the stack
    Object[] argsArray = null;
    // exactly like getArgsArray except that the first argument
    // is the method name from the shim
    int shift = stackTop + 2;
    Object[] elements = new Object[indexReg];
    for (int i=0; i < indexReg; ++i, ++shift) {
        Object val = stack[shift];
        if (val == DOUBLE_MARK) {
            val = ScriptRuntime.wrapNumber(sDbl[shift]);
        }
        elements[i] = val;
    }
    argsArray = new Object[2];
    argsArray[0] = noSuchMethodShim.methodName;
    argsArray[1] = cx.newArray(calleeScope, elements);

    // exactly the same as if it's a regular InterpretedFunction
    CallFrame callParentFrame = frame;
    CallFrame calleeFrame = new CallFrame();
    if (op == Icode_TAIL_CALL) {
        callParentFrame = frame.parentFrame;
        exitFrame(cx, frame, null);
    }
    // init the frame with the underlying method with the
    // adjusted args array and shim's function
    initFrame(cx, calleeScope, funThisObj, argsArray, null,
      0, 2, ifun, callParentFrame, calleeFrame);
    if (op != Icode_TAIL_CALL) {
        frame.savedStackTop = stackTop;
        frame.savedCallOp = op;
    }
    return calleeFrame;
}