File: Checkcast.j

package info (click to toggle)
jasmin-sable 2.4.0-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,232 kB
  • ctags: 1,458
  • sloc: java: 9,167; xml: 109; makefile: 19; csh: 16; sh: 1
file content (35 lines) | stat: -rw-r--r-- 774 bytes parent folder | download | duplicates (7)
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
; --- Copyright Jonathan Meyer 1996. All rights reserved. -----------------
; File:      jasmin/examples/Checkcast.j
; Author:    Jonathan Meyer, 10 July 1996
; Purpose:   Catching and throwing exceptions
; -------------------------------------------------------------------------



;
; Simple test for checkcast instruction
;

.class examples/Checkcast
.super java/lang/Object

;
; standard initializer
.method public <init>()V
   aload_0
   invokenonvirtual java/lang/Object/<init>()V
   return
.end method

.method public static main([Ljava/lang/String;)V
   .limit stack 2

   ; push System.out onto the stack
   getstatic java/lang/System/out Ljava/io/PrintStream;

   ; check that it is a PrintStream
   checkcast java/io/PrintStream

   ; done
   return
.end method