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

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

Issue 309373002: ARM64: Regenerate instead of spilling and restoring cheap lithium instructions. 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/arm64/lithium-gap-resolver-arm64.cc » ('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 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;
}
« no previous file with comments | « src/arm64/lithium-arm64.h ('k') | src/arm64/lithium-gap-resolver-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698