Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: src/arm64/lithium-arm64.cc

Issue 308313002: ARM64: Avoid regeneration of constants. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm64/lithium-arm64.h ('k') | src/hydrogen-osr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/arm64/lithium-arm64.h ('k') | src/hydrogen-osr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698