| Index: src/arm64/lithium-arm64.cc
|
| diff --git a/src/arm64/lithium-arm64.cc b/src/arm64/lithium-arm64.cc
|
| index 02127066536aa8dead082292d77f04a50b4f21de..6f60e8ae0d7b7f436a7800155d59326fd9b81b32 100644
|
| --- a/src/arm64/lithium-arm64.cc
|
| +++ b/src/arm64/lithium-arm64.cc
|
| @@ -375,7 +375,12 @@ LUnallocated* LChunkBuilder::ToUnallocated(DoubleRegister reg) {
|
| LOperand* LChunkBuilder::Use(HValue* value, LUnallocated* operand) {
|
| if (value->EmitAtUses()) {
|
| HInstruction* instr = HInstruction::cast(value);
|
| - VisitInstruction(instr);
|
| + if (value->IsConstant() && IsCachedConstant(HConstant::cast(value),
|
| + current_block_)) {
|
| + // We will reuse the cached value.
|
| + } else {
|
| + VisitInstruction(instr);
|
| + }
|
| }
|
| operand->set_virtual_register(value->id());
|
| return operand;
|
| @@ -586,7 +591,13 @@ void LChunkBuilder::DoBasicBlock(HBasicBlock* block) {
|
| ASSERT(is_building());
|
| current_block_ = block;
|
|
|
| + if (graph()->has_osr() &&
|
| + (block == graph()->osr()->osr_entry())) {
|
| + constant_cache_.Clear();
|
| + }
|
| +
|
| if (block->IsStartBlock()) {
|
| + constant_cache_.Clear();
|
| block->UpdateEnvironment(graph_->start_environment());
|
| argument_count_ = 0;
|
| } else if (block->predecessors()->length() == 1) {
|
| @@ -1328,6 +1339,7 @@ LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) {
|
|
|
|
|
| LInstruction* LChunkBuilder::DoConstant(HConstant* instr) {
|
| + CacheConstant(instr, current_block_);
|
| Representation r = instr->representation();
|
| if (r.IsSmi()) {
|
| return DefineAsRegister(new(zone()) LConstantS);
|
|
|