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

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

Issue 1144133003: Add constants for FrameState input parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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/compiler/frame-states.h ('k') | src/compiler/js-typed-lowering.cc » ('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 1d2552e3915eb33f23d3eef38b5bc84fc821e9b0..43f5297a941713daeb51d485f8464be0a450b34f 100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -1028,19 +1028,24 @@ void InstructionSelector::VisitThrow(Node* value) {
FrameStateDescriptor* InstructionSelector::GetFrameStateDescriptor(
Node* state) {
DCHECK(state->opcode() == IrOpcode::kFrameState);
- DCHECK_EQ(6, state->InputCount());
- DCHECK_EQ(IrOpcode::kTypedStateValues, state->InputAt(0)->opcode());
- DCHECK_EQ(IrOpcode::kTypedStateValues, state->InputAt(1)->opcode());
- DCHECK_EQ(IrOpcode::kTypedStateValues, state->InputAt(2)->opcode());
+ DCHECK_EQ(kFrameStateInputCount, state->InputCount());
+ DCHECK_EQ(IrOpcode::kTypedStateValues,
+ state->InputAt(kFrameStateParametersInput)->opcode());
+ DCHECK_EQ(IrOpcode::kTypedStateValues,
+ state->InputAt(kFrameStateLocalsInput)->opcode());
+ DCHECK_EQ(IrOpcode::kTypedStateValues,
+ state->InputAt(kFrameStateStackInput)->opcode());
FrameStateCallInfo state_info = OpParameter<FrameStateCallInfo>(state);
- int parameters =
- static_cast<int>(StateValuesAccess(state->InputAt(0)).size());
- int locals = static_cast<int>(StateValuesAccess(state->InputAt(1)).size());
- int stack = static_cast<int>(StateValuesAccess(state->InputAt(2)).size());
+ int parameters = static_cast<int>(
+ StateValuesAccess(state->InputAt(kFrameStateParametersInput)).size());
+ int locals = static_cast<int>(
+ StateValuesAccess(state->InputAt(kFrameStateLocalsInput)).size());
+ int stack = static_cast<int>(
+ StateValuesAccess(state->InputAt(kFrameStateStackInput)).size());
FrameStateDescriptor* outer_state = NULL;
- Node* outer_node = state->InputAt(5);
+ Node* outer_node = state->InputAt(kFrameStateOuterStateInput);
if (outer_node->opcode() == IrOpcode::kFrameState) {
outer_state = GetFrameStateDescriptor(outer_node);
}
@@ -1070,14 +1075,15 @@ void InstructionSelector::AddFrameStateInputs(
DCHECK_EQ(IrOpcode::kFrameState, state->op()->opcode());
if (descriptor->outer_state()) {
- AddFrameStateInputs(state->InputAt(5), inputs, descriptor->outer_state());
+ AddFrameStateInputs(state->InputAt(kFrameStateOuterStateInput), inputs,
+ descriptor->outer_state());
}
- Node* parameters = state->InputAt(0);
- Node* locals = state->InputAt(1);
- Node* stack = state->InputAt(2);
- Node* context = state->InputAt(3);
- Node* function = state->InputAt(4);
+ Node* parameters = state->InputAt(kFrameStateParametersInput);
+ Node* locals = state->InputAt(kFrameStateLocalsInput);
+ Node* stack = state->InputAt(kFrameStateStackInput);
+ Node* context = state->InputAt(kFrameStateContextInput);
+ Node* function = state->InputAt(kFrameStateFunctionInput);
DCHECK_EQ(IrOpcode::kTypedStateValues, parameters->op()->opcode());
DCHECK_EQ(IrOpcode::kTypedStateValues, locals->op()->opcode());
« no previous file with comments | « src/compiler/frame-states.h ('k') | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698