Java Virtual Machine (Java Series)
dup2
dup2 Stack
Before | After |
| word1 | word1 |
| word2 | word2 |
| ... | word1 |
| word2 | |
| ... |
Duplicates the top two words on the stack and pushes the duplicates onto the stack in the same order. You can use this to duplicate two single-word items (e.g. two integers, or an integer and an object reference) or one two-word item (i.e. a double or a long).
Bytecode
Type | Description |
| u1 | dup2 opcode = 0x5C (92) |
dup, dup_x1, dup2_x1, dup2_x2
prev next contents
Java Virtual Machine, by Jon Meyer and Troy Downing, O'Reilly Associates
Категории