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

Unified Diff: src/hydrogen-escape-analysis.cc

Issue 251493004: Preserve Smi representation of non-escaping fields. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 | « no previous file | src/hydrogen-instructions.h » ('j') | src/hydrogen-instructions.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-escape-analysis.cc
diff --git a/src/hydrogen-escape-analysis.cc b/src/hydrogen-escape-analysis.cc
index 102301992333e1c9a994d0d7b051577869ac89fa..095c675ebccb09b9771edd2b196069f831976e1d 100644
--- a/src/hydrogen-escape-analysis.cc
+++ b/src/hydrogen-escape-analysis.cc
@@ -196,11 +196,20 @@ void HEscapeAnalysisPhase::AnalyzeDataFlow(HInstruction* allocate) {
int index = load->access().offset() / kPointerSize;
if (load->object() != allocate) continue;
ASSERT(load->access().IsInobject());
- HValue* replacement = state->OperandAt(index);
+ HValue* load_value = state->OperandAt(index);
+ HValue* replacement = load_value;
+ Representation representation = load->representation();
+ if (representation.IsSmi()) {
Michael Starzinger 2014/04/25 08:35:10 Can we factor this out into a NewLoadReplacement h
Jarin 2014/04/25 11:05:07 Done.
+ Zone* zone = graph()->zone();
+ HInstruction* new_instr =
+ new(zone) HForceRepresentation(load_value, representation);
+ new_instr->InsertAfter(load);
+ replacement = new_instr;
+ }
load->DeleteAndReplaceWith(replacement);
if (FLAG_trace_escape_analysis) {
PrintF("Replacing load #%d with #%d (%s)\n", instr->id(),
- replacement->id(), replacement->Mnemonic());
+ load_value->id(), load_value->Mnemonic());
Michael Starzinger 2014/04/25 08:35:10 nit: The logging should print the actual replaceme
Jarin 2014/04/25 11:05:07 Done.
}
break;
}
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | src/hydrogen-instructions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698