-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJVMNastyVarargs.j
51 lines (37 loc) · 967 Bytes
/
JVMNastyVarargs.j
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
; --- Copyright Jonathan Meyer 1996. All rights reserved. -----------------
; File: jasmin/examples/NewArray.j
; Author: Jonathan Meyer, 10 July 1996
; Purpose: Example of newarray
; -------------------------------------------------------------------------
;
; Example showing how to allocate an array using
; newarray.
;
.class public JVMNastyVarargs
.super java/lang/Object
.method public <init>()V
aload_0
invokenonvirtual java/lang/Object/<init>()V
return
.end method
.method public static wee()V;
.end method
.method public static main([Ljava/lang/String;)V
.limit stack 4
.limit locals 2
invokestatic JVMNastyVarargs.wee()V
; ; create an array like:
; ;
; ; boolean b[] = new boolean[2]
; ;
; ; (stores it in local var 1)
; iconst_2
; newarray boolean
; astore_1
; ; b[0] = true;
; aload_1
; iconst_0
; iconst_1
; bastore
return
.end method