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

Unified Diff: src/compiler/code-generator.cc

Issue 517323002: Make FrameStates recursive (to be used for inlining). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: jarin's comments. Created 6 years, 3 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/compiler/code-generator.h ('k') | src/compiler/graph-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-generator.cc
diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc
index f85168e155669025594260f9f68501af87b5d618..8f034fcf17c89a5dd905f3dae7d321945358b9c5 100644
--- a/src/compiler/code-generator.cc
+++ b/src/compiler/code-generator.cc
@@ -301,11 +301,16 @@ FrameStateDescriptor* CodeGenerator::GetFrameStateDescriptor(
}
-int CodeGenerator::BuildTranslation(Instruction* instr, int frame_state_offset,
- OutputFrameStateCombine state_combine) {
- FrameStateDescriptor* descriptor =
- GetFrameStateDescriptor(instr, frame_state_offset);
- frame_state_offset++;
+void CodeGenerator::BuildTranslationForFrameStateDescriptor(
+ FrameStateDescriptor* descriptor, Instruction* instr,
+ Translation* translation, int frame_state_offset,
+ OutputFrameStateCombine state_combine) {
+ // Outer-most state must be added to translation first.
+ if (descriptor->outer_state() != NULL) {
+ BuildTranslationForFrameStateDescriptor(
+ descriptor->outer_state(), instr, translation,
+ frame_state_offset + descriptor->size(), kIgnoreOutput);
+ }
int height = descriptor->size() - descriptor->parameters_count();
switch (state_combine) {
@@ -316,24 +321,35 @@ int CodeGenerator::BuildTranslation(Instruction* instr, int frame_state_offset,
break;
}
-
- Translation translation(&translations_, 1, 1, zone());
- translation.BeginJSFrame(descriptor->bailout_id(),
- Translation::kSelfLiteralId, height);
+ translation->BeginJSFrame(descriptor->bailout_id(),
+ Translation::kSelfLiteralId, height);
for (int i = 0; i < descriptor->size(); i++) {
- AddTranslationForOperand(&translation, instr,
+ AddTranslationForOperand(translation, instr,
instr->InputAt(i + frame_state_offset));
}
switch (state_combine) {
case kPushOutput:
DCHECK(instr->OutputCount() == 1);
- AddTranslationForOperand(&translation, instr, instr->OutputAt(0));
+ AddTranslationForOperand(translation, instr, instr->OutputAt(0));
break;
case kIgnoreOutput:
break;
}
+}
+
+
+int CodeGenerator::BuildTranslation(Instruction* instr, int frame_state_offset,
+ OutputFrameStateCombine state_combine) {
+ FrameStateDescriptor* descriptor =
+ GetFrameStateDescriptor(instr, frame_state_offset);
+ frame_state_offset++;
+
+ int frame_count = descriptor->GetFrameCount();
+ Translation translation(&translations_, frame_count, frame_count, zone());
+ BuildTranslationForFrameStateDescriptor(descriptor, instr, &translation,
+ frame_state_offset, state_combine);
int deoptimization_id = static_cast<int>(deoptimization_states_.size());
« no previous file with comments | « src/compiler/code-generator.h ('k') | src/compiler/graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698