MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / getAsmOpcode

Function getAsmOpcode

lib/asm-docs/generated/asm-docs-java.ts:3–1165  ·  view source on GitHub ↗
(opcode: string | undefined)

Source from the content-addressed store, hash-verified

1import type {AssemblyInstructionInfo} from '../../../types/assembly-docs.interfaces.js';
2
3export function getAsmOpcode(opcode: string | undefined): AssemblyInstructionInfo | undefined {
4 if (!opcode) return;
5 switch (opcode.toUpperCase()) {
6 case 'AALOAD':
7 return {
8 url: `https://docs.oracle.com/javase/specs/jvms/se18/html/jvms-6.html#jvms-6.5.aaload`,
9 html: `<p>Instruction aaload: Load reference from array </p><p>Format: aaload</p><p>Operand Stack: ..., <span class="emphasis"><em>arrayref</em></span>, <span class="emphasis"><em>index</em></span> <span class="symbol">→</span> ..., <span class="emphasis"><em>value</em></span></p><p><a name="jvms-6.5.aaload.desc-100"></a> The <span class="emphasis"><em>arrayref</em></span> must be of type <code class="literal">reference</code> and must refer to an array whose components are of type <code class="literal">reference</code>. The <span class="emphasis"><em>index</em></span> must be of type <code class="literal">int</code>. Both <span class="emphasis"><em>arrayref</em></span> and <span class="emphasis"><em>index</em></span> are popped from the operand stack. The <code class="literal">reference</code> <span class="emphasis"><em>value</em></span> in the component of the array at <span class="emphasis"><em>index</em></span> is retrieved and pushed onto the operand stack. </p>`,
10 tooltip: `Load reference from array `,
11 };
12 case 'AASTORE':
13 return {
14 url: `https://docs.oracle.com/javase/specs/jvms/se18/html/jvms-6.html#jvms-6.5.aastore`,
15 html: `<p>Instruction aastore: Store into reference array </p><p>Format: aastore</p><p>Operand Stack: ..., <span class="emphasis"><em>arrayref</em></span>, <span class="emphasis"><em>index</em></span>, <span class="emphasis"><em>value</em></span> <span class="symbol">→</span> ...</p><p><a name="jvms-6.5.aastore.desc-100"></a> The <span class="emphasis"><em>arrayref</em></span> must be of type <code class="literal">reference</code> and must refer to an array whose components are of type <code class="literal">reference</code>. The <span class="emphasis"><em>index</em></span> must be of type <code class="literal">int</code>, and <span class="emphasis"><em>value</em></span> must be of type <code class="literal">reference</code>. The <span class="emphasis"><em>arrayref</em></span>, <span class="emphasis"><em>index</em></span>, and <span class="emphasis"><em>value</em></span> are popped from the operand stack. </p>`,
16 tooltip: `Store into reference array `,
17 };
18 case 'ACONST_NULL':
19 return {
20 url: `https://docs.oracle.com/javase/specs/jvms/se18/html/jvms-6.html#jvms-6.5.aconst_null`,
21 html: `<p>Instruction aconst_null: Push null</p><p>Format: aconst_null</p><p>Operand Stack: ... <span class="symbol">→</span> ..., <code class="literal">null</code></p><p><a name="jvms-6.5.aconst_null.desc-100"></a> Push the <code class="literal">null</code> object <code class="literal">reference</code> onto the operand stack. </p>`,
22 tooltip: `Push null`,
23 };
24 case 'ALOAD':
25 return {
26 url: `https://docs.oracle.com/javase/specs/jvms/se18/html/jvms-6.html#jvms-6.5.aload`,
27 html: `<p>Instruction aload: Load reference from local variable </p><p>Format: aload index</p><p>Operand Stack: ... <span class="symbol">→</span> ..., <span class="emphasis"><em>objectref</em></span></p><p><a name="jvms-6.5.aload.desc-100"></a> The <span class="emphasis"><em>index</em></span> is an unsigned byte that must be an index into the local variable array of the current frame (<a class="xref" href="https://docs.oracle.com/javase/specs/jvms/se18/html/jvms-2.html#jvms-2.6" title="2.6.&nbsp;Frames">§2.6</a>). The local variable at <span class="emphasis"><em>index</em></span> must contain a <code class="literal">reference</code>. The <span class="emphasis"><em>objectref</em></span> in the local variable at <span class="emphasis"><em>index</em></span> is pushed onto the operand stack. </p>`,
28 tooltip: `Load reference from local variable `,
29 };
30 case 'ALOAD_0':
31 return {
32 url: `https://docs.oracle.com/javase/specs/jvms/se18/html/jvms-6.html#jvms-6.5.aload_n`,
33 html: `<p>Instruction aload_0: Load reference from local variable </p><p>Format: aload_[n]</p><p>Operand Stack: ... <span class="symbol">→</span> ..., <span class="emphasis"><em>objectref</em></span></p><p><a name="jvms-6.5.aload_n.desc-100"></a> The &lt;<span class="emphasis"><em>n</em></span>&gt; must be an index into the local variable array of the current frame (<a class="xref" href="https://docs.oracle.com/javase/specs/jvms/se18/html/jvms-2.html#jvms-2.6" title="2.6.&nbsp;Frames">§2.6</a>). The local variable at &lt;<span class="emphasis"><em>n</em></span>&gt; must contain a <code class="literal">reference</code>. The <span class="emphasis"><em>objectref</em></span> in the local variable at &lt;<span class="emphasis"><em>n</em></span>&gt; is pushed onto the operand stack. </p>`,
34 tooltip: `Load reference from local variable `,
35 };
36 case 'ALOAD_1':
37 return {
38 url: `https://docs.oracle.com/javase/specs/jvms/se18/html/jvms-6.html#jvms-6.5.aload_n`,
39 html: `<p>Instruction aload_1: Load reference from local variable </p><p>Format: aload_[n]</p><p>Operand Stack: ... <span class="symbol">→</span> ..., <span class="emphasis"><em>objectref</em></span></p><p><a name="jvms-6.5.aload_n.desc-100"></a> The &lt;<span class="emphasis"><em>n</em></span>&gt; must be an index into the local variable array of the current frame (<a class="xref" href="https://docs.oracle.com/javase/specs/jvms/se18/html/jvms-2.html#jvms-2.6" title="2.6.&nbsp;Frames">§2.6</a>). The local variable at &lt;<span class="emphasis"><em>n</em></span>&gt; must contain a <code class="literal">reference</code>. The <span class="emphasis"><em>objectref</em></span> in the local variable at &lt;<span class="emphasis"><em>n</em></span>&gt; is pushed onto the operand stack. </p>`,
40 tooltip: `Load reference from local variable `,
41 };
42 case 'ALOAD_2':
43 return {
44 url: `https://docs.oracle.com/javase/specs/jvms/se18/html/jvms-6.html#jvms-6.5.aload_n`,
45 html: `<p>Instruction aload_2: Load reference from local variable </p><p>Format: aload_[n]</p><p>Operand Stack: ... <span class="symbol">→</span> ..., <span class="emphasis"><em>objectref</em></span></p><p><a name="jvms-6.5.aload_n.desc-100"></a> The &lt;<span class="emphasis"><em>n</em></span>&gt; must be an index into the local variable array of the current frame (<a class="xref" href="https://docs.oracle.com/javase/specs/jvms/se18/html/jvms-2.html#jvms-2.6" title="2.6.&nbsp;Frames">§2.6</a>). The local variable at &lt;<span class="emphasis"><em>n</em></span>&gt; must contain a <code class="literal">reference</code>. The <span class="emphasis"><em>objectref</em></span> in the local variable at &lt;<span class="emphasis"><em>n</em></span>&gt; is pushed onto the operand stack. </p>`,
46 tooltip: `Load reference from local variable `,
47 };
48 case 'ALOAD_3':
49 return {
50 url: `https://docs.oracle.com/javase/specs/jvms/se18/html/jvms-6.html#jvms-6.5.aload_n`,
51 html: `<p>Instruction aload_3: Load reference from local variable </p><p>Format: aload_[n]</p><p>Operand Stack: ... <span class="symbol">→</span> ..., <span class="emphasis"><em>objectref</em></span></p><p><a name="jvms-6.5.aload_n.desc-100"></a> The &lt;<span class="emphasis"><em>n</em></span>&gt; must be an index into the local variable array of the current frame (<a class="xref" href="https://docs.oracle.com/javase/specs/jvms/se18/html/jvms-2.html#jvms-2.6" title="2.6.&nbsp;Frames">§2.6</a>). The local variable at &lt;<span class="emphasis"><em>n</em></span>&gt; must contain a <code class="literal">reference</code>. The <span class="emphasis"><em>objectref</em></span> in the local variable at &lt;<span class="emphasis"><em>n</em></span>&gt; is pushed onto the operand stack. </p>`,
52 tooltip: `Load reference from local variable `,
53 };
54 case 'ANEWARRAY':
55 return {
56 url: `https://docs.oracle.com/javase/specs/jvms/se18/html/jvms-6.html#jvms-6.5.anewarray`,
57 html: `<p>Instruction anewarray: Create new array of reference</p><p>Format: anewarray indexbyte1 indexbyte2</p><p>Operand Stack: ..., <span class="emphasis"><em>count</em></span> <span class="symbol">→</span> ..., <span class="emphasis"><em>arrayref</em></span></p><p><a name="jvms-6.5.anewarray.desc-100"></a> The <span class="emphasis"><em>count</em></span> must be of type <code class="literal">int</code>. It is popped off the operand stack. The <span class="emphasis"><em>count</em></span> represents the number of components of the array to be created. The unsigned <span class="emphasis"><em>indexbyte1</em></span> and <span class="emphasis"><em>indexbyte2</em></span> are used to construct an index into the run-time constant pool of the current class (<a class="xref" href="https://docs.oracle.com/javase/specs/jvms/se18/html/jvms-2.html#jvms-2.6" title="2.6.&nbsp;Frames">§2.6</a>), where the value of the index is (<span class="emphasis"><em>indexbyte1</em></span> <code class="literal">&lt;&lt;</code> 8) | <span class="emphasis"><em>indexbyte2</em></span>. The run-time constant pool entry at the index must be a symbolic reference to a class, array, or interface type. The named class, array, or interface type is resolved (<a class="xref" href="https://docs.oracle.com/javase/specs/jvms/se18/html/jvms-5.html#jvms-5.4.3.1" title="5.4.3.1.&nbsp;Class and Interface Resolution">§5.4.3.1</a>). A new array with components of that type, of length <span class="emphasis"><em>count</em></span>, is allocated from the garbage-collected heap, and a <code class="literal">reference</code> <span class="emphasis"><em>arrayref</em></span> to this new array object is pushed onto the operand stack. All components of the new array are initialized to <code class="literal">null</code>, the default value for <code class="literal">reference</code> types (<a class="xref" href="https://docs.oracle.com/javase/specs/jvms/se18/html/jvms-2.html#jvms-2.4" title="2.4.&nbsp;Reference Types and Values">§2.4</a>). </p>`,
58 tooltip: `Create new array of reference`,
59 };
60 case 'ARETURN':

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected