| Index: src/mips/lithium-mips.cc
|
| diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc
|
| index 0a14c3ed484ffa89b1b9e46eee5c29e95c75f73c..1539deb9c3d701f885af866637d1c3813ca50ef2 100644
|
| --- a/src/mips/lithium-mips.cc
|
| +++ b/src/mips/lithium-mips.cc
|
| @@ -848,17 +848,18 @@ void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) {
|
| void LChunkBuilder::VisitInstruction(HInstruction* current) {
|
| HInstruction* old_current = current_instruction_;
|
| current_instruction_ = current;
|
| - if (current->has_position()) position_ = current->position();
|
|
|
| LInstruction* instr = NULL;
|
| if (current->CanReplaceWithDummyUses()) {
|
| if (current->OperandCount() == 0) {
|
| instr = DefineAsRegister(new(zone()) LDummy());
|
| } else {
|
| + ASSERT(!current->OperandAt(0)->IsControlInstruction());
|
| instr = DefineAsRegister(new(zone())
|
| LDummyUse(UseAny(current->OperandAt(0))));
|
| }
|
| for (int i = 1; i < current->OperandCount(); ++i) {
|
| + if (current->OperandAt(i)->IsControlInstruction()) continue;
|
| LInstruction* dummy =
|
| new(zone()) LDummyUse(UseAny(current->OperandAt(i)));
|
| dummy->set_hydrogen_value(current);
|
| @@ -943,6 +944,9 @@ LInstruction* LChunkBuilder::DoBranch(HBranch* instr) {
|
|
|
|
|
| LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) {
|
| + LInstruction* goto_instr = CheckElideControlInstruction(instr);
|
| + if (goto_instr != NULL) return goto_instr;
|
| +
|
| ASSERT(instr->value()->representation().IsTagged());
|
| LOperand* value = UseRegisterAtStart(instr->value());
|
| LOperand* temp = TempRegister();
|
| @@ -1045,30 +1049,12 @@ LInstruction* LChunkBuilder::DoContext(HContext* instr) {
|
| }
|
|
|
|
|
| -LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) {
|
| - LOperand* context = UseRegisterAtStart(instr->value());
|
| - return DefineAsRegister(new(zone()) LOuterContext(context));
|
| -}
|
| -
|
| -
|
| LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) {
|
| LOperand* context = UseFixed(instr->context(), cp);
|
| return MarkAsCall(new(zone()) LDeclareGlobals(context), instr);
|
| }
|
|
|
|
|
| -LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) {
|
| - LOperand* context = UseRegisterAtStart(instr->value());
|
| - return DefineAsRegister(new(zone()) LGlobalObject(context));
|
| -}
|
| -
|
| -
|
| -LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) {
|
| - LOperand* global_object = UseRegisterAtStart(instr->value());
|
| - return DefineAsRegister(new(zone()) LGlobalReceiver(global_object));
|
| -}
|
| -
|
| -
|
| LInstruction* LChunkBuilder::DoCallJSFunction(
|
| HCallJSFunction* instr) {
|
| LOperand* function = UseFixed(instr->function(), a1);
|
| @@ -1115,6 +1101,7 @@ LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
|
| case kMathExp: return DoMathExp(instr);
|
| case kMathSqrt: return DoMathSqrt(instr);
|
| case kMathPowHalf: return DoMathPowHalf(instr);
|
| + case kMathClz32: return DoMathClz32(instr);
|
| default:
|
| UNREACHABLE();
|
| return NULL;
|
| @@ -1130,6 +1117,13 @@ LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) {
|
| }
|
|
|
|
|
| +LInstruction* LChunkBuilder::DoMathClz32(HUnaryMathOperation* instr) {
|
| + LOperand* input = UseRegisterAtStart(instr->value());
|
| + LMathClz32* result = new(zone()) LMathClz32(input);
|
| + return DefineAsRegister(result);
|
| +}
|
| +
|
| +
|
| LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) {
|
| ASSERT(instr->representation().IsDouble());
|
| ASSERT(instr->value()->representation().IsDouble());
|
| @@ -1205,9 +1199,7 @@ LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) {
|
| LOperand* context = UseFixed(instr->context(), cp);
|
| LOperand* function = UseFixed(instr->function(), a1);
|
| LCallFunction* call = new(zone()) LCallFunction(context, function);
|
| - LInstruction* result = DefineFixed(call, v0);
|
| - if (instr->IsTailCall()) return result;
|
| - return MarkAsCall(result, instr);
|
| + return MarkAsCall(DefineFixed(call, v0), instr);
|
| }
|
|
|
|
|
| @@ -1295,20 +1287,6 @@ bool LChunkBuilder::HasMagicNumberForDivisor(int32_t divisor) {
|
| }
|
|
|
|
|
| -HValue* LChunkBuilder::SimplifiedDivisorForMathFloorOfDiv(HValue* divisor) {
|
| - // Only optimize when we have magic numbers for the divisor.
|
| - // The standard integer division routine is usually slower than transitionning
|
| - // to FPU.
|
| - if (divisor->IsConstant() &&
|
| - HConstant::cast(divisor)->HasInteger32Value()) {
|
| - HConstant* constant_val = HConstant::cast(divisor);
|
| - return constant_val->CopyToRepresentation(Representation::Integer32(),
|
| - divisor->block()->zone());
|
| - }
|
| - return NULL;
|
| -}
|
| -
|
| -
|
| LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) {
|
| HValue* right = instr->right();
|
| LOperand* dividend = UseRegister(instr->left());
|
| @@ -1325,7 +1303,7 @@ LInstruction* LChunkBuilder::DoMod(HMod* instr) {
|
| if (instr->representation().IsSmiOrInteger32()) {
|
| ASSERT(instr->left()->representation().Equals(instr->representation()));
|
| ASSERT(instr->right()->representation().Equals(instr->representation()));
|
| - if (instr->HasPowerOf2Divisor()) {
|
| + if (instr->RightIsPowerOf2()) {
|
| ASSERT(!right->CanBeZero());
|
| LModI* mod = new(zone()) LModI(UseRegisterAtStart(left),
|
| UseConstant(right));
|
| @@ -1663,19 +1641,6 @@ LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) {
|
| }
|
|
|
|
|
| -LInstruction* LChunkBuilder::DoElementsKind(HElementsKind* instr) {
|
| - LOperand* object = UseRegisterAtStart(instr->value());
|
| - return DefineAsRegister(new(zone()) LElementsKind(object));
|
| -}
|
| -
|
| -
|
| -LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) {
|
| - LOperand* object = UseRegister(instr->value());
|
| - LValueOf* result = new(zone()) LValueOf(object, TempRegister());
|
| - return DefineAsRegister(result);
|
| -}
|
| -
|
| -
|
| LInstruction* LChunkBuilder::DoDateField(HDateField* instr) {
|
| LOperand* object = UseFixed(instr->value(), a0);
|
| LDateField* result =
|
| @@ -1723,13 +1688,6 @@ LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) {
|
| }
|
|
|
|
|
| -LInstruction* LChunkBuilder::DoThrow(HThrow* instr) {
|
| - LOperand* context = UseFixed(instr->context(), cp);
|
| - LOperand* value = UseFixed(instr->value(), a0);
|
| - return MarkAsCall(new(zone()) LThrow(context, value), instr);
|
| -}
|
| -
|
| -
|
| LInstruction* LChunkBuilder::DoUseConst(HUseConst* instr) {
|
| return NULL;
|
| }
|
| @@ -2012,13 +1970,6 @@ LInstruction* LChunkBuilder::DoLoadRoot(HLoadRoot* instr) {
|
| }
|
|
|
|
|
| -LInstruction* LChunkBuilder::DoLoadExternalArrayPointer(
|
| - HLoadExternalArrayPointer* instr) {
|
| - LOperand* input = UseRegisterAtStart(instr->value());
|
| - return DefineAsRegister(new(zone()) LLoadExternalArrayPointer(input));
|
| -}
|
| -
|
| -
|
| LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) {
|
| ASSERT(instr->key()->representation().IsSmiOrInteger32());
|
| ElementsKind elements_kind = instr->elements_kind();
|
| @@ -2048,7 +1999,7 @@ LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) {
|
| // An unsigned int array load might overflow and cause a deopt, make sure it
|
| // has an environment.
|
| bool can_deoptimize = instr->RequiresHoleCheck() ||
|
| - elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS ||
|
| + elements_kind == EXTERNAL_UINT32_ELEMENTS ||
|
| elements_kind == UINT32_ELEMENTS;
|
| return can_deoptimize ? AssignEnvironment(result) : result;
|
| }
|
| @@ -2205,12 +2156,8 @@ LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
|
|
|
| LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) {
|
| LOperand* context = UseFixed(instr->context(), cp);
|
| - LOperand* left = FLAG_new_string_add
|
| - ? UseFixed(instr->left(), a1)
|
| - : UseRegisterAtStart(instr->left());
|
| - LOperand* right = FLAG_new_string_add
|
| - ? UseFixed(instr->right(), a0)
|
| - : UseRegisterAtStart(instr->right());
|
| + LOperand* left = UseFixed(instr->left(), a1);
|
| + LOperand* right = UseFixed(instr->right(), a0);
|
| return MarkAsCall(
|
| DefineFixed(new(zone()) LStringAdd(context, left, right), v0),
|
| instr);
|
|
|