[JAEGER] Rename some functions to make namespace for FPRegisters; (572202, r=dvander).
authorSean Stangl <sstangl@mozilla.com>
Tue, 15 Jun 2010 18:24:31 -0700
changeset 52846 fd9db01bd8f9c55069e67449d64c30c12cd23440
parent 52844 5a2ac3332b9eb3066c43ec5990260d8801e987f9
child 52848 620cbf644ba90d532ee82cec1105a6ae7ec0ae4a
push idunknown
push userunknown
push dateunknown
reviewersdvander
bugs572202
milestone1.9.3a5pre
[JAEGER] Rename some functions to make namespace for FPRegisters; (572202, r=dvander).
js/src/methodjit/FrameState-inl.h
js/src/methodjit/FrameState.cpp
js/src/methodjit/FrameState.h
js/src/methodjit/nunbox/FastOps.cpp
--- a/js/src/methodjit/FrameState-inl.h
+++ b/js/src/methodjit/FrameState-inl.h
@@ -75,55 +75,55 @@ FrameState::popn(uint32 n)
 
 inline JSC::MacroAssembler::RegisterID
 FrameState::allocReg()
 {
     RegisterID reg;
     if (!freeRegs.empty())
         reg = freeRegs.takeAnyReg();
     else
-        reg = evictSomething();
+        reg = evictSomeReg();
     regstate[reg].fe = NULL;
     return reg;
 }
 
 inline JSC::MacroAssembler::RegisterID
 FrameState::allocReg(uint32 mask)
 {
     RegisterID reg;
     if (freeRegs.hasRegInMask(mask))
         reg = freeRegs.takeRegInMask(mask);
     else
-        reg = evictSomething(mask);
+        reg = evictSomeReg(mask);
     regstate[reg].fe = NULL;
     return reg;
 }
 
 inline JSC::MacroAssembler::RegisterID
 FrameState::allocReg(FrameEntry *fe, RematInfo::RematType type, bool weak)
 {
     RegisterID reg;
     if (!freeRegs.empty())
         reg = freeRegs.takeAnyReg();
     else
-        reg = evictSomething();
+        reg = evictSomeReg();
     regstate[reg] = RegisterState(fe, type, weak);
     return reg;
 }
 
 inline void
 FrameState::pop()
 {
     JS_ASSERT(sp > spBase);
 
     FrameEntry *fe = *--sp;
     if (!fe)
         return;
 
-    forgetRegs(fe);
+    forgetAllRegs(fe);
 }
 
 inline void
 FrameState::freeReg(RegisterID reg)
 {
     JS_ASSERT(regstate[reg].fe == NULL);
     freeRegs.putReg(reg);
 }
@@ -487,17 +487,17 @@ FrameState::pinReg(RegisterID reg)
 inline void
 FrameState::unpinReg(RegisterID reg)
 {
     JS_ASSERT(!regstate[reg].fe);
     regstate[reg].fe = regstate[reg].save;
 }
 
 inline void
-FrameState::forgetRegs(FrameEntry *fe)
+FrameState::forgetAllRegs(FrameEntry *fe)
 {
     if (fe->type.inRegister())
         forgetReg(fe->type.reg());
     if (fe->data.inRegister())
         forgetReg(fe->data.reg());
 }
 
 inline FrameEntry *
@@ -561,17 +561,17 @@ FrameState::enterBlock(uint32 n)
     JS_ASSERT(uint32(sp + n - locals) <= script->nslots);
 
     sp += n;
 }
 
 inline void
 FrameState::eviscerate(FrameEntry *fe)
 {
-    forgetRegs(fe);
+    forgetAllRegs(fe);
     fe->type.invalidate();
     fe->data.invalidate();
     fe->setNotCopied();
     fe->setCopyOf(NULL);
 }
 
 } /* namspace mjit */
 } /* namspace js */
--- a/js/src/methodjit/FrameState.cpp
+++ b/js/src/methodjit/FrameState.cpp
@@ -121,17 +121,17 @@ FrameState::evictReg(RegisterID reg)
             syncData(fe, addressOf(fe), masm);
             fe->data.sync();
         }
         fe->data.setMemory();
     }
 }
 
 JSC::MacroAssembler::RegisterID
