Bug 931732 - Remove #if 0 code from jit/arm/*. r=jandem
authorCykesiopka <cykesiopka.bmo@gmail.com>
Sun, 16 Mar 2014 15:34:13 -0400
changeset 173843 138778313096
parent 173842 bb5bd88acaeb
child 173844 e25f1c48cf0c
push id26425
push userphilringnalda@gmail.com
push date2014-03-17 04:06 +0000
treeherdermozilla-central@5870a4beef4d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs931732
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 931732 - Remove #if 0 code from jit/arm/*. r=jandem
js/src/jit/arm/Assembler-arm.cpp
js/src/jit/arm/Bailouts-arm.cpp
js/src/jit/arm/CodeGenerator-arm.cpp
js/src/jit/arm/Trampoline-arm.cpp
--- a/js/src/jit/arm/Assembler-arm.cpp
+++ b/js/src/jit/arm/Assembler-arm.cpp
@@ -1802,21 +1802,16 @@ Assembler::patchConstantPoolLoad(void* l
 
 uint32_t
 Assembler::placeConstantPoolBarrier(int offset)
 {
     // BUG: 700526
     // this is still an active path, however, we do not hit it in the test
     // suite at all.
     MOZ_ASSUME_UNREACHABLE("ARMAssembler holdover");
-#if 0
-    offset = (offset - sizeof(ARMWord)) >> 2;
-    ASSERT((offset <= BOFFSET_MAX && offset >= BOFFSET_MIN));
-    return AL | B | (offset & BRANCH_MASK);
-#endif
 }
 
 // Control flow stuff:
 
 // bx can *only* branch to a register
 // never to an immediate.
 BufferOffset
 Assembler::as_bx(Register r, Condition c, bool isPatchable)
--- a/js/src/jit/arm/Bailouts-arm.cpp
+++ b/js/src/jit/arm/Bailouts-arm.cpp
@@ -8,64 +8,16 @@
 #include "jscompartment.h"
 
 #include "jit/Bailouts.h"
 #include "jit/JitCompartment.h"
 
 using namespace js;
 using namespace js::jit;
 
-#if 0
-// no clue what these asserts should be.
-JS_STATIC_ASSERT(sizeof(BailoutStack) ==
-                 sizeof(uintptr_t) +
-                 sizeof(double) * 8 +
-                 sizeof(uintptr_t) * 8 +
-                 sizeof(uintptr_t));
-
-JS_STATIC_ASSERT(sizeof(ExtendedBailoutStack) ==
-                 sizeof(BailoutStack) +
-                 sizeof(uintptr_t));
-
-#endif
-#if 0
-BailoutEnvironment::BailoutEnvironment(JitCompartment *ion, void **sp)
-  : sp_(sp)
-{
-    bailout_ = reinterpret_cast<ExtendedBailoutStack *>(sp);
-
-    if (bailout_->frameClass() != FrameSizeClass::None()) {
-        frameSize_ = bailout_->frameSize();
-        frame_ = &sp_[sizeof(BailoutStack) / sizeof(void *)];
-
-        // Compute the bailout ID.
-        JitCode *code = ion->getBailoutTable(bailout_->frameClass());
-        uintptr_t tableOffset = bailout_->tableOffset();
-        uintptr_t tableStart = reinterpret_cast<uintptr_t>(code->raw());
-
-        JS_ASSERT(tableOffset >= tableStart &&
-                  tableOffset < tableStart + code->instructionsSize());
-        JS_ASSERT((tableOffset - tableStart) % BAILOUT_TABLE_ENTRY_SIZE == 0);
-
-        bailoutId_ = ((tableOffset - tableStart) / BAILOUT_TABLE_ENTRY_SIZE) - 1;
-        JS_ASSERT(bailoutId_ < BAILOUT_TABLE_SIZE);
-    } else {
-        frameSize_ = bailout_->frameSize();
-        frame_ = &sp_[sizeof(ExtendedBailoutStack) / sizeof(void *)];
-    }
-}
-
-IonFramePrefix *
-BailoutEnvironment::top() const
-{
-    return (IonFramePrefix *)&frame_[frameSize_ / sizeof(void *)];
-}
-
-#endif
-
 namespace js {
 namespace jit {
 
 class BailoutStack
 {
     uintptr_t frameClassId_;
     // This is pushed in the bailout handler.  Both entry points into the handler
     // inserts their own value int lr, which is then placed onto the stack along
--- a/js/src/jit/arm/CodeGenerator-arm.cpp
+++ b/js/src/jit/arm/CodeGenerator-arm.cpp
@@ -237,33 +237,18 @@ CodeGeneratorARM::bailoutFrom(Label *lab
     if (!encode(snapshot))
         return false;
 
     // Though the assembler doesn't track all frame pushes, at least make sure
     // the known value makes sense. We can't use bailout tables if the stack
     // isn't properly aligned to the static frame size.
     JS_ASSERT_IF(frameClass_ != FrameSizeClass::None(),
                  frameClass_.frameSize() == masm.framePushed());
-    // This involves retargeting a label, which I've declared is always going
-    // to be a pc-relative branch to an absolute address!
-    // With no assurance that this is going to be a local branch, I am wary to
-    // implement this.  Moreover, If it isn't a local branch, it will be large
-    // and possibly slow.  I believe that the correct way to handle this is to
-    // subclass label into a fatlabel, where we generate enough room for a load
-    // before the branch
-#if 0
-    if (assignBailoutId(snapshot)) {
-        uint8_t *code = deoptTable_->raw() + snapshot->bailoutId() * BAILOUT_TABLE_ENTRY_SIZE;
-        masm.retarget(label, code, Relocation::HARDCODED);
-        return true;
-    }
-#endif
-    // We could not use a jump table, either because all bailout IDs were
-    // reserved, or a jump table is not optimal for this frame size or
-    // platform. Whatever, we will generate a lazy bailout.
+
+    // On ARM we don't use a bailout table.
     OutOfLineBailout *ool = new(alloc()) OutOfLineBailout(snapshot, masm.framePushed());
     if (!addOutOfLineCode(ool)) {
         return false;
     }
 
     masm.retarget(label, ool->entry());
 
     return true;
@@ -1656,24 +1641,16 @@ CodeGeneratorARM::visitNotD(LNotD *ins)
         masm.ma_lsr(Imm32(28), dest, dest);
         masm.ma_alu(dest, lsr(dest, 2), dest, op_orr); // 28 + 2 = 30
         masm.ma_and(Imm32(1), dest);
     } else {
         masm.as_vmrs(pc);
         masm.ma_mov(Imm32(0), dest);
         masm.ma_mov(Imm32(1), dest, NoSetCond, Assembler::Equal);
         masm.ma_mov(Imm32(1), dest, NoSetCond, Assembler::Overflow);
-#if 0
-        masm.as_vmrs(ToRegister(dest));
-        // Mask out just the two bits we care about.  If neither bit is set,
-        // the dest is already zero
-        masm.ma_and(Imm32(0x50000000), dest, dest, Assembler::SetCond);
-        // If it is non-zero, then force it to be 1.
-        masm.ma_mov(Imm32(1), dest, NoSetCond, Assembler::NotEqual);
-#endif
     }
     return true;
 }
 
 bool
 CodeGeneratorARM::visitNotF(LNotF *ins)
 {
     // Since this operation is not, we want to set a bit if
@@ -1693,24 +1670,16 @@ CodeGeneratorARM::visitNotF(LNotF *ins)
         masm.ma_lsr(Imm32(28), dest, dest);
         masm.ma_alu(dest, lsr(dest, 2), dest, op_orr); // 28 + 2 = 30
         masm.ma_and(Imm32(1), dest);
     } else {
         masm.as_vmrs(pc);
         masm.ma_mov(Imm32(0), dest);
         masm.ma_mov(Imm32(1), dest, NoSetCond, Assembler::Equal);
         masm.ma_mov(Imm32(1), dest, NoSetCond, Assembler::Overflow);
-#if 0
-        masm.as_vmrs(ToRegister(dest));
-        // Mask out just the two bits we care about.  If neither bit is set,
-        // the dest is already zero
-        masm.ma_and(Imm32(0x50000000), dest, dest, Assembler::SetCond);
-        // If it is non-zero, then force it to be 1.
-        masm.ma_mov(Imm32(1), dest, NoSetCond, Assembler::NotEqual);
-#endif
     }
     return true;
 }
 
 bool
 CodeGeneratorARM::visitLoadSlotV(LLoadSlotV *load)
 {
     const ValueOperand out = ToOutValue(load);
--- a/js/src/jit/arm/Trampoline-arm.cpp
+++ b/js/src/jit/arm/Trampoline-arm.cpp
@@ -143,28 +143,16 @@ JitRuntime::generateEnterJIT(JSContext *
     // Save stack pointer.
     if (type == EnterJitBaseline)
         masm.movePtr(sp, r11);
 
     // Load the number of actual arguments into r10.
     masm.loadPtr(slot_vp, r10);
     masm.unboxInt32(Address(r10, 0), r10);
 
-#if 0
-    // This is in case we want to go back to using frames that
-    // aren't 8 byte alinged
-    // there are r1 2-word arguments to the js code
-    // we want 2 word alignment, so this shouldn't matter.
-    // After the arguments have been pushed, we want to push an additional 3 words of
-    // data, so in all, we want to decrease sp by 4 if it is currently aligned to
-    // 8, and not touch it otherwise
-    aasm->as_sub(sp, sp, Imm8(4));
-    aasm->as_orr(sp, sp, Imm8(4));
-#endif
-
     // Subtract off the size of the arguments from the stack pointer, store elsewhere
     aasm->as_sub(r4, sp, O2RegImmShift(r1, LSL, 3)); //r4 = sp - argc*8
     // Get the final position of the stack pointer into the stack pointer
     aasm->as_sub(sp, r4, Imm8(16)); // sp' = sp - argc*8 - 16
     // Get a copy of the number of args to use as a decrement counter, also
     // Set the zero condition code
     aasm->as_mov(r5, O2Reg(r1), SetCond);