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

Side by Side Diff: test/cctest/interpreter/bytecode_expectations/BasicLoops.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 unified diff | Download patch
OLDNEW
(Empty)
1 #
2 # Autogenerated by generate-bytecode-expectations
3 #
4
5 ---
6 pool type: mixed
7 execute: yes
8 wrap: yes
9
10 ---
11 snippet: "
12 var x = 0;
13 while (false) { x = 99; break; continue; }
14 return x;
15 "
16 frame size: 1
17 parameter count: 1
18 bytecode array length: 5
19 bytecodes: [
20 B(StackCheck),
21 B(LdaZero),
22 B(Star), R(0),
23 B(Return),
24 ]
25 constant pool: [
26 ]
27 handlers: [
28 ]
29
30 ---
31 snippet: "
32 var x = 0;
33 while (false) {
34 x = x + 1;
35 };
36 return x;
37 "
38 frame size: 1
39 parameter count: 1
40 bytecode array length: 5
41 bytecodes: [
42 B(StackCheck),
43 B(LdaZero),
44 B(Star), R(0),
45 B(Return),
46 ]
47 constant pool: [
48 ]
49 handlers: [
50 ]
51
52 ---
53 snippet: "
54 var x = 0;
55 var y = 1;
56 while (x < 10) {
57 y = y * 12;
58 x = x + 1;
59 if (x == 3) continue;
60 if (x == 4) break;
61 }
62 return y;
63 "
64 frame size: 3
65 parameter count: 1
66 bytecode array length: 66
67 bytecodes: [
68 B(StackCheck),
69 B(LdaZero),
70 B(Star), R(0),
71 B(LdaSmi8), U8(1),
72 B(Star), R(1),
73 B(Ldar), R(0),
74 B(Star), R(2),
75 B(LdaSmi8), U8(10),
76 B(TestLessThan), R(2),
77 B(JumpIfFalse), U8(47),
78 B(StackCheck),
79 B(Ldar), R(1),
80 B(Star), R(2),
81 B(LdaSmi8), U8(12),
82 B(Mul), R(2),
83 B(Star), R(1),
84 B(Ldar), R(0),
85 B(Star), R(2),
86 B(LdaSmi8), U8(1),
87 B(Add), R(2),
88 B(Star), R(0),
89 B(Star), R(2),
90 B(LdaSmi8), U8(3),
91 B(TestEqual), R(2),
92 B(JumpIfFalse), U8(4),
93 B(Jump), U8(-39),
94 B(Ldar), R(0),
95 B(Star), R(2),
96 B(LdaSmi8), U8(4),
97 B(TestEqual), R(2),
98 B(JumpIfFalse), U8(4),
99 B(Jump), U8(4),
100 B(Jump), U8(-53),
101 B(Ldar), R(1),
102 B(Return),
103 ]
104 constant pool: [
105 ]
106 handlers: [
107 ]
108
109 ---
110 snippet: "
111 var i = 0;
112 while (true) {
113 if (i < 0) continue;
114 if (i == 3) break;
115 if (i == 4) break;
116 if (i == 10) continue;
117 if (i == 5) break;
118 i = i + 1;
119 }
120 return i;
121 "
122 frame size: 2
123 parameter count: 1
124 bytecode array length: 79
125 bytecodes: [
126 B(StackCheck),
127 B(LdaZero),
128 B(Star), R(0),
129 B(StackCheck),
130 B(Ldar), R(0),
131 B(Star), R(1),
132 B(LdaZero),
133 B(TestLessThan), R(1),
134 B(JumpIfFalse), U8(4),
135 B(Jump), U8(-10),
136 B(Ldar), R(0),
137 B(Star), R(1),
138 B(LdaSmi8), U8(3),
139 B(TestEqual), R(1),
140 B(JumpIfFalse), U8(4),
141 B(Jump), U8(50),
142 B(Ldar), R(0),
143 B(Star), R(1),
144 B(LdaSmi8), U8(4),
145 B(TestEqual), R(1),
146 B(JumpIfFalse), U8(4),
147 B(Jump), U8(38),
148 B(Ldar), R(0),
149 B(Star), R(1),
150 B(LdaSmi8), U8(10),
151 B(TestEqual), R(1),
152 B(JumpIfFalse), U8(4),
153 B(Jump), U8(-46),
154 B(Ldar), R(0),
155 B(Star), R(1),
156 B(LdaSmi8), U8(5),
157 B(TestEqual), R(1),
158 B(JumpIfFalse), U8(4),
159 B(Jump), U8(14),
160 B(Ldar), R(0),
161 B(Star), R(1),
162 B(LdaSmi8), U8(1),
163 B(Add), R(1),
164 B(Star), R(0),
165 B(Jump), U8(-70),
166 B(Ldar), R(0),
167 B(Return),
168 ]
169 constant pool: [
170 ]
171 handlers: [
172 ]
173
174 ---
175 snippet: "
176 var i = 0;
177 while (true) {
178 while (i < 3) {
179 if (i == 2) break;
180 i = i + 1;
181 }
182 i = i + 1;
183 break;
184 }
185 return i;
186 "
187 frame size: 2
188 parameter count: 1
189 bytecode array length: 57
190 bytecodes: [
191 B(StackCheck),
192 B(LdaZero),
193 B(Star), R(0),
194 B(StackCheck),
195 B(Ldar), R(0),
196 B(Star), R(1),
197 B(LdaSmi8), U8(3),
198 B(TestLessThan), R(1),
199 B(JumpIfFalse), U8(27),
200 B(StackCheck),
201 B(Ldar), R(0),
202 B(Star), R(1),
203 B(LdaSmi8), U8(2),
204 B(TestEqual), R(1),
205 B(JumpIfFalse), U8(4),
206 B(Jump), U8(14),
207 B(Ldar), R(0),
208 B(Star), R(1),
209 B(LdaSmi8), U8(1),
210 B(Add), R(1),
211 B(Star), R(0),
212 B(Jump), U8(-33),
213 B(Ldar), R(0),
214 B(Star), R(1),
215 B(LdaSmi8), U8(1),
216 B(Add), R(1),
217 B(Star), R(0),
218 B(Jump), U8(4),
219 B(Jump), U8(-48),
220 B(Ldar), R(0),
221 B(Return),
222 ]
223 constant pool: [
224 ]
225 handlers: [
226 ]
227
228 ---
229 snippet: "
230 var x = 10;
231 var y = 1;
232 while (x) {
233 y = y * 12;
234 x = x - 1;
235 }
236 return y;
237 "
238 frame size: 3
239 parameter count: 1
240 bytecode array length: 39
241 bytecodes: [
242 B(StackCheck),
243 B(LdaSmi8), U8(10),
244 B(Star), R(0),
245 B(LdaSmi8), U8(1),
246 B(Star), R(1),
247 B(Ldar), R(0),
248 B(JumpIfToBooleanFalse), U8(25),
249 B(StackCheck),
250 B(Ldar), R(1),
251 B(Star), R(2),
252 B(LdaSmi8), U8(12),
253 B(Mul), R(2),
254 B(Star), R(1),
255 B(Ldar), R(0),
256 B(Star), R(2),
257 B(LdaSmi8), U8(1),
258 B(Sub), R(2),
259 B(Star), R(0),
260 B(Jump), U8(-25),
261 B(Ldar), R(1),
262 B(Return),
263 ]
264 constant pool: [
265 ]
266 handlers: [
267 ]
268
269 ---
270 snippet: "
271 var x = 0; var y = 1;
272 do {
273 y = y * 10;
274 if (x == 5) break;
275 if (x == 6) continue;
276 x = x + 1;
277 } while (x < 10);
278 return y;
279 "
280 frame size: 3
281 parameter count: 1
282 bytecode array length: 66
283 bytecodes: [
284 B(StackCheck),
285 B(LdaZero),
286 B(Star), R(0),
287 B(LdaSmi8), U8(1),
288 B(Star), R(1),
289 B(StackCheck),
290 B(Ldar), R(1),
291 B(Star), R(2),
292 B(LdaSmi8), U8(10),
293 B(Mul), R(2),
294 B(Star), R(1),
295 B(Ldar), R(0),
296 B(Star), R(2),
297 B(LdaSmi8), U8(5),
298 B(TestEqual), R(2),
299 B(JumpIfFalse), U8(4),
300 B(Jump), U8(34),
301 B(Ldar), R(0),
302 B(Star), R(2),
303 B(LdaSmi8), U8(6),
304 B(TestEqual), R(2),
305 B(JumpIfFalse), U8(4),
306 B(Jump), U8(12),
307 B(Ldar), R(0),
308 B(Star), R(2),
309 B(LdaSmi8), U8(1),
310 B(Add), R(2),
311 B(Star), R(0),
312 B(Ldar), R(0),
313 B(Star), R(2),
314 B(LdaSmi8), U8(10),
315 B(TestLessThan), R(2),
316 B(JumpIfTrue), U8(-53),
317 B(Ldar), R(1),
318 B(Return),
319 ]
320 constant pool: [
321 ]
322 handlers: [
323 ]
324
325 ---
326 snippet: "
327 var x = 10;
328 var y = 1;
329 do {
330 y = y * 12;
331 x = x - 1;
332 } while (x);
333 return y;
334 "
335 frame size: 3
336 parameter count: 1
337 bytecode array length: 37
338 bytecodes: [
339 B(StackCheck),
340 B(LdaSmi8), U8(10),
341 B(Star), R(0),
342 B(LdaSmi8), U8(1),
343 B(Star), R(1),
344 B(StackCheck),
345 B(Ldar), R(1),
346 B(Star), R(2),
347 B(LdaSmi8), U8(12),
348 B(Mul), R(2),
349 B(Star), R(1),
350 B(Ldar), R(0),
351 B(Star), R(2),
352 B(LdaSmi8), U8(1),
353 B(Sub), R(2),
354 B(Star), R(0),
355 B(Ldar), R(0),
356 B(JumpIfToBooleanTrue), U8(-23),
357 B(Ldar), R(1),
358 B(Return),
359 ]
360 constant pool: [
361 ]
362 handlers: [
363 ]
364
365 ---
366 snippet: "
367 var x = 0; var y = 1;
368 do {
369 y = y * 10;
370 if (x == 5) break;
371 x = x + 1;
372 if (x == 6) continue;
373 } while (false);
374 return y;
375 "
376 frame size: 3
377 parameter count: 1
378 bytecode array length: 54
379 bytecodes: [
380 B(StackCheck),
381 B(LdaZero),
382 B(Star), R(0),
383 B(LdaSmi8), U8(1),
384 B(Star), R(1),
385 B(StackCheck),
386 B(Ldar), R(1),
387 B(Star), R(2),
388 B(LdaSmi8), U8(10),
389 B(Mul), R(2),
390 B(Star), R(1),
391 B(Ldar), R(0),
392 B(Star), R(2),
393 B(LdaSmi8), U8(5),
394 B(TestEqual), R(2),
395 B(JumpIfFalse), U8(4),
396 B(Jump), U8(22),
397 B(Ldar), R(0),
398 B(Star), R(2),
399 B(LdaSmi8), U8(1),
400 B(Add), R(2),
401 B(Star), R(0),
402 B(Star), R(2),
403 B(LdaSmi8), U8(6),
404 B(TestEqual), R(2),
405 B(JumpIfFalse), U8(4),
406 B(Jump), U8(2),
407 B(Ldar), R(1),
408 B(Return),
409 ]
410 constant pool: [
411 ]
412 handlers: [
413 ]
414
415 ---
416 snippet: "
417 var x = 0; var y = 1;
418 do {
419 y = y * 10;
420 if (x == 5) break;
421 x = x + 1;
422 if (x == 6) continue;
423 } while (true);
424 return y;
425 "
426 frame size: 3
427 parameter count: 1
428 bytecode array length: 56
429 bytecodes: [
430 B(StackCheck),
431 B(LdaZero),
432 B(Star), R(0),
433 B(LdaSmi8), U8(1),
434 B(Star), R(1),
435 B(StackCheck),
436 B(Ldar), R(1),
437 B(Star), R(2),
438 B(LdaSmi8), U8(10),
439 B(Mul), R(2),
440 B(Star), R(1),
441 B(Ldar), R(0),
442 B(Star), R(2),
443 B(LdaSmi8), U8(5),
444 B(TestEqual), R(2),
445 B(JumpIfFalse), U8(4),
446 B(Jump), U8(24),
447 B(Ldar), R(0),
448 B(Star), R(2),
449 B(LdaSmi8), U8(1),
450 B(Add), R(2),
451 B(Star), R(0),
452 B(Star), R(2),
453 B(LdaSmi8), U8(6),
454 B(TestEqual), R(2),
455 B(JumpIfFalse), U8(4),
456 B(Jump), U8(-41),
457 B(Jump), U8(-43),
458 B(Ldar), R(1),
459 B(Return),
460 ]
461 constant pool: [
462 ]
463 handlers: [
464 ]
465
466 ---
467 snippet: "
468 var x = 0;
469 for (;;) {
470 if (x == 1) break;
471 if (x == 2) continue;
472 x = x + 1;
473 }
474 "
475 frame size: 2
476 parameter count: 1
477 bytecode array length: 43
478 bytecodes: [
479 B(StackCheck),
480 B(LdaZero),
481 B(Star), R(0),
482 B(StackCheck),
483 B(Ldar), R(0),
484 B(Star), R(1),
485 B(LdaSmi8), U8(1),
486 B(TestEqual), R(1),
487 B(JumpIfFalse), U8(4),
488 B(Jump), U8(26),
489 B(Ldar), R(0),
490 B(Star), R(1),
491 B(LdaSmi8), U8(2),
492 B(TestEqual), R(1),
493 B(JumpIfFalse), U8(4),
494 B(Jump), U8(-23),
495 B(Ldar), R(0),
496 B(Star), R(1),
497 B(LdaSmi8), U8(1),
498 B(Add), R(1),
499 B(Star), R(0),
500 B(Jump), U8(-35),
501 B(LdaUndefined),
502 B(Return),
503 ]
504 constant pool: [
505 ]
506 handlers: [
507 ]
508
509 ---
510 snippet: "
511 for (var x = 0;;) {
512 if (x == 1) break;
513 if (x == 2) continue;
514 x = x + 1;
515 }
516 "
517 frame size: 2
518 parameter count: 1
519 bytecode array length: 43
520 bytecodes: [
521 B(StackCheck),
522 B(LdaZero),
523 B(Star), R(0),
524 B(StackCheck),
525 B(Ldar), R(0),
526 B(Star), R(1),
527 B(LdaSmi8), U8(1),
528 B(TestEqual), R(1),
529 B(JumpIfFalse), U8(4),
530 B(Jump), U8(26),
531 B(Ldar), R(0),
532 B(Star), R(1),
533 B(LdaSmi8), U8(2),
534 B(TestEqual), R(1),
535 B(JumpIfFalse), U8(4),
536 B(Jump), U8(-23),
537 B(Ldar), R(0),
538 B(Star), R(1),
539 B(LdaSmi8), U8(1),
540 B(Add), R(1),
541 B(Star), R(0),
542 B(Jump), U8(-35),
543 B(LdaUndefined),
544 B(Return),
545 ]
546 constant pool: [
547 ]
548 handlers: [
549 ]
550
551 ---
552 snippet: "
553 var x = 0;
554 for (;; x = x + 1) {
555 if (x == 1) break;
556 if (x == 2) continue;
557 }
558 "
559 frame size: 2
560 parameter count: 1
561 bytecode array length: 43
562 bytecodes: [
563 B(StackCheck),
564 B(LdaZero),
565 B(Star), R(0),
566 B(StackCheck),
567 B(Ldar), R(0),
568 B(Star), R(1),
569 B(LdaSmi8), U8(1),
570 B(TestEqual), R(1),
571 B(JumpIfFalse), U8(4),
572 B(Jump), U8(26),
573 B(Ldar), R(0),
574 B(Star), R(1),
575 B(LdaSmi8), U8(2),
576 B(TestEqual), R(1),
577 B(JumpIfFalse), U8(4),
578 B(Jump), U8(2),
579 B(Ldar), R(0),
580 B(Star), R(1),
581 B(LdaSmi8), U8(1),
582 B(Add), R(1),
583 B(Star), R(0),
584 B(Jump), U8(-35),
585 B(LdaUndefined),
586 B(Return),
587 ]
588 constant pool: [
589 ]
590 handlers: [
591 ]
592
593 ---
594 snippet: "
595 for (var x = 0;; x = x + 1) {
596 if (x == 1) break;
597 if (x == 2) continue;
598 }
599 "
600 frame size: 2
601 parameter count: 1
602 bytecode array length: 43
603 bytecodes: [
604 B(StackCheck),
605 B(LdaZero),
606 B(Star), R(0),
607 B(StackCheck),
608 B(Ldar), R(0),
609 B(Star), R(1),
610 B(LdaSmi8), U8(1),
611 B(TestEqual), R(1),
612 B(JumpIfFalse), U8(4),
613 B(Jump), U8(26),
614 B(Ldar), R(0),
615 B(Star), R(1),
616 B(LdaSmi8), U8(2),
617 B(TestEqual), R(1),
618 B(JumpIfFalse), U8(4),
619 B(Jump), U8(2),
620 B(Ldar), R(0),
621 B(Star), R(1),
622 B(LdaSmi8), U8(1),
623 B(Add), R(1),
624 B(Star), R(0),
625 B(Jump), U8(-35),
626 B(LdaUndefined),
627 B(Return),
628 ]
629 constant pool: [
630 ]
631 handlers: [
632 ]
633
634 ---
635 snippet: "
636 var u = 0;
637 for (var i = 0; i < 100; i = i + 1) {
638 u = u + 1;
639 continue;
640 }
641 "
642 frame size: 3
643 parameter count: 1
644 bytecode array length: 44
645 bytecodes: [
646 B(StackCheck),
647 B(LdaZero),
648 B(Star), R(0),
649 B(LdaZero),
650 B(Star), R(1),
651 B(Ldar), R(1),
652 B(Star), R(2),
653 B(LdaSmi8), U8(100),
654 B(TestLessThan), R(2),
655 B(JumpIfFalse), U8(27),
656 B(StackCheck),
657 B(Ldar), R(0),
658 B(Star), R(2),
659 B(LdaSmi8), U8(1),
660 B(Add), R(2),
661 B(Star), R(0),
662 B(Jump), U8(2),
663 B(Ldar), R(1),
664 B(Star), R(2),
665 B(LdaSmi8), U8(1),
666 B(Add), R(2),
667 B(Star), R(1),
668 B(Jump), U8(-33),
669 B(LdaUndefined),
670 B(Return),
671 ]
672 constant pool: [
673 ]
674 handlers: [
675 ]
676
677 ---
678 snippet: "
679 var y = 1;
680 for (var x = 10; x; --x) {
681 y = y * 12;
682 }
683 return y;
684 "
685 frame size: 3
686 parameter count: 1
687 bytecode array length: 35
688 bytecodes: [
689 B(StackCheck),
690 B(LdaSmi8), U8(1),
691 B(Star), R(0),
692 B(LdaSmi8), U8(10),
693 B(Star), R(1),
694 B(Ldar), R(1),
695 B(JumpIfToBooleanFalse), U8(21),
696 B(StackCheck),
697 B(Ldar), R(0),
698 B(Star), R(2),
699 B(LdaSmi8), U8(12),
700 B(Mul), R(2),
701 B(Star), R(0),
702 B(Ldar), R(1),
703 B(ToNumber),
704 B(Dec),
705 B(Star), R(1),
706 B(Jump), U8(-21),
707 B(Ldar), R(0),
708 B(Return),
709 ]
710 constant pool: [
711 ]
712 handlers: [
713 ]
714
715 ---
716 snippet: "
717 var x = 0;
718 for (var i = 0; false; i++) {
719 x = x + 1;
720 };
721 return x;
722 "
723 frame size: 2
724 parameter count: 1
725 bytecode array length: 10
726 bytecodes: [
727 B(StackCheck),
728 B(LdaZero),
729 B(Star), R(0),
730 B(LdaZero),
731 B(Star), R(1),
732 B(Ldar), R(0),
733 B(Return),
734 ]
735 constant pool: [
736 ]
737 handlers: [
738 ]
739
740 ---
741 snippet: "
742 var x = 0;
743 for (var i = 0; true; ++i) {
744 x = x + 1;
745 if (x == 20) break;
746 };
747 return x;
748 "
749 frame size: 3
750 parameter count: 1
751 bytecode array length: 39
752 bytecodes: [
753 B(StackCheck),
754 B(LdaZero),
755 B(Star), R(0),
756 B(LdaZero),
757 B(Star), R(1),
758 B(StackCheck),
759 B(Ldar), R(0),
760 B(Star), R(2),
761 B(LdaSmi8), U8(1),
762 B(Add), R(2),
763 B(Star), R(0),
764 B(Star), R(2),
765 B(LdaSmi8), U8(20),
766 B(TestEqual), R(2),
767 B(JumpIfFalse), U8(4),
768 B(Jump), U8(10),
769 B(Ldar), R(1),
770 B(ToNumber),
771 B(Inc),
772 B(Star), R(1),
773 B(Jump), U8(-27),
774 B(Ldar), R(0),
775 B(Return),
776 ]
777 constant pool: [
778 ]
779 handlers: [
780 ]
781
782 ---
783 snippet: "
784 var a = 0;
785 while (a) {
786 {
787 let z = 1;
788 function f() { z = 2; }
789 if (z) continue;
790 z++;
791 }
792 }
793 "
794 frame size: 7
795 parameter count: 1
796 bytecode array length: 118
797 bytecodes: [
798 B(StackCheck),
799 B(LdaZero),
800 B(Star), R(1),
801 B(Ldar), R(1),
802 B(JumpIfToBooleanFalse), U8(110),
803 B(StackCheck),
804 B(LdaConstant), U8(0),
805 B(Star), R(4),
806 B(Ldar), R(closure),
807 B(Star), R(5),
808 B(CallRuntime), U16(Runtime::kPushBlockContext), R(4), U8(2),
809 B(PushContext), R(3),
810 B(LdaTheHole),
811 B(StaContextSlot), R(context), U8(4),
812 B(CreateClosure), U8(1), U8(0),
813 B(Star), R(0),
814 B(LdaSmi8), U8(1),
815 B(StaContextSlot), R(context), U8(4),
816 B(Ldar), R(0),
817 B(JumpIfNotHole), U8(11),
818 B(LdaConstant), U8(2),
819 B(Star), R(4),
820 B(CallRuntime), U16(Runtime::kThrowReferenceError), R(4), U8(1),
821 B(Star), R(2),
822 B(LdaContextSlot), R(context), U8(4),
823 B(JumpIfNotHole), U8(11),
824 B(LdaConstant), U8(3),
825 B(Star), R(4),
826 B(CallRuntime), U16(Runtime::kThrowReferenceError), R(4), U8(1),
827 B(JumpIfToBooleanFalse), U8(6),
828 B(PopContext), R(3),
829 B(Jump), U8(-67),
830 B(LdaContextSlot), R(context), U8(4),
831 B(JumpIfNotHole), U8(11),
832 B(LdaConstant), U8(3),
833 B(Star), R(4),
834 B(CallRuntime), U16(Runtime::kThrowReferenceError), R(4), U8(1),
835 B(ToNumber),
836 B(Star), R(4),
837 B(Inc),
838 B(Star), R(5),
839 B(LdaContextSlot), R(context), U8(4),
840 B(JumpIfNotHole), U8(11),
841 B(LdaConstant), U8(3),
842 B(Star), R(6),
843 B(CallRuntime), U16(Runtime::kThrowReferenceError), R(6), U8(1),
844 B(Ldar), R(5),
845 B(StaContextSlot), R(context), U8(4),
846 B(PopContext), R(3),
847 B(Jump), U8(-110),
848 B(LdaUndefined),
849 B(Return),
850 ]
851 constant pool: [
852 InstanceType::FIXED_ARRAY_TYPE,
853 InstanceType::SHARED_FUNCTION_INFO_TYPE,
854 InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE,
855 InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE,
856 ]
857 handlers: [
858 ]
859
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698