1 # 2 # Autogenerated by generate-bytecode-expectations. 3 # 4 5 --- 6 pool type: number 7 execute: yes 8 wrap: yes 9 10 --- 11 snippet: " 12 var a = 1; 13 switch(a) { 14 case 1: return 2; 15 case 2: return 3; 16 } 17 " 18 frame size: 3 19 parameter count: 1 20 bytecode array length: 32 21 bytecodes: [ 22 /* 30 E> */ B(StackCheck), 23 /* 42 S> */ B(LdaSmi), U8(1), 24 B(Star), R(1), 25 B(Star), R(0), 26 /* 45 S> */ B(LdaSmi), U8(1), 27 B(TestEqualStrict), R(0), 28 B(Mov), R(0), R(2), 29 B(JumpIfToBooleanTrue), U8(10), 30 B(LdaSmi), U8(2), 31 B(TestEqualStrict), R(2), 32 B(JumpIfTrue), U8(7), 33 B(Jump), U8(8), 34 /* 66 S> */ B(LdaSmi), U8(2), 35 /* 97 S> */ B(Return), 36 /* 85 S> */ B(LdaSmi), U8(3), 37 /* 97 S> */ B(Return), 38 B(LdaUndefined), 39 /* 97 S> */ B(Return), 40 ] 41 constant pool: [ 42 ] 43 handlers: [ 44 ] 45 46 --- 47 snippet: " 48 var a = 1; 49 switch(a) { 50 case 1: a = 2; break; 51 case 2: a = 3; break; 52 } 53 " 54 frame size: 3 55 parameter count: 1 56 bytecode array length: 38 57 bytecodes: [ 58 /* 30 E> */ B(StackCheck), 59 /* 42 S> */ B(LdaSmi), U8(1), 60 B(Star), R(1), 61 B(Star), R(0), 62 /* 45 S> */ B(LdaSmi), U8(1), 63 B(TestEqualStrict), R(0), 64 B(Mov), R(0), R(2), 65 B(JumpIfToBooleanTrue), U8(10), 66 B(LdaSmi), U8(2), 67 B(TestEqualStrict), R(2), 68 B(JumpIfTrue), U8(10), 69 B(Jump), U8(14), 70 /* 66 S> */ B(LdaSmi), U8(2), 71 B(Star), R(1), 72 /* 73 S> */ B(Jump), U8(8), 73 /* 89 S> */ B(LdaSmi), U8(3), 74 B(Star), R(1), 75 /* 96 S> */ B(Jump), U8(2), 76 B(LdaUndefined), 77 /* 105 S> */ B(Return), 78 ] 79 constant pool: [ 80 ] 81 handlers: [ 82 ] 83 84 --- 85 snippet: " 86 var a = 1; 87 switch(a) { 88 case 1: a = 2; // fall-through 89 case 2: a = 3; break; 90 } 91 " 92 frame size: 3 93 parameter count: 1 94 bytecode array length: 36 95 bytecodes: [ 96 /* 30 E> */ B(StackCheck), 97 /* 42 S> */ B(LdaSmi), U8(1), 98 B(Star), R(1), 99 B(Star), R(0), 100 /* 45 S> */ B(LdaSmi), U8(1), 101 B(TestEqualStrict), R(0), 102 B(Mov), R(0), R(2), 103 B(JumpIfToBooleanTrue), U8(10), 104 B(LdaSmi), U8(2), 105 B(TestEqualStrict), R(2), 106 B(JumpIfTrue), U8(8), 107 B(Jump), U8(12), 108 /* 66 S> */ B(LdaSmi), U8(2), 109 B(Star), R(1), 110 /* 98 S> */ B(LdaSmi), U8(3), 111 B(Star), R(1), 112 /* 105 S> */ B(Jump), U8(2), 113 B(LdaUndefined), 114 /* 114 S> */ B(Return), 115 ] 116 constant pool: [ 117 ] 118 handlers: [ 119 ] 120 121 --- 122 snippet: " 123 var a = 1; 124 switch(a) { 125 case 2: break; 126 case 3: break; 127 default: a = 1; break; 128 } 129 " 130 frame size: 3 131 parameter count: 1 132 bytecode array length: 36 133 bytecodes: [ 134 /* 30 E> */ B(StackCheck), 135 /* 42 S> */ B(LdaSmi), U8(1), 136 B(Star), R(1), 137 B(Star), R(0), 138 /* 45 S> */ B(LdaSmi), U8(2), 139 B(TestEqualStrict), R(0), 140 B(Mov), R(0), R(2), 141 B(JumpIfToBooleanTrue), U8(10), 142 B(LdaSmi), U8(3), 143 B(TestEqualStrict), R(2), 144 B(JumpIfTrue), U8(6), 145 B(Jump), U8(6), 146 /* 66 S> */ B(Jump), U8(10), 147 /* 82 S> */ B(Jump), U8(8), 148 /* 99 S> */ B(LdaSmi), U8(1), 149 B(Star), R(1), 150 /* 106 S> */ B(Jump), U8(2), 151 B(LdaUndefined), 152 /* 115 S> */ B(Return), 153 ] 154 constant pool: [ 155 ] 156 handlers: [ 157 ] 158 159 --- 160 snippet: " 161 var a = 1; 162 switch(typeof(a)) { 163 case 2: a = 1; break; 164 case 3: a = 2; break; 165 default: a = 3; break; 166 } 167 " 168 frame size: 3 169 parameter count: 1 170 bytecode array length: 45 171 bytecodes: [ 172 /* 30 E> */ B(StackCheck), 173 /* 42 S> */ B(LdaSmi), U8(1), 174 B(Star), R(1), 175 /* 42 E> */ B(TypeOf), 176 B(Star), R(0), 177 /* 45 S> */ B(LdaSmi), U8(2), 178 B(TestEqualStrict), R(0), 179 B(Mov), R(0), R(2), 180 B(JumpIfToBooleanTrue), U8(10), 181 B(LdaSmi), U8(3), 182 B(TestEqualStrict), R(2), 183 B(JumpIfTrue), U8(10), 184 B(Jump), U8(14), 185 /* 74 S> */ B(LdaSmi), U8(1), 186 B(Star), R(1), 187 /* 81 S> */ B(Jump), U8(14), 188 /* 97 S> */ B(LdaSmi), U8(2), 189 B(Star), R(1), 190 /* 104 S> */ B(Jump), U8(8), 191 /* 121 S> */ B(LdaSmi), U8(3), 192 B(Star), R(1), 193 /* 128 S> */ B(Jump), U8(2), 194 B(LdaUndefined), 195 /* 137 S> */ B(Return), 196 ] 197 constant pool: [ 198 ] 199 handlers: [ 200 ] 201 202 --- 203 snippet: " 204 var a = 1; 205 switch(a) { 206 case typeof(a): a = 1; break; 207 default: a = 2; break; 208 } 209 " 210 frame size: 3 211 parameter count: 1 212 bytecode array length: 31 213 bytecodes: [ 214 /* 30 E> */ B(StackCheck), 215 /* 42 S> */ B(LdaSmi), U8(1), 216 B(Star), R(1), 217 B(Star), R(0), 218 /* 45 S> */ B(TypeOf), 219 B(TestEqualStrict), R(0), 220 B(Mov), R(0), R(2), 221 B(JumpIfToBooleanTrue), U8(4), 222 B(Jump), U8(8), 223 /* 74 S> */ B(LdaSmi), U8(1), 224 B(Star), R(1), 225 /* 81 S> */ B(Jump), U8(8), 226 /* 98 S> */ B(LdaSmi), U8(2), 227 B(Star), R(1), 228 /* 105 S> */ B(Jump), U8(2), 229 B(LdaUndefined), 230 /* 114 S> */ B(Return), 231 ] 232 constant pool: [ 233 ] 234 handlers: [ 235 ] 236 237 --- 238 snippet: " 239 var a = 1; 240 switch(a) { 241 case 1: 242 a = 2; 243 a = 2; 244 a = 2; 245 a = 2; 246 a = 2; 247 a = 2; 248 a = 2; 249 a = 2; 250 a = 2; 251 a = 2; 252 a = 2; 253 a = 2; 254 a = 2; 255 a = 2; 256 a = 2; 257 a = 2; 258 a = 2; 259 a = 2; 260 a = 2; 261 a = 2; 262 a = 2; 263 a = 2; 264 a = 2; 265 a = 2; 266 a = 2; 267 a = 2; 268 a = 2; 269 a = 2; 270 a = 2; 271 a = 2; 272 a = 2; 273 a = 2; 274 a = 2; 275 a = 2; 276 a = 2; 277 a = 2; 278 a = 2; 279 a = 2; 280 a = 2; 281 a = 2; 282 a = 2; 283 a = 2; 284 a = 2; 285 a = 2; 286 a = 2; 287 a = 2; 288 a = 2; 289 a = 2; 290 a = 2; 291 a = 2; 292 a = 2; 293 a = 2; 294 a = 2; 295 a = 2; 296 a = 2; 297 a = 2; 298 a = 2; 299 a = 2; 300 a = 2; 301 a = 2; 302 a = 2; 303 a = 2; 304 a = 2; 305 a = 2; 306 break; 307 case 2: 308 a = 3; 309 break; 310 } 311 " 312 frame size: 3 313 parameter count: 1 314 bytecode array length: 290 315 bytecodes: [ 316 /* 30 E> */ B(StackCheck), 317 /* 42 S> */ B(LdaSmi), U8(1), 318 B(Star), R(1), 319 B(Star), R(0), 320 /* 45 S> */ B(LdaSmi), U8(1), 321 B(TestEqualStrict), R(0), 322 B(Mov), R(0), R(2), 323 B(JumpIfToBooleanTrue), U8(10), 324 B(LdaSmi), U8(2), 325 B(TestEqualStrict), R(2), 326 B(JumpIfTrueConstant), U8(0), 327 B(JumpConstant), U8(1), 328 /* 68 S> */ B(LdaSmi), U8(2), 329 B(Star), R(1), 330 /* 77 S> */ B(LdaSmi), U8(2), 331 B(Star), R(1), 332 /* 86 S> */ B(LdaSmi), U8(2), 333 B(Star), R(1), 334 /* 95 S> */ B(LdaSmi), U8(2), 335 B(Star), R(1), 336 /* 104 S> */ B(LdaSmi), U8(2), 337 B(Star), R(1), 338 /* 113 S> */ B(LdaSmi), U8(2), 339 B(Star), R(1), 340 /* 122 S> */ B(LdaSmi), U8(2), 341 B(Star), R(1), 342 /* 131 S> */ B(LdaSmi), U8(2), 343 B(Star), R(1), 344 /* 140 S> */ B(LdaSmi), U8(2), 345 B(Star), R(1), 346 /* 149 S> */ B(LdaSmi), U8(2), 347 B(Star), R(1), 348 /* 158 S> */ B(LdaSmi), U8(2), 349 B(Star), R(1), 350 /* 167 S> */ B(LdaSmi), U8(2), 351 B(Star), R(1), 352 /* 176 S> */ B(LdaSmi), U8(2), 353 B(Star), R(1), 354 /* 185 S> */ B(LdaSmi), U8(2), 355 B(Star), R(1), 356 /* 194 S> */ B(LdaSmi), U8(2), 357 B(Star), R(1), 358 /* 203 S> */ B(LdaSmi), U8(2), 359 B(Star), R(1), 360 /* 212 S> */ B(LdaSmi), U8(2), 361 B(Star), R(1), 362 /* 221 S> */ B(LdaSmi), U8(2), 363 B(Star), R(1), 364 /* 230 S> */ B(LdaSmi), U8(2), 365 B(Star), R(1), 366 /* 239 S> */ B(LdaSmi), U8(2), 367 B(Star), R(1), 368 /* 248 S> */ B(LdaSmi), U8(2), 369 B(Star), R(1), 370 /* 257 S> */ B(LdaSmi), U8(2), 371 B(Star), R(1), 372 /* 266 S> */ B(LdaSmi), U8(2), 373 B(Star), R(1), 374 /* 275 S> */ B(LdaSmi), U8(2), 375 B(Star), R(1), 376 /* 284 S> */ B(LdaSmi), U8(2), 377 B(Star), R(1), 378 /* 293 S> */ B(LdaSmi), U8(2), 379 B(Star), R(1), 380 /* 302 S> */ B(LdaSmi), U8(2), 381 B(Star), R(1), 382 /* 311 S> */ B(LdaSmi), U8(2), 383 B(Star), R(1), 384 /* 320 S> */ B(LdaSmi), U8(2), 385 B(Star), R(1), 386 /* 329 S> */ B(LdaSmi), U8(2), 387 B(Star), R(1), 388 /* 338 S> */ B(LdaSmi), U8(2), 389 B(Star), R(1), 390 /* 347 S> */ B(LdaSmi), U8(2), 391 B(Star), R(1), 392 /* 356 S> */ B(LdaSmi), U8(2), 393 B(Star), R(1), 394 /* 365 S> */ B(LdaSmi), U8(2), 395 B(Star), R(1), 396 /* 374 S> */ B(LdaSmi), U8(2), 397 B(Star), R(1), 398 /* 383 S> */ B(LdaSmi), U8(2), 399 B(Star), R(1), 400 /* 392 S> */ B(LdaSmi), U8(2), 401 B(Star), R(1), 402 /* 401 S> */ B(LdaSmi), U8(2), 403 B(Star), R(1), 404 /* 410 S> */ B(LdaSmi), U8(2), 405 B(Star), R(1), 406 /* 419 S> */ B(LdaSmi), U8(2), 407 B(Star), R(1), 408 /* 428 S> */ B(LdaSmi), U8(2), 409 B(Star), R(1), 410 /* 437 S> */ B(LdaSmi), U8(2), 411 B(Star), R(1), 412 /* 446 S> */ B(LdaSmi), U8(2), 413 B(Star), R(1), 414 /* 455 S> */ B(LdaSmi), U8(2), 415 B(Star), R(1), 416 /* 464 S> */ B(LdaSmi), U8(2), 417 B(Star), R(1), 418 /* 473 S> */ B(LdaSmi), U8(2), 419 B(Star), R(1), 420 /* 482 S> */ B(LdaSmi), U8(2), 421 B(Star), R(1), 422 /* 491 S> */ B(LdaSmi), U8(2), 423 B(Star), R(1), 424 /* 500 S> */ B(LdaSmi), U8(2), 425 B(Star), R(1), 426 /* 509 S> */ B(LdaSmi), U8(2), 427 B(Star), R(1), 428 /* 518 S> */ B(LdaSmi), U8(2), 429 B(Star), R(1), 430 /* 527 S> */ B(LdaSmi), U8(2), 431 B(Star), R(1), 432 /* 536 S> */ B(LdaSmi), U8(2), 433 B(Star), R(1), 434 /* 545 S> */ B(LdaSmi), U8(2), 435 B(Star), R(1), 436 /* 554 S> */ B(LdaSmi), U8(2), 437 B(Star), R(1), 438 /* 563 S> */ B(LdaSmi), U8(2), 439 B(Star), R(1), 440 /* 572 S> */ B(LdaSmi), U8(2), 441 B(Star), R(1), 442 /* 581 S> */ B(LdaSmi), U8(2), 443 B(Star), R(1), 444 /* 590 S> */ B(LdaSmi), U8(2), 445 B(Star), R(1), 446 /* 599 S> */ B(LdaSmi), U8(2), 447 B(Star), R(1), 448 /* 608 S> */ B(LdaSmi), U8(2), 449 B(Star), R(1), 450 /* 617 S> */ B(LdaSmi), U8(2), 451 B(Star), R(1), 452 /* 626 S> */ B(LdaSmi), U8(2), 453 B(Star), R(1), 454 /* 635 S> */ B(LdaSmi), U8(2), 455 B(Star), R(1), 456 /* 644 S> */ B(Jump), U8(8), 457 /* 662 S> */ B(LdaSmi), U8(3), 458 B(Star), R(1), 459 /* 671 S> */ B(Jump), U8(2), 460 B(LdaUndefined), 461 /* 680 S> */ B(Return), 462 ] 463 constant pool: [ 464 262, 465 266, 466 ] 467 handlers: [ 468 ] 469 470 --- 471 snippet: " 472 var a = 1; 473 switch(a) { 474 case 1: 475 switch(a + 1) { 476 case 2 : a = 1; break; 477 default : a = 2; break; 478 } // fall-through 479 case 2: a = 3; 480 } 481 " 482 frame size: 5 483 parameter count: 1 484 bytecode array length: 59 485 bytecodes: [ 486 /* 30 E> */ B(StackCheck), 487 /* 42 S> */ B(LdaSmi), U8(1), 488 B(Star), R(2), 489 B(Star), R(0), 490 /* 45 S> */ B(LdaSmi), U8(1), 491 B(TestEqualStrict), R(0), 492 B(Mov), R(0), R(3), 493 B(JumpIfToBooleanTrue), U8(10), 494 B(LdaSmi), U8(2), 495 B(TestEqualStrict), R(3), 496 B(JumpIfTrue), U8(33), 497 B(Jump), U8(35), 498 B(LdaSmi), U8(1), 499 /* 77 E> */ B(Add), R(2), 500 B(Star), R(1), 501 /* 70 S> */ B(LdaSmi), U8(2), 502 B(TestEqualStrict), R(1), 503 B(Mov), R(1), R(4), 504 B(JumpIfToBooleanTrue), U8(4), 505 B(Jump), U8(8), 506 /* 101 S> */ B(LdaSmi), U8(1), 507 B(Star), R(2), 508 /* 108 S> */ B(Jump), U8(8), 509 /* 131 S> */ B(LdaSmi), U8(2), 510 B(Star), R(2), 511 /* 138 S> */ B(Jump), U8(2), 512 /* 176 S> */ B(LdaSmi), U8(3), 513 B(Star), R(2), 514 B(LdaUndefined), 515 /* 185 S> */ B(Return), 516 ] 517 constant pool: [ 518 ] 519 handlers: [ 520 ] 521 522