| Index: src/x64/lithium-x64.cc
|
| diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc
|
| index 9d99e91d721b54832f90315072d3f8cd8033ba6b..f766ba47624518537ba3dba11f2d58ee16f9123b 100644
|
| --- a/src/x64/lithium-x64.cc
|
| +++ b/src/x64/lithium-x64.cc
|
| @@ -1804,26 +1804,21 @@ LInstruction* LChunkBuilder::DoForceRepresentation(HForceRepresentation* bad) {
|
| LInstruction* LChunkBuilder::DoChange(HChange* instr) {
|
| Representation from = instr->from();
|
| Representation to = instr->to();
|
| + HValue* val = instr->value();
|
| if (from.IsSmi()) {
|
| if (to.IsTagged()) {
|
| - LOperand* value = UseRegister(instr->value());
|
| + LOperand* value = UseRegister(val);
|
| return DefineSameAsFirst(new(zone()) LDummyUse(value));
|
| }
|
| from = Representation::Tagged();
|
| }
|
| - // Only mark conversions that might need to allocate as calling rather than
|
| - // all changes. This makes simple, non-allocating conversion not have to force
|
| - // building a stack frame.
|
| if (from.IsTagged()) {
|
| if (to.IsDouble()) {
|
| - LOperand* value = UseRegister(instr->value());
|
| - LInstruction* res = DefineAsRegister(new(zone()) LNumberUntagD(value));
|
| - if (!instr->value()->representation().IsSmi()) {
|
| - res = AssignEnvironment(res);
|
| - }
|
| - return res;
|
| + LOperand* value = UseRegister(val);
|
| + LInstruction* result = DefineAsRegister(new(zone()) LNumberUntagD(value));
|
| + if (!val->representation().IsSmi()) result = AssignEnvironment(result);
|
| + return result;
|
| } else if (to.IsSmi()) {
|
| - HValue* val = instr->value();
|
| LOperand* value = UseRegister(val);
|
| if (val->type().IsSmi()) {
|
| return DefineSameAsFirst(new(zone()) LDummyUse(value));
|
| @@ -1831,78 +1826,73 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) {
|
| return AssignEnvironment(DefineSameAsFirst(new(zone()) LCheckSmi(value)));
|
| } else {
|
| ASSERT(to.IsInteger32());
|
| - HValue* val = instr->value();
|
| - LOperand* value = UseRegister(val);
|
| if (val->type().IsSmi() || val->representation().IsSmi()) {
|
| + LOperand* value = UseRegister(val);
|
| return DefineSameAsFirst(new(zone()) LSmiUntag(value, false));
|
| } else {
|
| + LOperand* value = UseRegister(val);
|
| bool truncating = instr->CanTruncateToInt32();
|
| LOperand* xmm_temp = truncating ? NULL : FixedTemp(xmm1);
|
| - LInstruction* res =
|
| + LInstruction* result =
|
| DefineSameAsFirst(new(zone()) LTaggedToI(value, xmm_temp));
|
| - if (!instr->value()->representation().IsSmi()) {
|
| + if (!val->representation().IsSmi()) {
|
| // Note: Only deopts in deferred code.
|
| - res = AssignEnvironment(res);
|
| + result = AssignEnvironment(result);
|
| }
|
| - return res;
|
| + return result;
|
| }
|
| }
|
| } else if (from.IsDouble()) {
|
| if (to.IsTagged()) {
|
| info()->MarkAsDeferredCalling();
|
| - LOperand* value = UseRegister(instr->value());
|
| + LOperand* value = UseRegister(val);
|
| LOperand* temp = TempRegister();
|
| -
|
| - // Make sure that temp and result_temp are different registers.
|
| LUnallocated* result_temp = TempRegister();
|
| LNumberTagD* result = new(zone()) LNumberTagD(value, temp);
|
| return AssignPointerMap(Define(result, result_temp));
|
| } else if (to.IsSmi()) {
|
| - LOperand* value = UseRegister(instr->value());
|
| + LOperand* value = UseRegister(val);
|
| return AssignEnvironment(
|
| DefineAsRegister(new(zone()) LDoubleToSmi(value)));
|
| } else {
|
| ASSERT(to.IsInteger32());
|
| - LOperand* value = UseRegister(instr->value());
|
| + LOperand* value = UseRegister(val);
|
| LInstruction* result = DefineAsRegister(new(zone()) LDoubleToI(value));
|
| - if (!instr->CanTruncateToInt32()) {
|
| - result = AssignEnvironment(result);
|
| - }
|
| + if (!instr->CanTruncateToInt32()) result = AssignEnvironment(result);
|
| return result;
|
| }
|
| } else if (from.IsInteger32()) {
|
| info()->MarkAsDeferredCalling();
|
| if (to.IsTagged()) {
|
| - HValue* val = instr->value();
|
| - LOperand* value = UseRegister(val);
|
| if (!instr->CheckFlag(HValue::kCanOverflow)) {
|
| + LOperand* value = UseRegister(val);
|
| return DefineAsRegister(new(zone()) LSmiTag(value));
|
| } else if (val->CheckFlag(HInstruction::kUint32)) {
|
| + LOperand* value = UseRegister(val);
|
| LOperand* temp1 = TempRegister();
|
| LOperand* temp2 = FixedTemp(xmm1);
|
| LNumberTagU* result = new(zone()) LNumberTagU(value, temp1, temp2);
|
| return AssignPointerMap(DefineSameAsFirst(result));
|
| } else {
|
| + LOperand* value = UseRegister(val);
|
| LNumberTagI* result = new(zone()) LNumberTagI(value);
|
| return AssignPointerMap(DefineSameAsFirst(result));
|
| }
|
| } else if (to.IsSmi()) {
|
| - HValue* val = instr->value();
|
| LOperand* value = UseRegister(val);
|
| LInstruction* result = DefineAsRegister(new(zone()) LSmiTag(value));
|
| if (instr->CheckFlag(HValue::kCanOverflow)) {
|
| - ASSERT(val->CheckFlag(HValue::kUint32));
|
| result = AssignEnvironment(result);
|
| }
|
| return result;
|
| } else {
|
| - if (instr->value()->CheckFlag(HInstruction::kUint32)) {
|
| + ASSERT(to.IsDouble());
|
| + if (val->CheckFlag(HInstruction::kUint32)) {
|
| LOperand* temp = FixedTemp(xmm1);
|
| return DefineAsRegister(
|
| - new(zone()) LUint32ToDouble(UseRegister(instr->value()), temp));
|
| + new(zone()) LUint32ToDouble(UseRegister(val), temp));
|
| } else {
|
| - ASSERT(to.IsDouble());
|
| - LOperand* value = Use(instr->value());
|
| + LOperand* value = Use(val);
|
| return DefineAsRegister(new(zone()) LInteger32ToDouble(value));
|
| }
|
| }
|
|
|