Merge V8 5.3.332.45. DO NOT MERGE
Test: Manual
FPIIM-449
Change-Id: Id3254828b068abdea3cb10442e0172a8c9a98e03
(cherry picked from commit 13e2dadd00298019ed862f2b2fc5068bba730bcf)
diff --git a/src/crankshaft/s390/lithium-s390.cc b/src/crankshaft/s390/lithium-s390.cc
index fbc1970..033484c 100644
--- a/src/crankshaft/s390/lithium-s390.cc
+++ b/src/crankshaft/s390/lithium-s390.cc
@@ -985,6 +985,10 @@
return DoMathAbs(instr);
case kMathLog:
return DoMathLog(instr);
+ case kMathCos:
+ return DoMathCos(instr);
+ case kMathSin:
+ return DoMathSin(instr);
case kMathExp:
return DoMathExp(instr);
case kMathSqrt:
@@ -1034,8 +1038,8 @@
LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) {
DCHECK(instr->representation().IsDouble());
DCHECK(instr->value()->representation().IsDouble());
- LOperand* input = UseFixedDouble(instr->value(), d1);
- return MarkAsCall(DefineFixedDouble(new (zone()) LMathLog(input), d1), instr);
+ LOperand* input = UseFixedDouble(instr->value(), d0);
+ return MarkAsCall(DefineFixedDouble(new (zone()) LMathLog(input), d0), instr);
}
LInstruction* LChunkBuilder::DoMathClz32(HUnaryMathOperation* instr) {
@@ -1044,15 +1048,25 @@
return DefineAsRegister(result);
}
+LInstruction* LChunkBuilder::DoMathCos(HUnaryMathOperation* instr) {
+ DCHECK(instr->representation().IsDouble());
+ DCHECK(instr->value()->representation().IsDouble());
+ LOperand* input = UseFixedDouble(instr->value(), d0);
+ return MarkAsCall(DefineFixedDouble(new (zone()) LMathCos(input), d0), instr);
+}
+
+LInstruction* LChunkBuilder::DoMathSin(HUnaryMathOperation* instr) {
+ DCHECK(instr->representation().IsDouble());
+ DCHECK(instr->value()->representation().IsDouble());
+ LOperand* input = UseFixedDouble(instr->value(), d0);
+ return MarkAsCall(DefineFixedDouble(new (zone()) LMathSin(input), d0), instr);
+}
+
LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) {
DCHECK(instr->representation().IsDouble());
DCHECK(instr->value()->representation().IsDouble());
- LOperand* input = UseRegister(instr->value());
- LOperand* temp1 = TempRegister();
- LOperand* temp2 = TempRegister();
- LOperand* double_temp = TempDoubleRegister();
- LMathExp* result = new (zone()) LMathExp(input, double_temp, temp1, temp2);
- return DefineAsRegister(result);
+ LOperand* input = UseFixedDouble(instr->value(), d0);
+ return MarkAsCall(DefineFixedDouble(new (zone()) LMathExp(input), d0), instr);
}
LInstruction* LChunkBuilder::DoMathSqrt(HUnaryMathOperation* instr) {
@@ -1779,12 +1793,6 @@
return DefineAsRegister(new (zone()) LDoubleBits(UseRegister(value)));
}
-LInstruction* LChunkBuilder::DoConstructDouble(HConstructDouble* instr) {
- LOperand* lo = UseRegister(instr->lo());
- LOperand* hi = UseRegister(instr->hi());
- return DefineAsRegister(new (zone()) LConstructDouble(hi, lo));
-}
-
LInstruction* LChunkBuilder::DoReturn(HReturn* instr) {
LOperand* context = info()->IsStub() ? UseFixed(instr->context(), cp) : NULL;
LOperand* parameter_count = UseRegisterOrConstant(instr->parameter_count());
@@ -1812,14 +1820,9 @@
LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) {
LOperand* context = UseFixed(instr->context(), cp);
- LOperand* global_object =
- UseFixed(instr->global_object(), LoadDescriptor::ReceiverRegister());
- LOperand* vector = NULL;
- if (instr->HasVectorAndSlot()) {
- vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
- }
- LLoadGlobalGeneric* result =
- new (zone()) LLoadGlobalGeneric(context, global_object, vector);
+ LOperand* vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
+
+ LLoadGlobalGeneric* result = new (zone()) LLoadGlobalGeneric(context, vector);
return MarkAsCall(DefineFixed(result, r2), instr);
}
@@ -1859,10 +1862,7 @@
LOperand* context = UseFixed(instr->context(), cp);
LOperand* object =
UseFixed(instr->object(), LoadDescriptor::ReceiverRegister());
- LOperand* vector = NULL;
- if (instr->HasVectorAndSlot()) {
- vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
- }
+ LOperand* vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
LInstruction* result =
DefineFixed(new (zone()) LLoadNamedGeneric(context, object, vector), r2);
@@ -1928,10 +1928,7 @@
LOperand* object =
UseFixed(instr->object(), LoadDescriptor::ReceiverRegister());
LOperand* key = UseFixed(instr->key(), LoadDescriptor::NameRegister());
- LOperand* vector = NULL;
- if (instr->HasVectorAndSlot()) {
- vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
- }
+ LOperand* vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
LInstruction* result = DefineFixed(
new (zone()) LLoadKeyedGeneric(context, object, key, vector), r2);
@@ -1988,12 +1985,8 @@
DCHECK(instr->key()->representation().IsTagged());
DCHECK(instr->value()->representation().IsTagged());
- LOperand* slot = NULL;
- LOperand* vector = NULL;
- if (instr->HasVectorAndSlot()) {
- slot = FixedTemp(VectorStoreICDescriptor::SlotRegister());
- vector = FixedTemp(VectorStoreICDescriptor::VectorRegister());
- }
+ LOperand* slot = FixedTemp(VectorStoreICDescriptor::SlotRegister());
+ LOperand* vector = FixedTemp(VectorStoreICDescriptor::VectorRegister());
LStoreKeyedGeneric* result =
new (zone()) LStoreKeyedGeneric(context, obj, key, val, slot, vector);
@@ -2076,13 +2069,8 @@
LOperand* obj =
UseFixed(instr->object(), StoreDescriptor::ReceiverRegister());
LOperand* val = UseFixed(instr->value(), StoreDescriptor::ValueRegister());
- LOperand* slot = NULL;
- LOperand* vector = NULL;
- if (instr->HasVectorAndSlot()) {
- slot = FixedTemp(VectorStoreICDescriptor::SlotRegister());
- vector = FixedTemp(VectorStoreICDescriptor::VectorRegister());
- }
-
+ LOperand* slot = FixedTemp(VectorStoreICDescriptor::SlotRegister());
+ LOperand* vector = FixedTemp(VectorStoreICDescriptor::VectorRegister());
LStoreNamedGeneric* result =
new (zone()) LStoreNamedGeneric(context, obj, val, slot, vector);
return MarkAsCall(result, instr);