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

Unified Diff: src/compiler/instruction-selector.cc

Issue 534573002: Reland "Make FrameStates recursive (to be used for inlining).". (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase. 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/instruction.h ('k') | src/compiler/instruction-selector-impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-selector.cc
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc
index fea6141423de70314820de248667c6d5d4f0397d..4b5552d9e7e9bf8212b7c4ce29ddc642359a8b1f 100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -1006,15 +1006,21 @@ void InstructionSelector::VisitThrow(Node* value) {
FrameStateDescriptor* InstructionSelector::GetFrameStateDescriptor(
Node* state) {
- DCHECK(state->op()->opcode() == IrOpcode::kFrameState);
+ DCHECK(state->opcode() == IrOpcode::kFrameState);
+ DCHECK_EQ(5, state->InputCount());
FrameStateCallInfo state_info = OpParameter<FrameStateCallInfo>(state);
- Node* parameters = state->InputAt(0);
- Node* locals = state->InputAt(1);
- Node* stack = state->InputAt(2);
+ int parameters = OpParameter<int>(state->InputAt(0));
+ int locals = OpParameter<int>(state->InputAt(1));
+ int stack = OpParameter<int>(state->InputAt(2));
+
+ FrameStateDescriptor* outer_state = NULL;
+ Node* outer_node = state->InputAt(4);
+ if (outer_node->opcode() == IrOpcode::kFrameState) {
+ outer_state = GetFrameStateDescriptor(outer_node);
+ }
return new (instruction_zone())
- FrameStateDescriptor(state_info, OpParameter<int>(parameters),
- OpParameter<int>(locals), OpParameter<int>(stack));
+ FrameStateDescriptor(state_info, parameters, locals, stack, outer_state);
}
@@ -1036,6 +1042,10 @@ void InstructionSelector::AddFrameStateInputs(
FrameStateDescriptor* descriptor) {
DCHECK_EQ(IrOpcode::kFrameState, state->op()->opcode());
+ if (descriptor->outer_state() != NULL) {
+ AddFrameStateInputs(state->InputAt(4), inputs, descriptor->outer_state());
+ }
+
Node* parameters = state->InputAt(0);
Node* locals = state->InputAt(1);
Node* stack = state->InputAt(2);
« no previous file with comments | « src/compiler/instruction.h ('k') | src/compiler/instruction-selector-impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698