Duplicate top operand stack word and put three down
Bytecode
Type | Description |
u1 | dup_x2 = 0x5B (91) |
Stack ..., word3, word2, word1 => ..., word1, word3, word2, word1
Description
Duplicates the top single-word stack item inserts the duplicate three words down.
The top word on the operand stack is duplicated and the copy inserted three words down in the operand stack.
The dup_x2 instruction must not be used unless each of word2 and word3 is a word that contains a 32-bit data type or together are the two words of a single 64-bit datum, and unless word1 contains a 32-bit data type.
Except for restrictions preserving the integrity of 64-bit data types, the dup_x2 instruction operates on untyped words, ignoring the types of the data they contain.
This instruction cannot be used if the top item on the stack is a two-word item (i.e. a long or a double-precision float). Use dup2, dup2_x1 or dup2_x2 instead.
Example
dconst_0 bipush 100 ; stack now contains: ; 0.0 | double-word1 ; 0.0 | double-word2 ; 100 integer dup_x2 ; stack now contains: ; 100 integer1 ; 0.0 | double-word1 ; 0.0 | double-word2 ; 100 integer1