[JAEGER] Start of BINDNAME.
authorDavid Anderson <danderson@mozilla.com>
Tue, 25 May 2010 22:31:08 -0700
changeset 52604 6d5526c51d107f087836a9ff0715bb711a2a6b23
parent 52603 7e41ce873f384141ad1c40ebb1ad1dc18ab9ff73
child 52605 0f15e5db7b31c8012fed45f3a041079ea22b96cf
push idunknown
push userunknown
push dateunknown
milestone1.9.3a5pre
[JAEGER] Start of BINDNAME.
js/src/methodjit/FastOps.cpp
js/src/methodjit/FrameEntry.h
js/src/methodjit/FrameState.h
--- a/js/src/methodjit/FastOps.cpp
+++ b/js/src/methodjit/FastOps.cpp
@@ -39,13 +39,29 @@
  * ***** END LICENSE BLOCK ***** */
 #include "MethodJIT.h"
 #include "Compiler.h"
 
 #include "jsautooplen.h"
 
 using namespace js;
 
+static const uint32 TAG_OFFSET     = 4;
+static const uint32 PAYLOAD_OFFSET = 0;
+
 void
 mjit::Compiler::jsop_bindname(uint32 index)
 {
+    RegisterID reg = frame.allocReg();
+    masm.loadPtr(Address(FrameState::FpReg, offsetof(JSStackFrame, scopeChain)), reg);
+
+    Address address(reg, offsetof(JSObject, fslots) + JSSLOT_PARENT * sizeof(jsval));
+
+    masm.load32(Address(address.base, address.offset + PAYLOAD_OFFSET), reg);
+#ifdef JS_64BIT
+# error "Bleh!"
+#endif
+
+    Jump j = masm.branchTestPtr(MacroAssembler::Zero, reg, reg);
+
+    frame.pushObject(reg);
 }
 
--- a/js/src/methodjit/FrameEntry.h
+++ b/js/src/methodjit/FrameEntry.h
@@ -60,20 +60,20 @@ struct RematInfo {
 
         /* Backing bits are in a register. */
         PhysLoc_Register,
 
         /* Backing bits are in memory. */
         PhysLoc_Memory
     };
 
-    void setRegister(RegisterID reg, bool synced) {
+    void setRegister(RegisterID reg) {
         reg_ = reg;
         location_ = PhysLoc_Register;
-        synced_ = synced;
+        synced_ = false;
     }
 
     bool isCopy() { return location_ == PhysLoc_Copy; }
     void setConstant() { location_ = PhysLoc_Constant; }
     void unsync() { synced_ = false; }
     bool isConstant() { return location_ == PhysLoc_Constant; }
     bool inRegister() { return location_ == PhysLoc_Register; }
     RegisterID reg() { return reg_; }
--- a/js/src/methodjit/FrameState.h
+++ b/js/src/methodjit/FrameState.h
@@ -97,17 +97,17 @@ class FrameState
         JS_ASSERT(!regstate[reg].tracked);
         regalloc.freeReg(reg);
     }
 
     /*
      * Push a type register, unsycned, with unknown payload.
      */
     void pushUnknownType(RegisterID reg) {
-        sp[0].type.setRegister(reg, false);
+        sp[0].type.setRegister(reg);
         sp[0].data.setMemory();
         sp[0].copies = 0;
         regstate[reg].tracked = true;
         regstate[reg].index = uint32(sp - base);
         regstate[reg].part = RegState::Part_Type;
         sp++;
     }
 
@@ -117,16 +117,27 @@ class FrameState
 
     void push(const jsval &v) {
         sp[0].setConstant(v);
         sp[0].copies = 0;
         sp++;
         JS_ASSERT(sp - locals <= script->nslots);
     }
 
+    void pushObject(RegisterID reg) {
+        sp[0].type.setConstant();
+        sp[0].v_.s.mask32 = JSVAL_MASK32_NONFUNOBJ;
+        sp[0].data.setRegister(reg);
+        sp[0].copies = 0;
+        regstate[reg].tracked = true;
+        regstate[reg].part = RegState::Part_Data;
+        regstate[reg].index = uint32(sp - base);
+        sp++;
+    }
+
     FrameEntry *peek(int32 depth) {
         JS_ASSERT(depth < 0);
         JS_ASSERT(sp + depth >= locals + script->nfixed);
         return &sp[depth];
     }
 
     void pop() {
         FrameEntry *vi = peek(-1);