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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 #
2 # Autogenerated by generate-bytecode-expectations
3 #
4
5 ---
6 pool type: number
7 execute: yes
8 wrap: no
9 test function name: f
10
11 ---
12 snippet: "
13 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.
14 "
15 frame size: 0
16 parameter count: 1
17 bytecode array length: 4
18 bytecodes: [
19 B(StackCheck),
20 B(LdaSmi8), U8(-1),
21 B(Return),
22 ]
23 constant pool: [
24 ]
25 handlers: [
26 ]
27
28 ---
29 snippet: "
30 function f() { if ('lucky') { return 1; } else { return -1; } } f();
31 "
32 frame size: 0
33 parameter count: 1
34 bytecode array length: 4
35 bytecodes: [
36 B(StackCheck),
37 B(LdaSmi8), U8(1),
38 B(Return),
39 ]
40 constant pool: [
41 ]
42 handlers: [
43 ]
44
45 ---
46 snippet: "
47 function f() { if (false) { return 1; } else { return -1; } } f();
48 "
49 frame size: 0
50 parameter count: 1
51 bytecode array length: 4
52 bytecodes: [
53 B(StackCheck),
54 B(LdaSmi8), U8(-1),
55 B(Return),
56 ]
57 constant pool: [
58 ]
59 handlers: [
60 ]
61
62 ---
63 snippet: "
64 function f() { if (false) { return 1; } } f();
65 "
66 frame size: 0
67 parameter count: 1
68 bytecode array length: 3
69 bytecodes: [
70 B(StackCheck),
71 B(LdaUndefined),
72 B(Return),
73 ]
74 constant pool: [
75 ]
76 handlers: [
77 ]
78
79 ---
80 snippet: "
81 function f() { var a = 1; if (a) { a += 1; } else { return 2; } } f();
82 "
83 frame size: 2
84 parameter count: 1
85 bytecode array length: 24
86 bytecodes: [
87 B(StackCheck),
88 B(LdaSmi8), U8(1),
89 B(Star), R(0),
90 B(JumpIfToBooleanFalse), U8(14),
91 B(Ldar), R(0),
92 B(Star), R(1),
93 B(LdaSmi8), U8(1),
94 B(Add), R(1),
95 B(Star), R(0),
96 B(Jump), U8(5),
97 B(LdaSmi8), U8(2),
98 B(Return),
99 B(LdaUndefined),
100 B(Return),
101 ]
102 constant pool: [
103 ]
104 handlers: [
105 ]
106
107 ---
108 snippet: "
109 function f(a) { if (a <= 0) { return 200; } else { return -200; } }f(99);
110 "
111 frame size: 1
112 parameter count: 2
113 bytecode array length: 18
114 bytecodes: [
115 B(StackCheck),
116 B(Ldar), R(arg0),
117 B(Star), R(0),
118 B(LdaZero),
119 B(TestLessThanOrEqual), R(0),
120 B(JumpIfFalse), U8(5),
121 B(LdaConstant), U8(0),
122 B(Return),
123 B(LdaConstant), U8(1),
124 B(Return),
125 B(LdaUndefined),
126 B(Return),
127 ]
128 constant pool: [
129 200,
130 -200,
131 ]
132 handlers: [
133 ]
134
135 ---
136 snippet: "
137 function f(a, b) { if (a in b) { return 200; } }f('prop', { prop: 'yes'});
138 "
139 frame size: 1
140 parameter count: 3
141 bytecode array length: 16
142 bytecodes: [
143 B(StackCheck),
144 B(Ldar), R(arg0),
145 B(Star), R(0),
146 B(Ldar), R(arg1),
147 B(TestIn), R(0),
148 B(JumpIfFalse), U8(5),
149 B(LdaConstant), U8(0),
150 B(Return),
151 B(LdaUndefined),
152 B(Return),
153 ]
154 constant pool: [
155 200,
156 ]
157 handlers: [
158 ]
159
160 ---
161 snippet: "
162 function f(z) { var a = 0; var b = 0; if (a === 0.01) {
163 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.
164 b = a; a = b;
165 b = a; a = b;
166 b = a; a = b;
167 b = a; a = b;
168 b = a; a = b;
169 b = a; a = b;
170 b = a; a = b;
171 b = a; a = b;
172 b = a; a = b;
173 b = a; a = b;
174 b = a; a = b;
175 b = a; a = b;
176 b = a; a = b;
177 b = a; a = b;
178 b = a; a = b;
179 b = a; a = b;
180 b = a; a = b;
181 b = a; a = b;
182 b = a; a = b;
183 b = a; a = b;
184 b = a; a = b;
185 b = a; a = b;
186 b = a; a = b;
187 b = a; a = b;
188 b = a; a = b;
189 b = a; a = b;
190 b = a; a = b;
191 b = a; a = b;
192 b = a; a = b;
193 b = a; a = b;
194 b = a; a = b;
195 b = a; a = b;
196 b = a; a = b;
197 b = a; a = b;
198 b = a; a = b;
199 b = a; a = b;
200 b = a; a = b;
201 b = a; a = b;
202 b = a; a = b;
203 b = a; a = b;
204 b = a; a = b;
205 b = a; a = b;
206 b = a; a = b;
207 b = a; a = b;
208 b = a; a = b;
209 b = a; a = b;
210 b = a; a = b;
211 b = a; a = b;
212 b = a; a = b;
213 b = a; a = b;
214 b = a; a = b;
215 b = a; a = b;
216 b = a; a = b;
217 b = a; a = b;
218 b = a; a = b;
219 b = a; a = b;
220 b = a; a = b;
221 b = a; a = b;
222 b = a; a = b;
223 b = a; a = b;
224 b = a; a = b;
225 b = a; a = b;
226 b = a; a = b;
227 return 200; } else { return -200; } } f(0.001)
228 "
229 frame size: 3
230 parameter count: 2
231 bytecode array length: 283
232 bytecodes: [
233 B(StackCheck),
234 B(LdaZero),
235 B(Star), R(0),
236 B(LdaZero),
237 B(Star), R(1),
238 B(Ldar), R(0),
239 B(Star), R(2),
240 B(LdaConstant), U8(0),
241 B(TestEqualStrict), R(2),
242 B(JumpIfFalseConstant), U8(2),
243 B(Ldar), R(0),
244 B(Star), R(1),
245 B(Star), R(0),
246 B(Star), R(1),
247 B(Star), R(0),
248 B(Star), R(1),
249 B(Star), R(0),
250 B(Star), R(1),
251 B(Star), R(0),
252 B(Star), R(1),
253 B(Star), R(0),
254 B(Star), R(1),
255 B(Star), R(0),
256 B(Star), R(1),
257 B(Star), R(0),
258 B(Star), R(1),
259 B(Star), R(0),
260 B(Star), R(1),
261 B(Star), R(0),
262 B(Star), R(1),
263 B(Star), R(0),
264 B(Star), R(1),
265 B(Star), R(0),
266 B(Star), R(1),
267 B(Star), R(0),
268 B(Star), R(1),
269 B(Star), R(0),
270 B(Star), R(1),
271 B(Star), R(0),
272 B(Star), R(1),
273 B(Star), R(0),
274 B(Star), R(1),
275 B(Star), R(0),
276 B(Star), R(1),
277 B(Star), R(0),
278 B(Star), R(1),
279 B(Star), R(0),
280 B(Star), R(1),
281 B(Star), R(0),
282 B(Star), R(1),
283 B(Star), R(0),
284 B(Star), R(1),
285 B(Star), R(0),
286 B(Star), R(1),
287 B(Star), R(0),
288 B(Star), R(1),
289 B(Star), R(0),
290 B(Star), R(1),
291 B(Star), R(0),
292 B(Star), R(1),
293 B(Star), R(0),
294 B(Star), R(1),
295 B(Star), R(0),
296 B(Star), R(1),
297 B(Star), R(0),
298 B(Star), R(1),
299 B(Star), R(0),
300 B(Star), R(1),
301 B(Star), R(0),
302 B(Star), R(1),
303 B(Star), R(0),
304 B(Star), R(1),
305 B(Star), R(0),
306 B(Star), R(1),
307 B(Star), R(0),
308 B(Star), R(1),
309 B(Star), R(0),
310 B(Star), R(1),
311 B(Star), R(0),
312 B(Star), R(1),
313 B(Star), R(0),
314 B(Star), R(1),
315 B(Star), R(0),
316 B(Star), R(1),
317 B(Star), R(0),
318 B(Star), R(1),
319 B(Star), R(0),
320 B(Star), R(1),
321 B(Star), R(0),
322 B(Star), R(1),
323 B(Star), R(0),
324 B(Star), R(1),
325 B(Star), R(0),
326 B(Star), R(1),
327 B(Star), R(0),
328 B(Star), R(1),
329 B(Star), R(0),
330 B(Star), R(1),
331 B(Star), R(0),
332 B(Star), R(1),
333 B(Star), R(0),
334 B(Star), R(1),
335 B(Star), R(0),
336 B(Star), R(1),
337 B(Star), R(0),
338 B(Star), R(1),
339 B(Star), R(0),
340 B(Star), R(1),
341 B(Star), R(0),
342 B(Star), R(1),
343 B(Star), R(0),
344 B(Star), R(1),
345 B(Star), R(0),
346 B(Star), R(1),
347 B(Star), R(0),
348 B(Star), R(1),
349 B(Star), R(0),
350 B(Star), R(1),
351 B(Star), R(0),
352 B(Star), R(1),
353 B(Star), R(0),
354 B(Star), R(1),
355 B(Star), R(0),
356 B(Star), R(1),
357 B(Star), R(0),
358 B(Star), R(1),
359 B(Star), R(0),
360 B(Star), R(1),
361 B(Star), R(0),
362 B(Star), R(1),
363 B(Star), R(0),
364 B(Star), R(1),
365 B(Star), R(0),
366 B(Star), R(1),
367 B(Star), R(0),
368 B(Star), R(1),
369 B(Star), R(0),
370 B(Star), R(1),
371 B(Star), R(0),
372 B(LdaConstant), U8(1),
373 B(Return),
374 B(LdaConstant), U8(3),
375 B(Return),
376 B(LdaUndefined),
377 B(Return),
378 ]
379 constant pool: [
380 0.01,
381 200,
382 263,
383 -200,
384 ]
385 handlers: [
386 ]
387
388 ---
389 snippet: "
390 function f() { var a = 0; var b = 0; if (a) { b = a; a = b;
391 b = a; a = b;
rmcilroy 2016/02/24 08:55:34 ditto
Stefano Sanfilippo 2016/02/24 14:55:00 Done.
392 b = a; a = b;
393 b = a; a = b;
394 b = a; a = b;
395 b = a; a = b;
396 b = a; a = b;
397 b = a; a = b;
398 b = a; a = b;
399 b = a; a = b;
400 b = a; a = b;
401 b = a; a = b;
402 b = a; a = b;
403 b = a; a = b;
404 b = a; a = b;
405 b = a; a = b;
406 b = a; a = b;
407 b = a; a = b;
408 b = a; a = b;
409 b = a; a = b;
410 b = a; a = b;
411 b = a; a = b;
412 b = a; a = b;
413 b = a; a = b;
414 b = a; a = b;
415 b = a; a = b;
416 b = a; a = b;
417 b = a; a = b;
418 b = a; a = b;
419 b = a; a = b;
420 b = a; a = b;
421 b = a; a = b;
422 b = a; a = b;
423 b = a; a = b;
424 b = a; a = b;
425 b = a; a = b;
426 b = a; a = b;
427 b = a; a = b;
428 b = a; a = b;
429 b = a; a = b;
430 b = a; a = b;
431 b = a; a = b;
432 b = a; a = b;
433 b = a; a = b;
434 b = a; a = b;
435 b = a; a = b;
436 b = a; a = b;
437 b = a; a = b;
438 b = a; a = b;
439 b = a; a = b;
440 b = a; a = b;
441 b = a; a = b;
442 b = a; a = b;
443 b = a; a = b;
444 b = a; a = b;
445 b = a; a = b;
446 b = a; a = b;
447 b = a; a = b;
448 b = a; a = b;
449 b = a; a = b;
450 b = a; a = b;
451 b = a; a = b;
452 b = a; a = b;
453 b = a; a = b;
454 return 200; } else { return -200; } } f()
455 "
456 frame size: 2
457 parameter count: 1
458 bytecode array length: 277
459 bytecodes: [
460 B(StackCheck),
461 B(LdaZero),
462 B(Star), R(0),
463 B(LdaZero),
464 B(Star), R(1),
465 B(Ldar), R(0),
466 B(JumpIfToBooleanFalseConstant), U8(1),
467 B(Ldar), R(0),
468 B(Star), R(1),
469 B(Star), R(0),
470 B(Star), R(1),
471 B(Star), R(0),
472 B(Star), R(1),
473 B(Star), R(0),
474 B(Star), R(1),
475 B(Star), R(0),
476 B(Star), R(1),
477 B(Star), R(0),
478 B(Star), R(1),
479 B(Star), R(0),
480 B(Star), R(1),
481 B(Star), R(0),
482 B(Star), R(1),
483 B(Star), R(0),
484 B(Star), R(1),
485 B(Star), R(0),
486 B(Star), R(1),
487 B(Star), R(0),
488 B(Star), R(1),
489 B(Star), R(0),
490 B(Star), R(1),
491 B(Star), R(0),
492 B(Star), R(1),
493 B(Star), R(0),
494 B(Star), R(1),
495 B(Star), R(0),
496 B(Star), R(1),
497 B(Star), R(0),
498 B(Star), R(1),
499 B(Star), R(0),
500 B(Star), R(1),
501 B(Star), R(0),
502 B(Star), R(1),
503 B(Star), R(0),
504 B(Star), R(1),
505 B(Star), R(0),
506 B(Star), R(1),
507 B(Star), R(0),
508 B(Star), R(1),
509 B(Star), R(0),
510 B(Star), R(1),
511 B(Star), R(0),
512 B(Star), R(1),
513 B(Star), R(0),
514 B(Star), R(1),
515 B(Star), R(0),
516 B(Star), R(1),
517 B(Star), R(0),
518 B(Star), R(1),
519 B(Star), R(0),
520 B(Star), R(1),
521 B(Star), R(0),
522 B(Star), R(1),
523 B(Star), R(0),
524 B(Star), R(1),
525 B(Star), R(0),
526 B(Star), R(1),
527 B(Star), R(0),
528 B(Star), R(1),
529 B(Star), R(0),
530 B(Star), R(1),
531 B(Star), R(0),
532 B(Star), R(1),
533 B(Star), R(0),
534 B(Star), R(1),
535 B(Star), R(0),
536 B(Star), R(1),
537 B(Star), R(0),
538 B(Star), R(1),
539 B(Star), R(0),
540 B(Star), R(1),
541 B(Star), R(0),
542 B(Star), R(1),
543 B(Star), R(0),
544 B(Star), R(1),
545 B(Star), R(0),
546 B(Star), R(1),
547 B(Star), R(0),
548 B(Star), R(1),
549 B(Star), R(0),
550 B(Star), R(1),
551 B(Star), R(0),
552 B(Star), R(1),
553 B(Star), R(0),
554 B(Star), R(1),
555 B(Star), R(0),
556 B(Star), R(1),
557 B(Star), R(0),
558 B(Star), R(1),
559 B(Star), R(0),
560 B(Star), R(1),
561 B(Star), R(0),
562 B(Star), R(1),
563 B(Star), R(0),
564 B(Star), R(1),
565 B(Star), R(0),
566 B(Star), R(1),
567 B(Star), R(0),
568 B(Star), R(1),
569 B(Star), R(0),
570 B(Star), R(1),
571 B(Star), R(0),
572 B(Star), R(1),
573 B(Star), R(0),
574 B(Star), R(1),
575 B(Star), R(0),
576 B(Star), R(1),
577 B(Star), R(0),
578 B(Star), R(1),
579 B(Star), R(0),
580 B(Star), R(1),
581 B(Star), R(0),
582 B(Star), R(1),
583 B(Star), R(0),
584 B(Star), R(1),
585 B(Star), R(0),
586 B(Star), R(1),
587 B(Star), R(0),
588 B(Star), R(1),
589 B(Star), R(0),
590 B(Star), R(1),
591 B(Star), R(0),
592 B(Star), R(1),
593 B(Star), R(0),
594 B(Star), R(1),
595 B(Star), R(0),
596 B(LdaConstant), U8(0),
597 B(Return),
598 B(LdaConstant), U8(2),
599 B(Return),
600 B(LdaUndefined),
601 B(Return),
602 ]
603 constant pool: [
604 200,
605 263,
606 -200,
607 ]
608 handlers: [
609 ]
610
611 ---
612 snippet: "
613 function f(a, b) {
614 if (a == b) { return 1; }
615 if (a === b) { return 1; }
616 if (a < b) { return 1; }
617 if (a > b) { return 1; }
618 if (a <= b) { return 1; }
619 if (a >= b) { return 1; }
620 if (a in b) { return 1; }
621 if (a instanceof b) { return 1; }
622 return 0;
623 } f(1, 1);
624 "
625 frame size: 1
626 parameter count: 3
627 bytecode array length: 107
628 bytecodes: [
629 B(StackCheck),
630 B(Ldar), R(arg0),
631 B(Star), R(0),
632 B(Ldar), R(arg1),
633 B(TestEqual), R(0),
634 B(JumpIfFalse), U8(5),
635 B(LdaSmi8), U8(1),
636 B(Return),
637 B(Ldar), R(arg0),
638 B(Star), R(0),
639 B(Ldar), R(arg1),
640 B(TestEqualStrict), R(0),
641 B(JumpIfFalse), U8(5),
642 B(LdaSmi8), U8(1),
643 B(Return),
644 B(Ldar), R(arg0),
645 B(Star), R(0),
646 B(Ldar), R(arg1),
647 B(TestLessThan), R(0),
648 B(JumpIfFalse), U8(5),
649 B(LdaSmi8), U8(1),
650 B(Return),
651 B(Ldar), R(arg0),
652 B(Star), R(0),
653 B(Ldar), R(arg1),
654 B(TestGreaterThan), R(0),
655 B(JumpIfFalse), U8(5),
656 B(LdaSmi8), U8(1),
657 B(Return),
658 B(Ldar), R(arg0),
659 B(Star), R(0),
660 B(Ldar), R(arg1),
661 B(TestLessThanOrEqual), R(0),
662 B(JumpIfFalse), U8(5),
663 B(LdaSmi8), U8(1),
664 B(Return),
665 B(Ldar), R(arg0),
666 B(Star), R(0),
667 B(Ldar), R(arg1),
668 B(TestGreaterThanOrEqual), R(0),
669 B(JumpIfFalse), U8(5),
670 B(LdaSmi8), U8(1),
671 B(Return),
672 B(Ldar), R(arg0),
673 B(Star), R(0),
674 B(Ldar), R(arg1),
675 B(TestIn), R(0),
676 B(JumpIfFalse), U8(5),
677 B(LdaSmi8), U8(1),
678 B(Return),
679 B(Ldar), R(arg0),
680 B(Star), R(0),
681 B(Ldar), R(arg1),
682 B(TestInstanceOf), R(0),
683 B(JumpIfFalse), U8(5),
684 B(LdaSmi8), U8(1),
685 B(Return),
686 B(LdaZero),
687 B(Return),
688 ]
689 constant pool: [
690 ]
691 handlers: [
692 ]
693
694 ---
695 snippet: "
696 function f() {
697 var a = 0;
698 if (a) {
699 return 20;
700 } else {
rmcilroy 2016/02/24 08:55:34 fix if / else indentation please
Stefano Sanfilippo 2016/02/24 14:55:00 Done.
701 return -20;}
702 };
703 f();
704 "
705 frame size: 1
706 parameter count: 1
707 bytecode array length: 14
708 bytecodes: [
709 B(StackCheck),
710 B(LdaZero),
711 B(Star), R(0),
712 B(JumpIfToBooleanFalse), U8(5),
713 B(LdaSmi8), U8(20),
714 B(Return),
715 B(LdaSmi8), U8(-20),
716 B(Return),
717 B(LdaUndefined),
718 B(Return),
719 ]
720 constant pool: [
721 ]
722 handlers: [
723 ]
724
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698