dastore 0x52

Pops an array, an index and a double value; stores the value in the array.

Opcode
0x52 (82)
Family
Arrays
Operands
none
Length
1 byte
Operand stack
…, arrayref, index, value (double) → …
Can throw
NullPointerException, ArrayIndexOutOfBoundsException

What it does

Pops an array (double[]), an index and a value; stores the value at that index.

How often javac uses it

In JDK 25.0.5's java.base module, dastore appears 1,272 times in 29 of its 7,391 classes: 0.07% of all instructions, the 102nd most common of 194 opcodes in use. Some of the methods that use it: java.io.ObjectInputStream$BlockDataInputStream.readDoubles, java.lang.FdLibm$Atan.<clinit>, java.lang.FdLibm$Exp.<clinit>, java.lang.FdLibm$KernelRemPio2.__kernel_rem_pio2.

Example

From the sample classes, compiled by javac 25 with -g. Each Java line is shown above the bytecode it compiled to; dastore is highlighted.

static int arrays(int n) in Tour, compiled by javac 25
… 57 instructions before
68z[0] = true; b[0] = 1; c[0] = 'a'; s[0] = 2; i[0] = 3; l[0] = 4; f[0] = 5; d[0] = 6; str[0] = "x"; grid[0][0] = 7;
84ldc #22// 5
87aload 8// d
90ldc2_w #23// 6
94aload 9// str
97ldc #25// "x"
100aload 10// grid
… 57 instructions after

Open in the viewer

Related instructions

daload Pops an array and an index; pushes the double element.arraylength Pops an array; pushes its length.newarray Pops a length; pushes a new array of a primitive type.

Specification: JVMS §6.5, dastore (Java SE 25).