[JAEGER] Added JSOP_ARGUMENTS.
authorDavid Anderson <danderson@mozilla.com>
Tue, 08 Jun 2010 21:34:46 -0700
changeset 52778 ecdc45e540f304975dd5d9d568f32931e7da561d
parent 52777 16eaa1944917e9c8d5ef56a539ae1c22ab1893e9
child 52779 15a0368ee3c3b659b83db9c4f09a60ef557dcf37
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
milestone1.9.3a5pre
[JAEGER] Added JSOP_ARGUMENTS.
js/src/methodjit/Compiler.cpp
js/src/methodjit/StubCalls.cpp
js/src/methodjit/StubCalls.h
--- a/js/src/methodjit/Compiler.cpp
+++ b/js/src/methodjit/Compiler.cpp
@@ -360,16 +360,22 @@ mjit::Compiler::generateMethod()
                                             : Assembler::NonZero;
                 j = masm.branchTest32(cond, Registers::ReturnReg, Registers::ReturnReg);
                 frame.pop();
                 jumpInScript(j, PC + GET_JUMP_OFFSET(PC));
             }
           }
           END_CASE(JSOP_IFNE)
 
+          BEGIN_CASE(JSOP_ARGUMENTS)
+            prepareStubCall();
+            stubCall(stubs::Arguments, Uses(0), Defs(1));
+            frame.pushSynced();
+          END_CASE(JSOP_ARGUMENTS)
+
           BEGIN_CASE(JSOP_FORLOCAL)
             iterNext();
             frame.storeLocal(GET_SLOTNO(PC));
             frame.pop();
           END_CASE(JSOP_FORLOCAL)
 
           BEGIN_CASE(JSOP_DUP)
             frame.dup();
--- a/js/src/methodjit/StubCalls.cpp
+++ b/js/src/methodjit/StubCalls.cpp
@@ -2460,8 +2460,16 @@ JSObject * JS_FASTCALL
 stubs::FlatLambda(VMFrame &f, JSFunction *fun)
 {
     JSObject *obj = js_NewFlatClosure(f.cx, fun);
     if (!obj)
         THROWV(NULL);
     return obj;
 }
 
+void JS_FASTCALL
+stubs::Arguments(VMFrame &f)
+{
+    f.regs.sp++;
+    if (!js_GetArgsValue(f.cx, f.fp, &f.regs.sp[-1]))
+        THROW();
+}
+
--- a/js/src/methodjit/StubCalls.h
+++ b/js/src/methodjit/StubCalls.h
@@ -83,16 +83,17 @@ void JS_FASTCALL IncProp(VMFrame &f, JSA
 void JS_FASTCALL DecProp(VMFrame &f, JSAtom *atom);
 void JS_FASTCALL CallProp(VMFrame &f, JSAtom *atom);
 
 void JS_FASTCALL DefFun(VMFrame &f, uint32 index);
 JSObject * JS_FASTCALL DefLocalFun(VMFrame &f, JSFunction *fun);
 JSObject * JS_FASTCALL RegExp(VMFrame &f, JSObject *regex);
 JSObject * JS_FASTCALL Lambda(VMFrame &f, JSFunction *fun);
 JSObject * JS_FASTCALL FlatLambda(VMFrame &f, JSFunction *fun);
+void JS_FASTCALL Arguments(VMFrame &f);
 
 void JS_FASTCALL VpInc(VMFrame &f, Value *vp);
 void JS_FASTCALL VpDec(VMFrame &f, Value *vp);
 void JS_FASTCALL DecVp(VMFrame &f, Value *vp);
 void JS_FASTCALL IncVp(VMFrame &f, Value *vp);
 
 JSBool JS_FASTCALL LessThan(VMFrame &f);
 JSBool JS_FASTCALL LessEqual(VMFrame &f);