Commit 57981a48 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[interpreter] Remove duped control scope in ForOfStatement.

This removes a duplicate control scope. The visitor for ForOfStatement
nodes in the AST uses VisitIterationBody which pushes a separate control
scope. The number of control scopes will be off when we use them for
tracking loop depths.

R=rmcilroy@chromium.org

Review-Url: https://codereview.chromium.org/2164503005
Cr-Commit-Position: refs/heads/master@{#37930}
parent 66cb026f
...@@ -1166,7 +1166,6 @@ void BytecodeGenerator::VisitForInStatement(ForInStatement* stmt) { ...@@ -1166,7 +1166,6 @@ void BytecodeGenerator::VisitForInStatement(ForInStatement* stmt) {
void BytecodeGenerator::VisitForOfStatement(ForOfStatement* stmt) { void BytecodeGenerator::VisitForOfStatement(ForOfStatement* stmt) {
LoopBuilder loop_builder(builder()); LoopBuilder loop_builder(builder());
ControlScopeForIteration control_scope(this, stmt, &loop_builder);
builder()->SetExpressionAsStatementPosition(stmt->assign_iterator()); builder()->SetExpressionAsStatementPosition(stmt->assign_iterator());
VisitForEffect(stmt->assign_iterator()); VisitForEffect(stmt->assign_iterator());
......
...@@ -265,7 +265,7 @@ snippet: " ...@@ -265,7 +265,7 @@ snippet: "
" "
frame size: 18 frame size: 18
parameter count: 1 parameter count: 1
bytecode array length: 774 bytecode array length: 772
bytecodes: [ bytecodes: [
B(Ldar), R(new_target), B(Ldar), R(new_target),
B(JumpIfUndefined), U8(26), B(JumpIfUndefined), U8(26),
...@@ -399,10 +399,10 @@ bytecodes: [ ...@@ -399,10 +399,10 @@ bytecodes: [
B(Star), R(15), B(Star), R(15),
B(LdaZero), B(LdaZero),
B(TestEqualStrict), R(15), B(TestEqualStrict), R(15),
B(JumpIfTrue), U8(45), B(JumpIfTrue), U8(43),
B(LdaSmi), U8(2), B(LdaSmi), U8(2),
B(TestEqualStrict), R(15), B(TestEqualStrict), R(15),
B(JumpIfTrue), U8(36), B(JumpIfTrue), U8(34),
B(Jump), U8(2), B(Jump), U8(2),
B(LdaTrue), B(LdaTrue),
B(Star), R(17), B(Star), R(17),
...@@ -414,7 +414,6 @@ bytecodes: [ ...@@ -414,7 +414,6 @@ bytecodes: [
B(PopContext), R(2), B(PopContext), R(2),
B(PopContext), R(2), B(PopContext), R(2),
B(PopContext), R(2), B(PopContext), R(2),
B(PopContext), R(2),
B(Star), R(9), B(Star), R(9),
B(LdaZero), B(LdaZero),
B(Star), R(8), B(Star), R(8),
...@@ -425,7 +424,7 @@ bytecodes: [ ...@@ -425,7 +424,7 @@ bytecodes: [
B(PopContext), R(2), B(PopContext), R(2),
B(LdaZero), B(LdaZero),
B(StaContextSlot), R(1), U8(9), B(StaContextSlot), R(1), U8(9),
B(Wide), B(Jump), U16(-225), B(Wide), B(Jump), U16(-223),
B(Jump), U8(46), B(Jump), U8(46),
B(Star), R(13), B(Star), R(13),
B(LdaConstant), U8(11), B(LdaConstant), U8(11),
...@@ -600,9 +599,9 @@ constant pool: [ ...@@ -600,9 +599,9 @@ constant pool: [
kInstanceTypeDontCare, kInstanceTypeDontCare,
] ]
handlers: [ handlers: [
[44, 693, 699], [44, 691, 697],
[150, 447, 453], [150, 445, 451],
[153, 401, 403], [153, 399, 401],
[550, 562, 564], [548, 560, 562],
] ]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment