Index: src/ia32/lithium-ia32.cc |
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc |
index e8ff7666bf95e7e1db922212e4bf1fa2788fe1f2..7357b30b6111ffa08094e6b3d5ba21524c18f699 100644 |
--- a/src/ia32/lithium-ia32.cc |
+++ b/src/ia32/lithium-ia32.cc |
@@ -27,7 +27,7 @@ |
#include "v8.h" |
-#if defined(V8_TARGET_ARCH_IA32) |
+#if V8_TARGET_ARCH_IA32 |
#include "lithium-allocator-inl.h" |
#include "ia32/lithium-ia32.h" |
@@ -201,7 +201,7 @@ void LBranch::PrintDataTo(StringStream* stream) { |
} |
-void LCmpIDAndBranch::PrintDataTo(StringStream* stream) { |
+void LCompareNumericAndBranch::PrintDataTo(StringStream* stream) { |
stream->Add("if "); |
left()->PrintTo(stream); |
stream->Add(" %s ", Token::String(op())); |
@@ -350,9 +350,7 @@ void LCallNewArray::PrintDataTo(StringStream* stream) { |
stream->Add(" "); |
constructor()->PrintTo(stream); |
stream->Add(" #%d / ", arity()); |
- ASSERT(hydrogen()->property_cell()->value()->IsSmi()); |
- ElementsKind kind = static_cast<ElementsKind>( |
- Smi::cast(hydrogen()->property_cell()->value())->value()); |
+ ElementsKind kind = hydrogen()->elements_kind(); |
stream->Add(" (%s) ", ElementsKindToString(kind)); |
} |
@@ -1579,7 +1577,17 @@ LInstruction* LChunkBuilder::DoMul(HMul* instr) { |
} |
return DefineSameAsFirst(mul); |
} else if (instr->representation().IsDouble()) { |
- return DoArithmeticD(Token::MUL, instr); |
+ if (CpuFeatures::IsSafeForSnapshot(SSE2)) { |
+ return DoArithmeticD(Token::MUL, instr); |
+ } |
+ ASSERT(instr->right()->IsConstant() && |
+ static_cast<HConstant*>(instr->right())->DoubleValue() == -1); |
+ // TODO(olivf) This is currently just a hack to support the UnaryOp Minus |
+ // Stub. This will go away once we can use more than one X87 register, |
+ // thus fully support binary instructions without SSE2. |
+ LOperand* left = UseX87TopOfStack(instr->left()); |
+ LNegateNoSSE2D* result = new(zone()) LNegateNoSSE2D(left); |
+ return DefineX87TOS(result); |
} else { |
ASSERT(instr->representation().IsSmiOrTagged()); |
return DoArithmeticT(Token::MUL, instr); |
@@ -1696,8 +1704,8 @@ LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { |
} |
-LInstruction* LChunkBuilder::DoCompareIDAndBranch( |
- HCompareIDAndBranch* instr) { |
+LInstruction* LChunkBuilder::DoCompareNumericAndBranch( |
+ HCompareNumericAndBranch* instr) { |
Representation r = instr->representation(); |
if (r.IsSmiOrInteger32()) { |
ASSERT(instr->left()->representation().IsSmiOrInteger32()); |
@@ -1705,7 +1713,7 @@ LInstruction* LChunkBuilder::DoCompareIDAndBranch( |
instr->right()->representation())); |
LOperand* left = UseRegisterOrConstantAtStart(instr->left()); |
LOperand* right = UseOrConstantAtStart(instr->right()); |
- return new(zone()) LCmpIDAndBranch(left, right); |
+ return new(zone()) LCompareNumericAndBranch(left, right); |
} else { |
ASSERT(r.IsDouble()); |
ASSERT(instr->left()->representation().IsDouble()); |
@@ -1719,7 +1727,7 @@ LInstruction* LChunkBuilder::DoCompareIDAndBranch( |
left = UseRegisterAtStart(instr->left()); |
right = UseRegisterAtStart(instr->right()); |
} |
- return new(zone()) LCmpIDAndBranch(left, right); |
+ return new(zone()) LCompareNumericAndBranch(left, right); |
} |
} |
@@ -1817,13 +1825,6 @@ LInstruction* LChunkBuilder::DoClassOfTestAndBranch( |
} |
-LInstruction* LChunkBuilder::DoFixedArrayBaseLength( |
- HFixedArrayBaseLength* instr) { |
- LOperand* array = UseRegisterAtStart(instr->value()); |
- return DefineAsRegister(new(zone()) LFixedArrayBaseLength(array)); |
-} |
- |
- |
LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) { |
LOperand* map = UseRegisterAtStart(instr->value()); |
return DefineAsRegister(new(zone()) LMapEnumLength(map)); |
@@ -2046,6 +2047,18 @@ LInstruction* LChunkBuilder::DoCheckHeapObject(HCheckHeapObject* instr) { |
} |
+LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) { |
+ LOperand* value = UseRegisterAtStart(instr->value()); |
+ return AssignEnvironment(new(zone()) LCheckSmi(value)); |
+} |
+ |
+ |
+LInstruction* LChunkBuilder::DoIsNumberAndBranch(HIsNumberAndBranch* instr) { |
+ return new(zone()) |
+ LIsNumberAndBranch(UseRegisterOrConstantAtStart(instr->value())); |
+} |
+ |
+ |
LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { |
LOperand* value = UseRegisterAtStart(instr->value()); |
LOperand* temp = TempRegister(); |