-FrameState::evictSomething(uint32 mask)
+FrameState::evictSomeReg(uint32 mask)
 {
 #ifdef DEBUG
     bool fallbackSet = false;
 #endif
     RegisterID fallback = Registers::ReturnReg;
 
     for (uint32 i = 0; i < JSC::MacroAssembler::TotalRegisters; i++) {
         RegisterID reg = RegisterID(i);
@@ -401,17 +401,17 @@ FrameState::merge(Assembler &masm, uint3
         if (fe->data.inRegister())
             masm.loadData32(addressOf(fe), fe->data.reg());
         if (fe->type.inRegister())
             masm.loadTypeTag(addressOf(fe), fe->type.reg());
     }
 }
 
 JSC::MacroAssembler::RegisterID
-FrameState::copyData(FrameEntry *fe)
+FrameState::copyDataIntoReg(FrameEntry *fe)
 {
     JS_ASSERT(!fe->data.isConstant());
 
     if (fe->isCopy())
         fe = fe->copyOf();
 
     if (fe->data.inRegister()) {
         RegisterID reg = fe->data.reg();
@@ -642,19 +642,19 @@ FrameState::storeLocal(uint32 n)
         JS_ASSERT(localFe->isCopied());
         return;
     }
 
     /* Completely invalidate the local variable. */
     if (localFe->isCopied()) {
         uncopy(localFe);
         if (!localFe->isCopied())
-            forgetRegs(localFe);
+            forgetAllRegs(localFe);
     } else {
-        forgetRegs(localFe);
+        forgetAllRegs(localFe);
     }
 
     localFe->resetUnsynced();
 
     /* Constants are easy to propagate. */
     if (top->isConstant()) {
         localFe->setCopyOf(NULL);
         localFe->setNotCopied();
--- a/js/src/methodjit/FrameState.h
+++ b/js/src/methodjit/FrameState.h
@@ -255,17 +255,17 @@ class FrameState
      * opcode.
      */
     RegisterID ownRegForType(FrameEntry *fe);
 
     /*
      * Allocates a register for a FrameEntry's data, such that the compiler
      * can modify it in-place. The actual FE is not modified.
      */
-    RegisterID copyData(FrameEntry *fe);
+    RegisterID copyDataIntoReg(FrameEntry *fe);
 
     /*
      * Types don't always have to be in registers, sometimes the compiler
      * can use addresses and avoid spilling. If this FrameEntry has a synced
      * address and no register, this returns true.
      */
     inline bool shouldAvoidTypeRemat(FrameEntry *fe);
 
@@ -425,24 +425,24 @@ class FrameState
      * Moves the top of the stack down N slots, popping each item above it.
      * Caller guarantees the slots below have been observed and eviscerated.
      */
     void shimmy(uint32 n);
 
   private:
     inline RegisterID allocReg(FrameEntry *fe, RematInfo::RematType type, bool weak);
     inline void forgetReg(RegisterID reg);
-    RegisterID evictSomething(uint32 mask);
+    RegisterID evictSomeReg(uint32 mask);
     void evictReg(RegisterID reg);
     inline FrameEntry *rawPush();
     inline FrameEntry *addToTracker(uint32 index);
     inline void syncType(const FrameEntry *fe, Address to, Assembler &masm) const;
     inline void syncData(const FrameEntry *fe, Address to, Assembler &masm) const;
     inline FrameEntry *getLocal(uint32 slot);
-    inline void forgetRegs(FrameEntry *fe);
+    inline void forgetAllRegs(FrameEntry *fe);
     inline void swapInTracker(FrameEntry *lhs, FrameEntry *rhs);
     inline uint32 localIndex(uint32 n);
     void pushCopyOf(uint32 index);
     void syncFancy(Assembler &masm, Registers avail, uint32 resumeAt) const;
 
     /*
      * "Uncopies" the backing store of a FrameEntry that has been copied. The
      * original FrameEntry is not invalidated; this is the responsibility of
@@ -455,18 +455,18 @@ class FrameState
         JS_ASSERT(base[index]);
         return &entries[index];
     }
 
     void moveOwnership(RegisterID reg, FrameEntry *newFe) {
         regstate[reg].fe = newFe;
     }
 
-    RegisterID evictSomething() {
-        return evictSomething(Registers::AvailRegs);
+    RegisterID evictSomeReg() {
+        return evictSomeReg(Registers::AvailRegs);
     }
 
     uint32 indexOf(int32 depth) {
         return uint32((sp + depth) - base);
     }
 
     uint32 indexOfFe(FrameEntry *fe) {
         return uint32(fe - entries);
--- a/js/src/methodjit/nunbox/FastOps.cpp
+++ b/js/src/methodjit/nunbox/FastOps.cpp
@@ -328,17 +328,17 @@ mjit::Compiler::jsop_globalinc(JSOp op, 
     Address addr = masm.objSlotRef(globalObj, reg, slot);
     uint32 depth = frame.stackDepth();
 
     if (post && !popped) {
         frame.push(addr);
         FrameEntry *fe = frame.peek(-1);
         Jump notInt = frame.testInt32(Assembler::NotEqual, fe);
         stubcc.linkExit(notInt);
-        data = frame.copyData(fe);
+        data = frame.copyDataIntoReg(fe);
     } else {
         Jump notInt = masm.testInt32(Assembler::NotEqual, addr);
         stubcc.linkExit(notInt);
         data = frame.allocReg();
         masm.loadData32(addr, data);
     }
 
     Jump ovf;
@@ -477,17 +477,17 @@ mjit::Compiler::jsop_binary(JSOp op, Voi
         if (lhs->isConstant()) {
             JS_ASSERT(!rhs->isConstant());
             swapped = true;
             FrameEntry *tmp = lhs;
             lhs = rhs;
             rhs = tmp;
         }
 
-        reg = frame.copyData(lhs);
+        reg = frame.copyDataIntoReg(lhs);
         if (swapped && op == JSOP_SUB) {
             masm.neg32(reg);
             op = JSOP_ADD;
         }
 
         Jump fail;
         switch(op) {
           case JSOP_ADD:
@@ -1026,17 +1026,17 @@ mjit::Compiler::jsop_setelem()
 
     /* obj.isNonFunObj() */
     if (!obj->isTypeKnown()) {
         Jump j = frame.testNonFunObj(Assembler::NotEqual, obj);
         stubcc.linkExit(j);
     }
 
     /* obj.isDenseArray() */
-    RegisterID objReg = frame.copyData(obj);
+    RegisterID objReg = frame.copyDataIntoReg(obj);
     Jump guardDense = masm.branchPtr(Assembler::NotEqual,
                                       Address(objReg, offsetof(JSObject, clasp)),
                                       ImmPtr(&js_ArrayClass));
     stubcc.linkExit(guardDense);
 
     /* dslots non-NULL */
     masm.loadPtr(Address(objReg, offsetof(JSObject, dslots)), objReg);
     Jump guardSlots = masm.branchTestPtr(Assembler::Zero, objReg, objReg);
@@ -1067,17 +1067,17 @@ mjit::Compiler::jsop_setelem()
         } else {
             masm.storeData32(frame.tempRegForData(fe), slot);
             if (fe->isTypeKnown())
                 masm.storeTypeTag(ImmTag(fe->getTypeTag()), slot);
             else
                 masm.storeTypeTag(frame.tempRegForType(fe), slot);
         }
     } else {
-        RegisterID idReg = frame.copyData(id);
+        RegisterID idReg = frame.copyDataIntoReg(id);
         Jump inRange = masm.branch32(Assembler::AboveOrEqual,
                                      idReg,
                                      masm.payloadOf(Address(objReg, -int(sizeof(Value)))));
         stubcc.linkExit(inRange);
 
         /* guard not a hole */
         BaseIndex slot(objReg, idReg, Assembler::JSVAL_SCALE);
         Jump notHole = masm.branch32(Assembler::Equal, masm.tagOf(slot), Imm32(JSVAL_MASK32_MAGIC));
@@ -1130,17 +1130,17 @@ mjit::Compiler::jsop_getelem()
 
     /* obj.isNonFunObj() */
     if (!obj->isTypeKnown()) {
         Jump j = frame.testNonFunObj(Assembler::NotEqual, obj);
         stubcc.linkExit(j);
     }
 
     /* obj.isDenseArray() */
-    RegisterID objReg = frame.copyData(obj);
+    RegisterID objReg = frame.copyDataIntoReg(obj);
     Jump guardDense = masm.branchPtr(Assembler::NotEqual,
                                       Address(objReg, offsetof(JSObject, clasp)),
                                       ImmPtr(&js_ArrayClass));
     stubcc.linkExit(guardDense);
 
     /* dslots non-NULL */
     masm.loadPtr(Address(objReg, offsetof(JSObject, dslots)), objReg);
     Jump guardSlots = masm.branchTestPtr(Assembler::Zero, objReg, objReg);
@@ -1160,17 +1160,17 @@ mjit::Compiler::jsop_getelem()
 
         stubcc.leave();
         stubcc.call(stubs::GetElem);
 
         frame.popn(2);
         frame.freeReg(objReg);
         frame.push(slot);
     } else {
-        RegisterID idReg = frame.copyData(id);
+        RegisterID idReg = frame.copyDataIntoReg(id);
         Jump inRange = masm.branch32(Assembler::AboveOrEqual,
                                      idReg,
                                      masm.payloadOf(Address(objReg, -int(sizeof(Value)))));
         stubcc.linkExit(inRange);
 
         /* guard not a hole */
         BaseIndex slot(objReg, idReg, Assembler::JSVAL_SCALE);
         Jump notHole = masm.branch32(Assembler::Equal, masm.tagOf(slot), Imm32(JSVAL_MASK32_MAGIC));