Index: test/cctest/interpreter/bytecode_expectations/IfConditions.golden |
diff --git a/test/cctest/interpreter/bytecode_expectations/IfConditions.golden b/test/cctest/interpreter/bytecode_expectations/IfConditions.golden |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d3b0b4373ccc963454d8ef470d4d77e39eca5dd4 |
--- /dev/null |
+++ b/test/cctest/interpreter/bytecode_expectations/IfConditions.golden |
@@ -0,0 +1,772 @@ |
+# |
+# Autogenerated by generate-bytecode-expectations. |
+# |
+ |
+--- |
+pool type: number |
+execute: yes |
+wrap: no |
+test function name: f |
+ |
+--- |
+snippet: " |
+ function f() { |
+ if (0) { |
+ return 1; |
+ } else { |
+ return -1; |
+ } |
+ }; |
+ f(); |
+" |
+frame size: 0 |
+parameter count: 1 |
+bytecode array length: 4 |
+bytecodes: [ |
+ B(StackCheck), |
+ B(LdaSmi8), U8(-1), |
+ B(Return), |
+] |
+constant pool: [ |
+] |
+handlers: [ |
+] |
+ |
+--- |
+snippet: " |
+ function f() { |
+ if ('lucky') { |
+ return 1; |
+ } else { |
+ return -1; |
+ } |
+ }; |
+ f(); |
+" |
+frame size: 0 |
+parameter count: 1 |
+bytecode array length: 4 |
+bytecodes: [ |
+ B(StackCheck), |
+ B(LdaSmi8), U8(1), |
+ B(Return), |
+] |
+constant pool: [ |
+] |
+handlers: [ |
+] |
+ |
+--- |
+snippet: " |
+ function f() { |
+ if (false) { |
+ return 1; |
+ } else { |
+ return -1; |
+ } |
+ }; |
+ f(); |
+" |
+frame size: 0 |
+parameter count: 1 |
+bytecode array length: 4 |
+bytecodes: [ |
+ B(StackCheck), |
+ B(LdaSmi8), U8(-1), |
+ B(Return), |
+] |
+constant pool: [ |
+] |
+handlers: [ |
+] |
+ |
+--- |
+snippet: " |
+ function f() { |
+ if (false) { |
+ return 1; |
+ } |
+ }; |
+ f(); |
+" |
+frame size: 0 |
+parameter count: 1 |
+bytecode array length: 3 |
+bytecodes: [ |
+ B(StackCheck), |
+ B(LdaUndefined), |
+ B(Return), |
+] |
+constant pool: [ |
+] |
+handlers: [ |
+] |
+ |
+--- |
+snippet: " |
+ function f() { |
+ var a = 1; |
+ if (a) { |
+ a += 1; |
+ } else { |
+ return 2; |
+ } |
+ }; |
+ f(); |
+" |
+frame size: 2 |
+parameter count: 1 |
+bytecode array length: 24 |
+bytecodes: [ |
+ B(StackCheck), |
+ B(LdaSmi8), U8(1), |
+ B(Star), R(0), |
+ B(JumpIfToBooleanFalse), 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(5), |
+ B(LdaSmi8), U8(2), |
+ B(Return), |
+ B(LdaUndefined), |
+ B(Return), |
+] |
+constant pool: [ |
+] |
+handlers: [ |
+] |
+ |
+--- |
+snippet: " |
+ function f(a) { |
+ if (a <= 0) { |
+ return 200; |
+ } else { |
+ return -200; |
+ } |
+ }; |
+ f(99); |
+" |
+frame size: 1 |
+parameter count: 2 |
+bytecode array length: 18 |
+bytecodes: [ |
+ B(StackCheck), |
+ B(Ldar), R(arg0), |
+ B(Star), R(0), |
+ B(LdaZero), |
+ B(TestLessThanOrEqual), R(0), |
+ B(JumpIfFalse), U8(5), |
+ B(LdaConstant), U8(0), |
+ B(Return), |
+ B(LdaConstant), U8(1), |
+ B(Return), |
+ B(LdaUndefined), |
+ B(Return), |
+] |
+constant pool: [ |
+ 200, |
+ -200, |
+] |
+handlers: [ |
+] |
+ |
+--- |
+snippet: " |
+ function f(a, b) { if (a in b) { return 200; } }f('prop', { prop: 'yes'}); |
+" |
+frame size: 1 |
+parameter count: 3 |
+bytecode array length: 16 |
+bytecodes: [ |
+ B(StackCheck), |
+ B(Ldar), R(arg0), |
+ B(Star), R(0), |
+ B(Ldar), R(arg1), |
+ B(TestIn), R(0), |
+ B(JumpIfFalse), U8(5), |
+ B(LdaConstant), U8(0), |
+ B(Return), |
+ B(LdaUndefined), |
+ B(Return), |
+] |
+constant pool: [ |
+ 200, |
+] |
+handlers: [ |
+] |
+ |
+--- |
+snippet: " |
+ function f(z) { var a = 0; var b = 0; if (a === 0.01) { |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ return 200; } else { return -200; } } f(0.001); |
+" |
+frame size: 3 |
+parameter count: 2 |
+bytecode array length: 283 |
+bytecodes: [ |
+ B(StackCheck), |
+ B(LdaZero), |
+ B(Star), R(0), |
+ B(LdaZero), |
+ B(Star), R(1), |
+ B(Ldar), R(0), |
+ B(Star), R(2), |
+ B(LdaConstant), U8(0), |
+ B(TestEqualStrict), R(2), |
+ B(JumpIfFalseConstant), U8(2), |
+ B(Ldar), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(LdaConstant), U8(1), |
+ B(Return), |
+ B(LdaConstant), U8(3), |
+ B(Return), |
+ B(LdaUndefined), |
+ B(Return), |
+] |
+constant pool: [ |
+ 0.01, |
+ 200, |
+ 263, |
+ -200, |
+] |
+handlers: [ |
+] |
+ |
+--- |
+snippet: " |
+ function f() { |
+ var a = 0; var b = 0; |
+ if (a) { |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ b = a; a = b; |
+ return 200; } else { return -200; } |
+ }; |
+ f(); |
+" |
+frame size: 2 |
+parameter count: 1 |
+bytecode array length: 277 |
+bytecodes: [ |
+ B(StackCheck), |
+ B(LdaZero), |
+ B(Star), R(0), |
+ B(LdaZero), |
+ B(Star), R(1), |
+ B(Ldar), R(0), |
+ B(JumpIfToBooleanFalseConstant), U8(1), |
+ B(Ldar), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(Star), R(1), |
+ B(Star), R(0), |
+ B(LdaConstant), U8(0), |
+ B(Return), |
+ B(LdaConstant), U8(2), |
+ B(Return), |
+ B(LdaUndefined), |
+ B(Return), |
+] |
+constant pool: [ |
+ 200, |
+ 263, |
+ -200, |
+] |
+handlers: [ |
+] |
+ |
+--- |
+snippet: " |
+ function f(a, b) { |
+ if (a == b) { return 1; } |
+ if (a === b) { return 1; } |
+ if (a < b) { return 1; } |
+ if (a > b) { return 1; } |
+ if (a <= b) { return 1; } |
+ if (a >= b) { return 1; } |
+ if (a in b) { return 1; } |
+ if (a instanceof b) { return 1; } |
+ return 0; |
+ } |
+ f(1, 1); |
+" |
+frame size: 1 |
+parameter count: 3 |
+bytecode array length: 107 |
+bytecodes: [ |
+ B(StackCheck), |
+ B(Ldar), R(arg0), |
+ B(Star), R(0), |
+ B(Ldar), R(arg1), |
+ B(TestEqual), R(0), |
+ B(JumpIfFalse), U8(5), |
+ B(LdaSmi8), U8(1), |
+ B(Return), |
+ B(Ldar), R(arg0), |
+ B(Star), R(0), |
+ B(Ldar), R(arg1), |
+ B(TestEqualStrict), R(0), |
+ B(JumpIfFalse), U8(5), |
+ B(LdaSmi8), U8(1), |
+ B(Return), |
+ B(Ldar), R(arg0), |
+ B(Star), R(0), |
+ B(Ldar), R(arg1), |
+ B(TestLessThan), R(0), |
+ B(JumpIfFalse), U8(5), |
+ B(LdaSmi8), U8(1), |
+ B(Return), |
+ B(Ldar), R(arg0), |
+ B(Star), R(0), |
+ B(Ldar), R(arg1), |
+ B(TestGreaterThan), R(0), |
+ B(JumpIfFalse), U8(5), |
+ B(LdaSmi8), U8(1), |
+ B(Return), |
+ B(Ldar), R(arg0), |
+ B(Star), R(0), |
+ B(Ldar), R(arg1), |
+ B(TestLessThanOrEqual), R(0), |
+ B(JumpIfFalse), U8(5), |
+ B(LdaSmi8), U8(1), |
+ B(Return), |
+ B(Ldar), R(arg0), |
+ B(Star), R(0), |
+ B(Ldar), R(arg1), |
+ B(TestGreaterThanOrEqual), R(0), |
+ B(JumpIfFalse), U8(5), |
+ B(LdaSmi8), U8(1), |
+ B(Return), |
+ B(Ldar), R(arg0), |
+ B(Star), R(0), |
+ B(Ldar), R(arg1), |
+ B(TestIn), R(0), |
+ B(JumpIfFalse), U8(5), |
+ B(LdaSmi8), U8(1), |
+ B(Return), |
+ B(Ldar), R(arg0), |
+ B(Star), R(0), |
+ B(Ldar), R(arg1), |
+ B(TestInstanceOf), R(0), |
+ B(JumpIfFalse), U8(5), |
+ B(LdaSmi8), U8(1), |
+ B(Return), |
+ B(LdaZero), |
+ B(Return), |
+] |
+constant pool: [ |
+] |
+handlers: [ |
+] |
+ |
+--- |
+snippet: " |
+ function f() { |
+ var a = 0; |
+ if (a) { |
+ return 20; |
+ } else { |
+ return -20; |
+ } |
+ }; |
+ f(); |
+" |
+frame size: 1 |
+parameter count: 1 |
+bytecode array length: 14 |
+bytecodes: [ |
+ B(StackCheck), |
+ B(LdaZero), |
+ B(Star), R(0), |
+ B(JumpIfToBooleanFalse), U8(5), |
+ B(LdaSmi8), U8(20), |
+ B(Return), |
+ B(LdaSmi8), U8(-20), |
+ B(Return), |
+ B(LdaUndefined), |
+ B(Return), |
+] |
+constant pool: [ |
+] |
+handlers: [ |
+] |
+ |