From 246c121179fe964d735c3d6305e2e8353e5332a9 Mon Sep 17 00:00:00 2001 From: Heiher Date: Wed, 30 Sep 2015 07:03:03 +0800 Subject: [PATCH] Bug 1205229 - IonMonkey: MIPS32: Make more CodeGenerator functions can be shared. r=nbp --- js/src/jit/mips32/CodeGenerator-mips32.cpp | 9 +++++---- js/src/jit/mips32/CodeGenerator-mips32.h | 7 +++++-- 2 files changed, 10 insertions(+), 6 deletions(-) --- js/src/jit/mips32/CodeGenerator-mips32.cpp | 9 +++++---- js/src/jit/mips32/CodeGenerator-mips32.h | 7 +++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/js/src/jit/mips32/CodeGenerator-mips32.cpp b/js/src/jit/mips32/CodeGenerator-mips32.cpp index bf3ee6f9c02..da3efa7eaf2 100644 --- a/js/src/jit/mips32/CodeGenerator-mips32.cpp +++ b/js/src/jit/mips32/CodeGenerator-mips32.cpp @@ -135,7 +135,8 @@ CodeGeneratorMIPS::visitCompareAndBranch(LCompareAndBranch* comp) emitBranch(ToRegister(comp->left()), ToRegister(comp->right()), cond, comp->ifTrue(), comp->ifFalse()); } else { - emitBranch(ToRegister(comp->left()), ToAddress(comp->right()), cond, + masm.load32(ToAddress(comp->right()), ScratchRegister); + emitBranch(ToRegister(comp->left()), ScratchRegister, cond, comp->ifTrue(), comp->ifFalse()); } } @@ -1744,7 +1745,7 @@ CodeGeneratorMIPS::visitGuardClass(LGuardClass* guard) Register tmp = ToRegister(guard->tempInt()); masm.loadObjClass(obj, tmp); - bailoutCmpPtr(Assembler::NotEqual, tmp, Imm32((uint32_t)guard->mir()->getClass()), + bailoutCmpPtr(Assembler::NotEqual, tmp, ImmPtr(guard->mir()->getClass()), guard->snapshot()); } @@ -2079,8 +2080,8 @@ CodeGeneratorMIPS::visitAsmJSLoadFuncPtr(LAsmJSLoadFuncPtr* ins) Register out = ToRegister(ins->output()); unsigned addr = mir->globalDataOffset() - AsmJSGlobalRegBias; - BaseIndex source(GlobalReg, index, TimesFour, addr); - masm.load32(source, out); + BaseIndex source(GlobalReg, index, ScalePointer, addr); + masm.loadPtr(source, out); } void diff --git a/js/src/jit/mips32/CodeGenerator-mips32.h b/js/src/jit/mips32/CodeGenerator-mips32.h index 1e56d0ade08..bfe90bb6500 100644 --- a/js/src/jit/mips32/CodeGenerator-mips32.h +++ b/js/src/jit/mips32/CodeGenerator-mips32.h @@ -35,7 +35,7 @@ class CodeGeneratorMIPS : public CodeGeneratorShared template void bailoutCmp32(Assembler::Condition c, T1 lhs, T2 rhs, LSnapshot* snapshot) { Label skip; - masm.ma_b(lhs, rhs, &skip, Assembler::InvertCondition(c), ShortJump); + masm.branch32(Assembler::InvertCondition(c), lhs, rhs, &skip); bailout(snapshot); masm.bind(&skip); } @@ -56,7 +56,10 @@ class CodeGeneratorMIPS : public CodeGeneratorShared } template void bailoutCmpPtr(Assembler::Condition c, T1 lhs, T2 rhs, LSnapshot* snapshot) { - bailoutCmp32(c, lhs, rhs, snapshot); + Label skip; + masm.branchPtr(Assembler::InvertCondition(c), lhs, rhs, &skip); + bailout(snapshot); + masm.bind(&skip); } void bailoutTestPtr(Assembler::Condition c, Register lhs, Register rhs, LSnapshot* snapshot) { Label bail;