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

Unified Diff: test/cctest/interpreter/bytecode_expectations/Switch.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/Switch.golden
diff --git a/test/cctest/interpreter/bytecode_expectations/Switch.golden b/test/cctest/interpreter/bytecode_expectations/Switch.golden
new file mode 100644
index 0000000000000000000000000000000000000000..360bc7bdff1927139756040a062b2d104c7e5242
--- /dev/null
+++ b/test/cctest/interpreter/bytecode_expectations/Switch.golden
@@ -0,0 +1,522 @@
+#
+# Autogenerated by generate-bytecode-expectations
+#
+
+---
+pool type: number
+execute: yes
+wrap: yes
+
+---
+snippet: "
+ var a = 1;
+ switch(a) {
+ case 1: return 2;
+ case 2: return 3;
+ }
+"
+frame size: 3
+parameter count: 1
+bytecode array length: 31
+bytecodes: [
+ B(StackCheck),
+ B(LdaSmi8), U8(1),
+ B(Star), R(1),
+ B(Star), R(0),
+ B(Star), R(2),
+ B(LdaSmi8), U8(1),
+ B(TestEqualStrict), R(2),
+ B(JumpIfTrue), U8(10),
+ B(LdaSmi8), U8(2),
+ B(TestEqualStrict), R(2),
+ B(JumpIfTrue), U8(7),
+ B(Jump), U8(8),
+ B(LdaSmi8), U8(2),
+ B(Return),
+ B(LdaSmi8), U8(3),
+ B(Return),
+ B(LdaUndefined),
+ B(Return),
+]
+constant pool: [
+]
+handlers: [
+]
+
+---
+snippet: "
+ var a = 1;
+ switch(a) {
+ case 1: a = 2; break;
+ case 2: a = 3; break;
+ }
+"
+frame size: 3
+parameter count: 1
+bytecode array length: 37
+bytecodes: [
+ B(StackCheck),
+ B(LdaSmi8), U8(1),
+ B(Star), R(1),
+ B(Star), R(0),
+ B(Star), R(2),
+ B(LdaSmi8), U8(1),
+ B(TestEqualStrict), R(2),
+ B(JumpIfTrue), U8(10),
+ B(LdaSmi8), U8(2),
+ B(TestEqualStrict), R(2),
+ B(JumpIfTrue), U8(10),
+ B(Jump), U8(14),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(Jump), U8(8),
+ B(LdaSmi8), U8(3),
+ B(Star), R(1),
+ B(Jump), U8(2),
+ B(LdaUndefined),
+ B(Return),
+]
+constant pool: [
+]
+handlers: [
+]
+
+---
+snippet: "
+ var a = 1;
+ switch(a) {
+ case 1: a = 2; // fall-through
+ case 2: a = 3; break;
+ }
+"
+frame size: 3
+parameter count: 1
+bytecode array length: 35
+bytecodes: [
+ B(StackCheck),
+ B(LdaSmi8), U8(1),
+ B(Star), R(1),
+ B(Star), R(0),
+ B(Star), R(2),
+ B(LdaSmi8), U8(1),
+ B(TestEqualStrict), R(2),
+ B(JumpIfTrue), U8(10),
+ B(LdaSmi8), U8(2),
+ B(TestEqualStrict), R(2),
+ B(JumpIfTrue), U8(8),
+ B(Jump), U8(12),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(3),
+ B(Star), R(1),
+ B(Jump), U8(2),
+ B(LdaUndefined),
+ B(Return),
+]
+constant pool: [
+]
+handlers: [
+]
+
+---
+snippet: "
+ var a = 1;
+ switch(a) {
+ case 2: break;
+ case 3: break;
+ default: a = 1; break;
+ }
+"
+frame size: 3
+parameter count: 1
+bytecode array length: 35
+bytecodes: [
+ B(StackCheck),
+ B(LdaSmi8), U8(1),
+ B(Star), R(1),
+ B(Star), R(0),
+ B(Star), R(2),
+ B(LdaSmi8), U8(2),
+ B(TestEqualStrict), R(2),
+ B(JumpIfTrue), U8(10),
+ B(LdaSmi8), U8(3),
+ B(TestEqualStrict), R(2),
+ B(JumpIfTrue), U8(6),
+ B(Jump), U8(6),
+ B(Jump), U8(10),
+ B(Jump), U8(8),
+ B(LdaSmi8), U8(1),
+ B(Star), R(1),
+ B(Jump), U8(2),
+ B(LdaUndefined),
+ B(Return),
+]
+constant pool: [
+]
+handlers: [
+]
+
+---
+snippet: "
+ var a = 1;
+ switch(typeof(a)) {
+ case 2: a = 1; break;
+ case 3: a = 2; break;
+ default: a = 3; break;
+ }
+"
+frame size: 3
+parameter count: 1
+bytecode array length: 44
+bytecodes: [
+ B(StackCheck),
+ B(LdaSmi8), U8(1),
+ B(Star), R(1),
+ B(TypeOf),
+ B(Star), R(0),
+ B(Star), R(2),
+ B(LdaSmi8), U8(2),
+ B(TestEqualStrict), R(2),
+ B(JumpIfTrue), U8(10),
+ B(LdaSmi8), U8(3),
+ B(TestEqualStrict), R(2),
+ B(JumpIfTrue), U8(10),
+ B(Jump), U8(14),
+ B(LdaSmi8), U8(1),
+ B(Star), R(1),
+ B(Jump), U8(14),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(Jump), U8(8),
+ B(LdaSmi8), U8(3),
+ B(Star), R(1),
+ B(Jump), U8(2),
+ B(LdaUndefined),
+ B(Return),
+]
+constant pool: [
+]
+handlers: [
+]
+
+---
+snippet: "
+ var a = 1;
+ switch(a) {
+ case typeof(a): a = 1; break;
+ default: a = 2; break;
+ }
+"
+frame size: 3
+parameter count: 1
+bytecode array length: 32
+bytecodes: [
+ B(StackCheck),
+ B(LdaSmi8), U8(1),
+ B(Star), R(1),
+ B(Star), R(0),
+ B(Star), R(2),
+ B(Ldar), R(1),
+ B(TypeOf),
+ B(TestEqualStrict), R(2),
+ B(JumpIfTrue), U8(4),
+ B(Jump), U8(8),
+ B(LdaSmi8), U8(1),
+ B(Star), R(1),
+ B(Jump), U8(8),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(Jump), U8(2),
+ B(LdaUndefined),
+ B(Return),
+]
+constant pool: [
+]
+handlers: [
+]
+
+---
+snippet: "
+ var a = 1;
+ switch(a) {
+ case 1:
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ a = 2;
+ break;
rmcilroy 2016/02/24 08:55:35 indentation
Stefano Sanfilippo 2016/02/24 14:55:01 Done.
+ case 2: a = 3; break;
+ }
+"
+frame size: 3
+parameter count: 1
+bytecode array length: 289
+bytecodes: [
+ B(StackCheck),
+ B(LdaSmi8), U8(1),
+ B(Star), R(1),
+ B(Star), R(0),
+ B(Star), R(2),
+ B(LdaSmi8), U8(1),
+ B(TestEqualStrict), R(2),
+ B(JumpIfTrue), U8(10),
+ B(LdaSmi8), U8(2),
+ B(TestEqualStrict), R(2),
+ B(JumpIfTrueConstant), U8(0),
+ B(JumpConstant), U8(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(LdaSmi8), U8(2),
+ B(Star), R(1),
+ B(Jump), U8(8),
+ B(LdaSmi8), U8(3),
+ B(Star), R(1),
+ B(Jump), U8(2),
+ B(LdaUndefined),
+ B(Return),
+]
+constant pool: [
+ 262,
+ 266,
+]
+handlers: [
+]
+
+---
+snippet: "
+ var a = 1;
+ switch(a) {
+ case 1:
+ switch(a + 1) {
+ case 2 : a = 1; break;
+ default : a = 2; break;
+ } // fall-through
+ case 2: a = 3;
+ }
+"
+frame size: 5
+parameter count: 1
+bytecode array length: 61
+bytecodes: [
+ B(StackCheck),
+ B(LdaSmi8), U8(1),
+ B(Star), R(2),
+ B(Star), R(0),
+ B(Star), R(3),
+ B(LdaSmi8), U8(1),
+ B(TestEqualStrict), R(3),
+ B(JumpIfTrue), U8(10),
+ B(LdaSmi8), U8(2),
+ B(TestEqualStrict), R(3),
+ B(JumpIfTrue), U8(36),
+ B(Jump), U8(38),
+ B(Ldar), R(2),
+ B(Star), R(4),
+ B(LdaSmi8), U8(1),
+ B(Add), R(4),
+ B(Star), R(1),
+ B(Star), R(4),
+ B(LdaSmi8), U8(2),
+ B(TestEqualStrict), R(4),
+ B(JumpIfTrue), U8(4),
+ B(Jump), U8(8),
+ B(LdaSmi8), U8(1),
+ B(Star), R(2),
+ B(Jump), U8(8),
+ B(LdaSmi8), U8(2),
+ B(Star), R(2),
+ B(Jump), U8(2),
+ B(LdaSmi8), U8(3),
+ B(Star), R(2),
+ B(LdaUndefined),
+ B(Return),
+]
+constant pool: [
+]
+handlers: [
+]
+

Powered by Google App Engine
This is Rietveld 408576698