v8/test/cctest/interpreter/bytecode_expectations/BasicLoops.golden
mythria 2fefc4827e [Interpreter] Pops the context to the correct level on return.
We need to pop the context to correct level on return as well. This was incorrectly
removed in this cl: https://codereview.chromium.org/1768123002/. For example
when we have a try-catch-finally block and catch does a return, the return
does not happen immediately. It should execute finally block before it
returns. Return statement should pop the context to the correct level as
expected by finally block.

BUG=594369,v8:4280
LOG=N

Review URL: https://codereview.chromium.org/1796893002

Cr-Commit-Position: refs/heads/master@{#34822}
2016-03-16 15:52:53 +00:00

861 lines
14 KiB
Plaintext

#
# Autogenerated by generate-bytecode-expectations.
#
---
pool type: mixed
execute: yes
wrap: yes
---
snippet: "
var x = 0;
while (false) { x = 99; break; continue; }
return x;
"
frame size: 1
parameter count: 1
bytecode array length: 5
bytecodes: [
B(StackCheck),
B(LdaZero),
B(Star), R(0),
B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0;
while (false) {
x = x + 1;
};
return x;
"
frame size: 1
parameter count: 1
bytecode array length: 5
bytecodes: [
B(StackCheck),
B(LdaZero),
B(Star), R(0),
B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0;
var y = 1;
while (x < 10) {
y = y * 12;
x = x + 1;
if (x == 3) continue;
if (x == 4) break;
}
return y;
"
frame size: 3
parameter count: 1
bytecode array length: 66
bytecodes: [
B(StackCheck),
B(LdaZero),
B(Star), R(0),
B(LdaSmi8), U8(1),
B(Star), R(1),
B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi8), U8(10),
B(TestLessThan), R(2),
B(JumpIfFalse), U8(47),
B(StackCheck),
B(Ldar), R(1),
B(Star), R(2),
B(LdaSmi8), U8(12),
B(Mul), R(2),
B(Star), R(1),
B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi8), U8(1),
B(Add), R(2),
B(Star), R(0),
B(Star), R(2),
B(LdaSmi8), U8(3),
B(TestEqual), R(2),
B(JumpIfFalse), U8(4),
B(Jump), U8(-39),
B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi8), U8(4),
B(TestEqual), R(2),
B(JumpIfFalse), U8(4),
B(Jump), U8(4),
B(Jump), U8(-53),
B(Ldar), R(1),
B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var i = 0;
while (true) {
if (i < 0) continue;
if (i == 3) break;
if (i == 4) break;
if (i == 10) continue;
if (i == 5) break;
i = i + 1;
}
return i;
"
frame size: 2
parameter count: 1
bytecode array length: 79
bytecodes: [
B(StackCheck),
B(LdaZero),
B(Star), R(0),
B(StackCheck),
B(Ldar), R(0),
B(Star), R(1),
B(LdaZero),
B(TestLessThan), R(1),
B(JumpIfFalse), U8(4),
B(Jump), U8(-10),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(3),
B(TestEqual), R(1),
B(JumpIfFalse), U8(4),
B(Jump), U8(50),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(4),
B(TestEqual), R(1),
B(JumpIfFalse), U8(4),
B(Jump), U8(38),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(10),
B(TestEqual), R(1),
B(JumpIfFalse), U8(4),
B(Jump), U8(-46),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(5),
B(TestEqual), R(1),
B(JumpIfFalse), U8(4),
B(Jump), U8(14),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(1),
B(Add), R(1),
B(Star), R(0),
B(Jump), U8(-70),
B(Ldar), R(0),
B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var i = 0;
while (true) {
while (i < 3) {
if (i == 2) break;
i = i + 1;
}
i = i + 1;
break;
}
return i;
"
frame size: 2
parameter count: 1
bytecode array length: 57
bytecodes: [
B(StackCheck),
B(LdaZero),
B(Star), R(0),
B(StackCheck),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(3),
B(TestLessThan), R(1),
B(JumpIfFalse), U8(27),
B(StackCheck),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(2),
B(TestEqual), R(1),
B(JumpIfFalse), U8(4),
B(Jump), U8(14),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(1),
B(Add), R(1),
B(Star), R(0),
B(Jump), U8(-33),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(1),
B(Add), R(1),
B(Star), R(0),
B(Jump), U8(4),
B(Jump), U8(-48),
B(Ldar), R(0),
B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 10;
var y = 1;
while (x) {
y = y * 12;
x = x - 1;
}
return y;
"
frame size: 3
parameter count: 1
bytecode array length: 39
bytecodes: [
B(StackCheck),
B(LdaSmi8), U8(10),
B(Star), R(0),
B(LdaSmi8), U8(1),
B(Star), R(1),
B(Ldar), R(0),
B(JumpIfToBooleanFalse), U8(25),
B(StackCheck),
B(Ldar), R(1),
B(Star), R(2),
B(LdaSmi8), U8(12),
B(Mul), R(2),
B(Star), R(1),
B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi8), U8(1),
B(Sub), R(2),
B(Star), R(0),
B(Jump), U8(-25),
B(Ldar), R(1),
B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0; var y = 1;
do {
y = y * 10;
if (x == 5) break;
if (x == 6) continue;
x = x + 1;
} while (x < 10);
return y;
"
frame size: 3
parameter count: 1
bytecode array length: 66
bytecodes: [
B(StackCheck),
B(LdaZero),
B(Star), R(0),
B(LdaSmi8), U8(1),
B(Star), R(1),
B(StackCheck),
B(Ldar), R(1),
B(Star), R(2),
B(LdaSmi8), U8(10),
B(Mul), R(2),
B(Star), R(1),
B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi8), U8(5),
B(TestEqual), R(2),
B(JumpIfFalse), U8(4),
B(Jump), U8(34),
B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi8), U8(6),
B(TestEqual), R(2),
B(JumpIfFalse), U8(4),
B(Jump), U8(12),
B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi8), U8(1),
B(Add), R(2),
B(Star), R(0),
B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi8), U8(10),
B(TestLessThan), R(2),
B(JumpIfTrue), U8(-53),
B(Ldar), R(1),
B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 10;
var y = 1;
do {
y = y * 12;
x = x - 1;
} while (x);
return y;
"
frame size: 3
parameter count: 1
bytecode array length: 37
bytecodes: [
B(StackCheck),
B(LdaSmi8), U8(10),
B(Star), R(0),
B(LdaSmi8), U8(1),
B(Star), R(1),
B(StackCheck),
B(Ldar), R(1),
B(Star), R(2),
B(LdaSmi8), U8(12),
B(Mul), R(2),
B(Star), R(1),
B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi8), U8(1),
B(Sub), R(2),
B(Star), R(0),
B(Ldar), R(0),
B(JumpIfToBooleanTrue), U8(-23),
B(Ldar), R(1),
B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0; var y = 1;
do {
y = y * 10;
if (x == 5) break;
x = x + 1;
if (x == 6) continue;
} while (false);
return y;
"
frame size: 3
parameter count: 1
bytecode array length: 54
bytecodes: [
B(StackCheck),
B(LdaZero),
B(Star), R(0),
B(LdaSmi8), U8(1),
B(Star), R(1),
B(StackCheck),
B(Ldar), R(1),
B(Star), R(2),
B(LdaSmi8), U8(10),
B(Mul), R(2),
B(Star), R(1),
B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi8), U8(5),
B(TestEqual), R(2),
B(JumpIfFalse), U8(4),
B(Jump), U8(22),
B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi8), U8(1),
B(Add), R(2),
B(Star), R(0),
B(Star), R(2),
B(LdaSmi8), U8(6),
B(TestEqual), R(2),
B(JumpIfFalse), U8(4),
B(Jump), U8(2),
B(Ldar), R(1),
B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0; var y = 1;
do {
y = y * 10;
if (x == 5) break;
x = x + 1;
if (x == 6) continue;
} while (true);
return y;
"
frame size: 3
parameter count: 1
bytecode array length: 56
bytecodes: [
B(StackCheck),
B(LdaZero),
B(Star), R(0),
B(LdaSmi8), U8(1),
B(Star), R(1),
B(StackCheck),
B(Ldar), R(1),
B(Star), R(2),
B(LdaSmi8), U8(10),
B(Mul), R(2),
B(Star), R(1),
B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi8), U8(5),
B(TestEqual), R(2),
B(JumpIfFalse), U8(4),
B(Jump), U8(24),
B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi8), U8(1),
B(Add), R(2),
B(Star), R(0),
B(Star), R(2),
B(LdaSmi8), U8(6),
B(TestEqual), R(2),
B(JumpIfFalse), U8(4),
B(Jump), U8(-41),
B(Jump), U8(-43),
B(Ldar), R(1),
B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0;
for (;;) {
if (x == 1) break;
if (x == 2) continue;
x = x + 1;
}
"
frame size: 2
parameter count: 1
bytecode array length: 43
bytecodes: [
B(StackCheck),
B(LdaZero),
B(Star), R(0),
B(StackCheck),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(1),
B(TestEqual), R(1),
B(JumpIfFalse), U8(4),
B(Jump), U8(26),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(2),
B(TestEqual), R(1),
B(JumpIfFalse), U8(4),
B(Jump), U8(-23),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(1),
B(Add), R(1),
B(Star), R(0),
B(Jump), U8(-35),
B(LdaUndefined),
B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
for (var x = 0;;) {
if (x == 1) break;
if (x == 2) continue;
x = x + 1;
}
"
frame size: 2
parameter count: 1
bytecode array length: 43
bytecodes: [
B(StackCheck),
B(LdaZero),
B(Star), R(0),
B(StackCheck),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(1),
B(TestEqual), R(1),
B(JumpIfFalse), U8(4),
B(Jump), U8(26),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(2),
B(TestEqual), R(1),
B(JumpIfFalse), U8(4),
B(Jump), U8(-23),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(1),
B(Add), R(1),
B(Star), R(0),
B(Jump), U8(-35),
B(LdaUndefined),
B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0;
for (;; x = x + 1) {
if (x == 1) break;
if (x == 2) continue;
}
"
frame size: 2
parameter count: 1
bytecode array length: 43
bytecodes: [
B(StackCheck),
B(LdaZero),
B(Star), R(0),
B(StackCheck),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(1),
B(TestEqual), R(1),
B(JumpIfFalse), U8(4),
B(Jump), U8(26),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(2),
B(TestEqual), R(1),
B(JumpIfFalse), U8(4),
B(Jump), U8(2),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(1),
B(Add), R(1),
B(Star), R(0),
B(Jump), U8(-35),
B(LdaUndefined),
B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
for (var x = 0;; x = x + 1) {
if (x == 1) break;
if (x == 2) continue;
}
"
frame size: 2
parameter count: 1
bytecode array length: 43
bytecodes: [
B(StackCheck),
B(LdaZero),
B(Star), R(0),
B(StackCheck),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(1),
B(TestEqual), R(1),
B(JumpIfFalse), U8(4),
B(Jump), U8(26),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(2),
B(TestEqual), R(1),
B(JumpIfFalse), U8(4),
B(Jump), U8(2),
B(Ldar), R(0),
B(Star), R(1),
B(LdaSmi8), U8(1),
B(Add), R(1),
B(Star), R(0),
B(Jump), U8(-35),
B(LdaUndefined),
B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var u = 0;
for (var i = 0; i < 100; i = i + 1) {
u = u + 1;
continue;
}
"
frame size: 3
parameter count: 1
bytecode array length: 44
bytecodes: [
B(StackCheck),
B(LdaZero),
B(Star), R(0),
B(LdaZero),
B(Star), R(1),
B(Ldar), R(1),
B(Star), R(2),
B(LdaSmi8), U8(100),
B(TestLessThan), R(2),
B(JumpIfFalse), U8(27),
B(StackCheck),
B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi8), U8(1),
B(Add), R(2),
B(Star), R(0),
B(Jump), U8(2),
B(Ldar), R(1),
B(Star), R(2),
B(LdaSmi8), U8(1),
B(Add), R(2),
B(Star), R(1),
B(Jump), U8(-33),
B(LdaUndefined),
B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var y = 1;
for (var x = 10; x; --x) {
y = y * 12;
}
return y;
"
frame size: 3
parameter count: 1
bytecode array length: 35
bytecodes: [
B(StackCheck),
B(LdaSmi8), U8(1),
B(Star), R(0),
B(LdaSmi8), U8(10),
B(Star), R(1),
B(Ldar), R(1),
B(JumpIfToBooleanFalse), U8(21),
B(StackCheck),
B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi8), U8(12),
B(Mul), R(2),
B(Star), R(0),
B(Ldar), R(1),
B(ToNumber),
B(Dec),
B(Star), R(1),
B(Jump), U8(-21),
B(Ldar), R(0),
B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0;
for (var i = 0; false; i++) {
x = x + 1;
};
return x;
"
frame size: 2
parameter count: 1
bytecode array length: 10
bytecodes: [
B(StackCheck),
B(LdaZero),
B(Star), R(0),
B(LdaZero),
B(Star), R(1),
B(Ldar), R(0),
B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var x = 0;
for (var i = 0; true; ++i) {
x = x + 1;
if (x == 20) break;
};
return x;
"
frame size: 3
parameter count: 1
bytecode array length: 39
bytecodes: [
B(StackCheck),
B(LdaZero),
B(Star), R(0),
B(LdaZero),
B(Star), R(1),
B(StackCheck),
B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi8), U8(1),
B(Add), R(2),
B(Star), R(0),
B(Star), R(2),
B(LdaSmi8), U8(20),
B(TestEqual), R(2),
B(JumpIfFalse), U8(4),
B(Jump), U8(10),
B(Ldar), R(1),
B(ToNumber),
B(Inc),
B(Star), R(1),
B(Jump), U8(-27),
B(Ldar), R(0),
B(Return),
]
constant pool: [
]
handlers: [
]
---
snippet: "
var a = 0;
while (a) {
{
let z = 1;
function f() { z = 2; }
if (z) continue;
z++;
}
}
"
frame size: 7
parameter count: 1
bytecode array length: 120
bytecodes: [
B(StackCheck),
B(LdaZero),
B(Star), R(1),
B(Ldar), R(1),
B(JumpIfToBooleanFalse), U8(112),
B(StackCheck),
B(LdaConstant), U8(0),
B(Star), R(4),
B(Ldar), R(closure),
B(Star), R(5),
B(CallRuntime), U16(Runtime::kPushBlockContext), R(4), U8(2),
B(PushContext), R(3),
B(LdaTheHole),
B(StaContextSlot), R(context), U8(4),
B(CreateClosure), U8(1), U8(0),
B(Star), R(0),
B(LdaSmi8), U8(1),
B(StaContextSlot), R(context), U8(4),
B(Ldar), R(0),
B(JumpIfNotHole), U8(11),
B(LdaConstant), U8(2),
B(Star), R(4),
B(CallRuntime), U16(Runtime::kThrowReferenceError), R(4), U8(1),
B(Star), R(2),
B(LdaContextSlot), R(context), U8(4),
B(JumpIfNotHole), U8(11),
B(LdaConstant), U8(3),
B(Star), R(4),
B(CallRuntime), U16(Runtime::kThrowReferenceError), R(4), U8(1),
B(JumpIfToBooleanFalse), U8(8),
B(PopContext), R(3),
B(PopContext), R(3),
B(Jump), U8(-69),
B(LdaContextSlot), R(context), U8(4),
B(JumpIfNotHole), U8(11),
B(LdaConstant), U8(3),
B(Star), R(4),
B(CallRuntime), U16(Runtime::kThrowReferenceError), R(4), U8(1),
B(ToNumber),
B(Star), R(4),
B(Inc),
B(Star), R(5),
B(LdaContextSlot), R(context), U8(4),
B(JumpIfNotHole), U8(11),
B(LdaConstant), U8(3),
B(Star), R(6),
B(CallRuntime), U16(Runtime::kThrowReferenceError), R(6), U8(1),
B(Ldar), R(5),
B(StaContextSlot), R(context), U8(4),
B(PopContext), R(3),
B(Jump), U8(-112),
B(LdaUndefined),
B(Return),
]
constant pool: [
InstanceType::FIXED_ARRAY_TYPE,
InstanceType::SHARED_FUNCTION_INFO_TYPE,
InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE,
InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE,
]
handlers: [
]