summaryrefslogtreecommitdiff
path: root/deps/v8/src/crankshaft/ia32/lithium-ia32.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/crankshaft/ia32/lithium-ia32.cc')
-rw-r--r--deps/v8/src/crankshaft/ia32/lithium-ia32.cc57
1 files changed, 17 insertions, 40 deletions
diff --git a/deps/v8/src/crankshaft/ia32/lithium-ia32.cc b/deps/v8/src/crankshaft/ia32/lithium-ia32.cc
index a0cb93975f..e2772d5ee3 100644
--- a/deps/v8/src/crankshaft/ia32/lithium-ia32.cc
+++ b/deps/v8/src/crankshaft/ia32/lithium-ia32.cc
@@ -344,11 +344,11 @@ void LAccessArgumentsAt::PrintDataTo(StringStream* stream) {
int LPlatformChunk::GetNextSpillIndex(RegisterKind kind) {
// Skip a slot if for a double-width slot.
if (kind == DOUBLE_REGISTERS) {
- spill_slot_count_++;
- spill_slot_count_ |= 1;
+ current_frame_slots_++;
+ current_frame_slots_ |= 1;
num_double_slots_++;
}
- return spill_slot_count_++;
+ return current_frame_slots_++;
}
@@ -437,7 +437,7 @@ LPlatformChunk* LChunkBuilder::Build() {
// Reserve the first spill slot for the state of dynamic alignment.
if (info()->IsOptimizing()) {
int alignment_state_index = chunk_->GetNextSpillIndex(GENERAL_REGISTERS);
- DCHECK_EQ(alignment_state_index, 0);
+ DCHECK_EQ(alignment_state_index, 4);
USE(alignment_state_index);
}
@@ -1524,14 +1524,22 @@ LInstruction* LChunkBuilder::DoMul(HMul* instr) {
DCHECK(instr->left()->representation().Equals(instr->representation()));
DCHECK(instr->right()->representation().Equals(instr->representation()));
LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand());
- LOperand* right = UseOrConstant(instr->BetterRightOperand());
+ HValue* h_right = instr->BetterRightOperand();
+ LOperand* right = UseOrConstant(h_right);
LOperand* temp = NULL;
if (instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
temp = TempRegister();
}
LMulI* mul = new(zone()) LMulI(left, right, temp);
- if (instr->CheckFlag(HValue::kCanOverflow) ||
- instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
+ int constant_value =
+ h_right->IsConstant() ? HConstant::cast(h_right)->Integer32Value() : 0;
+ // |needs_environment| must mirror the cases where LCodeGen::DoMulI calls
+ // |DeoptimizeIf|.
+ bool needs_environment =
+ instr->CheckFlag(HValue::kCanOverflow) ||
+ (instr->CheckFlag(HValue::kBailoutOnMinusZero) &&
+ (!right->IsConstantOperand() || constant_value <= 0));
+ if (needs_environment) {
AssignEnvironment(mul);
}
return DefineSameAsFirst(mul);
@@ -1701,14 +1709,6 @@ LInstruction* LChunkBuilder::DoCompareHoleAndBranch(
}
-LInstruction* LChunkBuilder::DoCompareMinusZeroAndBranch(
- HCompareMinusZeroAndBranch* instr) {
- LOperand* value = UseRegister(instr->value());
- LOperand* scratch = TempRegister();
- return new(zone()) LCompareMinusZeroAndBranch(value, scratch);
-}
-
-
LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) {
DCHECK(instr->value()->representation().IsTagged());
LOperand* temp = TempRegister();
@@ -1780,12 +1780,6 @@ LInstruction* LChunkBuilder::DoClassOfTestAndBranch(
}
-LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) {
- LOperand* map = UseRegisterAtStart(instr->value());
- return DefineAsRegister(new(zone()) LMapEnumLength(map));
-}
-
-
LInstruction* LChunkBuilder::DoSeqStringGetChar(HSeqStringGetChar* instr) {
LOperand* string = UseRegisterAtStart(instr->string());
LOperand* index = UseRegisterOrConstantAtStart(instr->index());
@@ -2492,8 +2486,7 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
return DefineAsSpilled(result, spill_index);
} else {
DCHECK(info()->IsStub());
- CallInterfaceDescriptor descriptor =
- info()->code_stub()->GetCallInterfaceDescriptor();
+ CallInterfaceDescriptor descriptor = graph()->descriptor();
int index = static_cast<int>(instr->index());
Register reg = descriptor.GetRegisterParameter(index);
return DefineFixed(result, reg);
@@ -2519,18 +2512,12 @@ LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) {
// The first local is saved at the end of the unoptimized frame.
spill_index = graph()->osr()->UnoptimizedFrameSlots();
}
+ spill_index += StandardFrameConstants::kFixedSlotCount;
}
return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index);
}
-LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) {
- LOperand* context = UseFixed(instr->context(), esi);
- LCallStub* result = new(zone()) LCallStub(context);
- return MarkAsCall(DefineFixed(result, eax), instr);
-}
-
-
LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) {
// There are no real uses of the arguments object.
// arguments.length and element access are supported directly on
@@ -2680,16 +2667,6 @@ LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) {
}
-LInstruction* LChunkBuilder::DoAllocateBlockContext(
- HAllocateBlockContext* instr) {
- LOperand* context = UseFixed(instr->context(), esi);
- LOperand* function = UseRegisterAtStart(instr->function());
- LAllocateBlockContext* result =
- new(zone()) LAllocateBlockContext(context, function);
- return MarkAsCall(DefineFixed(result, esi), instr);
-}
-
-
} // namespace internal
} // namespace v8