Commit 8f724fb
[asm-cherry-pick] Call interpreter.copyInstruction consistently
Before this change, `Frame.execute` did not invoke the interpreter's
`copyInstruction` method for all values that are pushed on the frame's
when executing some copying instructions.
For example, in the case of SWAP, copyInstruction is invoked:
value2 = pop();
value1 = pop();
push(interpreter.copyOperation(insn, value2));
push(interpreter.copyOperation(insn, value1));
For DUP on the other hand, the original value is pushed onto the
stack without notifying the interpreter:
value1 = pop();
push(value1);
push(interpreter.copyOperation(insn, value1));
This leads to a problem for the `SourceInterpreter`, which collects
for every value a set of potential producer instructions. Given the
bytecode sequence
NEW java/lang/Object
DUP
INVOKESPECIAL java/lang/Object.<init> ()V
In the frame of the INVOKESPECIAL instruction, the value on the stack
lists as its producer the `NEW` operation instead of the `DUP`, which
not expected.1 parent 92dd58a commit 8f724fb
1 file changed
+23
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | | - | |
| 374 | + | |
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
385 | | - | |
| 384 | + | |
| 385 | + | |
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | | - | |
399 | | - | |
| 398 | + | |
| 399 | + | |
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
405 | | - | |
| 405 | + | |
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
419 | | - | |
420 | | - | |
421 | | - | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
429 | | - | |
430 | | - | |
| 429 | + | |
| 430 | + | |
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
455 | | - | |
456 | | - | |
457 | | - | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
| |||
654 | 654 | | |
655 | 655 | | |
656 | 656 | | |
657 | | - | |
658 | | - | |
659 | | - | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
660 | 660 | | |
661 | 661 | | |
662 | 662 | | |
663 | 663 | | |
664 | | - | |
665 | | - | |
| 664 | + | |
| 665 | + | |
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
| |||
0 commit comments