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

Unified Diff: test/cctest/interpreter/bytecode_expectations/IfConditions.golden

Issue 1717293002: [Interpreter] Refactor bytecode generator test suite. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Move golden files to subdir, update golden format. Created 4 years, 10 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
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..9e5897600054e18f4b451cba6804dc0659a9275c
--- /dev/null
+++ b/test/cctest/interpreter/bytecode_expectations/IfConditions.golden
@@ -0,0 +1,724 @@
+#
+# 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()
rmcilroy 2016/02/24 08:55:34 semicolone and newline between final "}" and "f" (
Stefano Sanfilippo 2016/02/24 14:55:00 Done.
+"
+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;
rmcilroy 2016/02/24 08:55:34 indent each of these lines
Stefano Sanfilippo 2016/02/24 14:55:00 Done.
+ 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;
rmcilroy 2016/02/24 08:55:34 ditto
Stefano Sanfilippo 2016/02/24 14:55:00 Done.
+ 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 {
rmcilroy 2016/02/24 08:55:34 fix if / else indentation please
Stefano Sanfilippo 2016/02/24 14:55:00 Done.
+ 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: [
+]
+

Powered by Google App Engine
This is Rietveld 408576698