| Index: src/arm64/lithium-arm64.cc
|
| diff --git a/src/arm64/lithium-arm64.cc b/src/arm64/lithium-arm64.cc
|
| index 6f60e8ae0d7b7f436a7800155d59326fd9b81b32..671b5c3070ca1691586f5b8e5271911437637b48 100644
|
| --- a/src/arm64/lithium-arm64.cc
|
| +++ b/src/arm64/lithium-arm64.cc
|
| @@ -373,14 +373,14 @@ LUnallocated* LChunkBuilder::ToUnallocated(DoubleRegister reg) {
|
|
|
|
|
| LOperand* LChunkBuilder::Use(HValue* value, LUnallocated* operand) {
|
| - if (value->EmitAtUses()) {
|
| + LInstruction* l_instr;
|
| + if (value->IsConstant() &&
|
| + (l_instr = CachedLInstructionFor(HConstant::cast(value),
|
| + current_block_))) {
|
| + operand->set_parent_linstr(l_instr);
|
| + } else if (value->EmitAtUses()) {
|
| HInstruction* instr = HInstruction::cast(value);
|
| - if (value->IsConstant() && IsCachedConstant(HConstant::cast(value),
|
| - current_block_)) {
|
| - // We will reuse the cached value.
|
| - } else {
|
| - VisitInstruction(instr);
|
| - }
|
| + VisitInstruction(instr);
|
| }
|
| operand->set_virtual_register(value->id());
|
| return operand;
|
| @@ -439,6 +439,7 @@ LOperand* LChunkBuilder::UseAny(HValue* value) {
|
|
|
| LInstruction* LChunkBuilder::Define(LTemplateResultInstruction<1>* instr,
|
| LUnallocated* result) {
|
| + result->set_parent_linstr(instr);
|
| result->set_virtual_register(current_instruction_->id());
|
| instr->set_result(result);
|
| return instr;
|
| @@ -1339,22 +1340,24 @@ LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) {
|
|
|
|
|
| LInstruction* LChunkBuilder::DoConstant(HConstant* instr) {
|
| - CacheConstant(instr, current_block_);
|
| + LInstruction* res;
|
| Representation r = instr->representation();
|
| if (r.IsSmi()) {
|
| - return DefineAsRegister(new(zone()) LConstantS);
|
| + res = DefineAsRegister(new(zone()) LConstantS);
|
| } else if (r.IsInteger32()) {
|
| - return DefineAsRegister(new(zone()) LConstantI);
|
| + res = DefineAsRegister(new(zone()) LConstantI);
|
| } else if (r.IsDouble()) {
|
| - return DefineAsRegister(new(zone()) LConstantD);
|
| + res = DefineAsRegister(new(zone()) LConstantD);
|
| } else if (r.IsExternal()) {
|
| - return DefineAsRegister(new(zone()) LConstantE);
|
| + res = DefineAsRegister(new(zone()) LConstantE);
|
| } else if (r.IsTagged()) {
|
| - return DefineAsRegister(new(zone()) LConstantT);
|
| + res = DefineAsRegister(new(zone()) LConstantT);
|
| } else {
|
| UNREACHABLE();
|
| - return NULL;
|
| + res = NULL;
|
| }
|
| + CacheConstant(instr, res, current_block_);
|
| + return res;
|
| }
|
|
|
|
|
|
|