CSC 8505 Handout : JVM & Jasmin
|
|
|
- Karin Oliver
- 9 years ago
- Views:
Transcription
1 CSC 8505 Handout : JVM & Jasmin Note: This handout provides you with the basic information about JVM. Although we tried to be accurate about the description, there may be errors. Feel free to check your compiler s output (JVM code in Jasmin syntax) with that of javac. To achieve this, you need to write a Java class equivalent to your C program, then compile it and then disassemble the generated.class file using D-Java with o jasmin flag (see page 10 for an example). 1. JVM Basics The Java Virtual Machine (JVM) specifies the following: A set of instructions and their semantics A binary format of class files An algorithm to verify virtual machine code for integrity. Properties of the JVM It is a virtual machine. The specification was designed independent of existing architectures. Unlike concrete architectures, JVM does not allow access to specific memory locations. This approach can provide a better program security. The JVM has the following organization: The class area stores information associated with the class, e.g., fields, methods. The heap stores objects associated with the class. The Java stack is a higher-level stack, which maintains stack frames corresponding to methods. The top frame is current/active. In addition, each stack frame contains an operand stack and an array of local variables. One or two stack-top elements are popped from the stack, an arithmetic operation is performed on them, and the result is pushed on the stack. Each stack frame may contain up to 256 local variables. There are a number of relatively high-level JVM instructions (compared to assembly languages for concrete architectures). Thus, while JVM programming follows the format of assembly language programming, it also retains the flavor of Java programming, esp. with respect to object handling. 1
2 2. Jasmin Code Structure Since Java class files are hard to read, we use Jasmin as the target language of our compiler. Assembling Jasmin code to a class file and disassembling a class file to a Jasmin code can be done by Jasmin and D-Java, respectively (refer to the project handout for the detail). A Jasmin code consists of the following four sections: The comment area provides the developer and source file information. Jasmin comments are of the end-of-line type and begins with a semicolon ;. Comments can appear anywhere. For example: ; Output created by D-Java (mailto:[email protected]) ; ;Classfile version: ; Major: 49 ; Minor: 0 The header area contains the following three lines..source.class.super Test.java synchronized Test java/lang/object The field area contains field declarations. For example, the following line corresponds to the field (in Java) public static int x;..field public static x I The method area contains method/constructor declarations. For example, the default constructor of a class is realized as a JVM method as follows: ; >> METHOD 1 <<.method <init>()v.limit stack 1.limit locals 1 2
3 .line 1 aload_0 invokenonvirtual java/lang/object/<init>()v return ; >> METHOD 2 <<.method public static f(i)v.limit stack 2.limit locals 2.line 12 iload_0 sipush 300 iadd istore_1.line 13 return 3. Jasmin Directives Jasmin directives are not JVM instructions, but controls Jasmin assembler by providing meta-level information. All Jasmin directives begin with a period.. We need to know the following directives for our project. The required lines in header section:.source,.class, and.super Pattern:.source <source file name>.class synchronized <class name>.super <super class name> (java/lang/object by default) To declare fields:.field Pattern:.field <modifiers> <variable name> <type descriptor> Note: We ll have public static as modifiers. See the next section about type descriptors. To indicate the beginning of a method:.method Pattern (method):.method <modifiers> <class name>/<method name>(<arguments>)<return type> Pattern (constructor):.method <init>(<arguments>)v Note: We ll have public static as modifiers. <arguments> are sequence of type descriptors and <return type> is a type descriptor. See the next section about type descriptors. To indicate the end:.end (e.g., end of a method) To set the limit on the operand stack depth or the size of the local variable array:.limit.limit stack <number>.limit locals <number> Note: You may use a reasonably high, fixed value, say 32, as the limit. Exact limit requires 3
4 analysis..line: To indicate the line number in the source file. Note: You do not need to generate this. 4. Types in Jasmin Codes Data types in Jasmin codes are indicated by the following two means. Type descriptor: Type information used for field declaration, argument/return type specification, etc. E.g.,.field public static x I.method public static f(i)v Type mnemonic: A part of a JVM instruction that corresponds to a Java type. Type mnemonic often appears as the first character of JVM instructions, written in lower case. E.g., iadd ; add ints fadd ; add floats The following table shows type descriptor and type mnemonic with the corresponding Java type. Note: In our project, only those in bold face will be needed. 5. Data Operations In this and the following several sections, we overview JVM instructions used in Jasmin codes. Complete listing is available online. See as well as This section introduces instructions for data operations. JVM does not have a separate Boolean type. Integer constant 1 is treated as TRUE and integer constant 0 is treated as FALSE. 4
5 The above table looks rather complicated. But all you need is the ones in bold face. The reason why there are so many similar instructions for some data types is as follows. JVM instructions are all byte length. This means that we can only have 256 instructions. Notice that an instruction such as load 0 is much more frequently used than, say, load If we allocate an instruction for frequently used operands, we can reduce the size of the class file and also achieve optimized interpretation of such codes. So, for operands of small numbers, more specialized JVM instructions are prepared. For example, while you can write ldc 0 (1+4 bytes), you may also write sipush 0 (1+2 bytes), bipush 0 (1+1 byte), or iconst_0 (1 byte). You will see all of these instructions when you disassemble (by D-Java) a class. You can reduce the code size and increase the performance by choosing a more optimal instruction. Note that efficiency/speed is not the issue in our project and you can use the most general forms (in bold face) for each data type and operation. See the example at the end of the next section. 5
6 6. Arithmetic Operations Arithmetic operations are always performed on the top one or two elements on the stack and returns the result on the top of the stack. The following example illustrates the use of data/arithmetic operations: ; y = x * 2, assume y is local variable #2 and x is local variable #1 iload 1 ; push value of x ldc 2 ; push 2. can be replaced by shorter iconst_2 imul ; pop the top two values, multiply and push the result istore 2 ; pop and store the top value in y 7. Method Operations There are two return instructions: return and ireturn. While return simply returns from the method, ireturn returns the stack top. Method invocation involves three different instructions: invokenonvirtual/invokespecial: To invoke a constructor or a private method. The second one is a replacement of the first one in newer JDKs. But both of them can still be used. invokevirtual: To invoke a public non-static method. invokestatic: To invoke a static method. Static method (function) call pattern (analogous for other method call instructions): <push arg_1> <push arg_2> <push arg_n> invokestatic <class name>/<method name>(<arguments>)<return type> As before, <arguments> are sequence of type descriptors and <return type> is a type descriptor. For non-static methods, use invokevirtual instruction instead. Also, the first parameter to be pushed is the object reference. For example, the following corresponds to calling a static method (function) f(x,3) in a class Class1 where x is the local variable # 0 and the method s return type is int: iload 0 ldc 3 invokestatic Class1/f(II)I 6
7 8. Flow Control The destination of jump can be indicated by a label like in other assembly languages. To unconditionally jump to a label, use goto label. For conditional jump, there are branching instructions that branch based on the top of stack being zero (e.g., ifeq label) and there are branching instructions that compare the top two values to determine the jump. For this latter group of instructions, two values must be pushed on to the stack: if_icmpeq label if_icmpne label if_icmplt label if_icmple label if_icmpgt label if_icmpge label ; Jump to the label if the top two values on the stack are equal ; Jump to the label if the top two values on the stack are not equal ; Jump f the first-pushed value is less than the second-pushed value ; Jump if the first value is less than or equal to the second value ; Jump if the first value is greater than the second value ; Jump if the first value is greater than or equal to the second value The following example corresponds to y = x < 20; where x is the local variable # 0 and y is local vaiable # 1: iload 0 ldc 20 if_icmplt Label2 ldc 0 goto Label1 Label2: ldc 1 Label1: istore 1 The following example corresponds to if (x < 3) y = 10; else y = 20; where x is the local variable # 0 and y is a static variable of class ifex (see next section): iload 0 ldc 3 if_icmplt Label2 ldc 0 goto Label1 Label2: ldc 1 Label1: ifeq Label3 ldc 10 putstatic ifex/y I goto Label4 Label3: ldc 20 putstatic ifex/y I Label4: If you examine the generated code above, you ll realize that a better code can be generated in this case since we do not actually compute and store the value of the conditional expression. We can simply make use of the two-value conditional jump instruction to jump to the `then or the `else 7
8 part. This requires carrying a context. You need not worry about this detail in your project. Here is a better code for the same statement: iload_0 iconst_3 if_icmpge Label1 bipush 10 putstatic ifex/y I goto Label2 Label1: bipush 20 putstatic ifex/y I Label2: Note that the interpretation of the conditional in the source language is reversed. That is, the conditional jump is when the condition is false. 9. Field Access/Assignment To access fields in a class Class1, the following instructions can be used: To access a static field getstatic Class1/y I To access a non-static field aload_0 getfield Class1/x I To assign a value to a static field in Class1 ldc 123 putstatic Class1/y I To assign a value to a non-static field aload_0 ldc 456 putfield Class1/x I Note that to access a non-static field, we need to push the (reference to) current object which is assumed stored in the local variable # Array Processing In order to allocate an array field, we need to specify the array type descriptor, e.g., [I. To allocate a local array variable, we simply reserve a local variable for it. So, there will be no corresponding Jasmin code for a declaration int[] x; much like a non-array declaration. To create an actual array (object), we need to use the instruction newarray. To access and assign array elements, we need iaload and iastore, respectively. The following example illustrates this situation. Here, let s assume that x and y are represented as local variables # 1 and # 2, 8
9 respectively. C-: int x[5]; Jasmin: ldc 5 newarray int ; create a new array object astore 1 ; store the reference into x C-/Java: x[2] = 123; Jasmin: aload 1 ; array reference ldc 2 ; index value ldc 123 iastore ; value to be stored ; stores into apecified array location C-/Java: y = x[2]; Jasmin: aload 1 ldc 2 iaload istore 2 Note: For static arrays, use getstatic instead of aload. For example, if x were a static array of class Class1, then getstatic Class1/x [I instead of aload 1. Also, in this case the creation of array will use putstatic Class1/a [I instead of astore 1. 9
10 Appendix A. C to Java to Jasmin Code Example An Example C Program int i; Global Variables i and a[10] int a[10]; void f(int x) Local Variable #0, x { int y; Local Variable #1, y int g(int b, int c[] ) Local Variable #0, b { int z[5]; Local Variable #1, c[] Local Variable #2, z void main(void) { int w; Local Variable #1, w (Not 0 Since Java s main requires String[] which is variable #0) It s Java Equivalent class someclass { public static int i; Class/static variable i public static int[] a = new int[10]; Class/static variable a public static void f( int x ) Class/static method f { int y; x is local variable #0 y is local variable #1 public static int g(int b, int []c) b is local variable #0 { int[] z = new int [5]; c is local variable #1 z is local variable #2 public static void main (String[] args) Java requires args { int w; args is local variable #0 w is local variable #1 10
11 The Complete C-/Java Program int i; int a[10]; void f(int x) { int y; y = x + 300; int g(int b, int[] c) { int z[5]; z[2] = b + c[3]; return z[2]; void main(void) { int w; w = g(i, a); class SomeClass { public static int i; public static int[] a = new int[10]; public static void f(int x) { int y; y = x + 300; public static int g(int b, int[] c) { int[] z = new int[5]; z[2] = b + c[3]; return z[2]; public static void main(string[] args) { int w; w = g(i, a); 11
12 Jasmin Code Note: The file was first compiled using javac and then disassembled with D-Java with o jasmin flag. ; ; Output created by D-Java (mailto:[email protected]) ; ;Classfile version: ; Major: 49 ; Minor: 0.source SomeClass.java.class synchronized SomeClass.super java/lang/object.field public static i I.field public static a [I ; >> METHOD 1 <<.method <init>()v.limit stack 1.limit locals 1.line 1 aload_0 invokenonvirtual java/lang/object/<init>()v return ; >> METHOD 2 <<.method public static f(i)v.limit stack 2.limit locals 2.line 9 iload_0 sipush 300 iadd istore_1.line 10 return ; >> METHOD 3 <<.method public static g(i[i)i.limit stack 5.limit locals 3.line 13 iconst_5 newarray int astore_2.line 14 aload_2 iconst_2 iload_0 aload_1 iconst_3 12
13 iaload iadd iastore.line 15 aload_2 iconst_2 iaload ireturn ; >> METHOD 4 <<.method public static main([ljava/lang/string;)v.limit stack 2.limit locals 2.line 20 getstatic SomeClass/i I getstatic SomeClass/a [I invokestatic SomeClass/g(I[I)I istore_1.line 21 return ; >> METHOD 5 <<.method static <clinit>()v.limit stack 1.limit locals 0.line 4 bipush 10 newarray int putstatic SomeClass/a [I return 13
Chapter 7D The Java Virtual Machine
This sub chapter discusses another architecture, that of the JVM (Java Virtual Machine). In general, a VM (Virtual Machine) is a hypothetical machine (implemented in either hardware or software) that directly
02 B The Java Virtual Machine
02 B The Java Virtual Machine CS1102S: Data Structures and Algorithms Martin Henz January 22, 2010 Generated on Friday 22 nd January, 2010, 09:46 CS1102S: Data Structures and Algorithms 02 B The Java Virtual
language 1 (source) compiler language 2 (target) Figure 1: Compiling a program
CS 2112 Lecture 27 Interpreters, compilers, and the Java Virtual Machine 1 May 2012 Lecturer: Andrew Myers 1 Interpreters vs. compilers There are two strategies for obtaining runnable code from a program
University of Twente. A simulation of the Java Virtual Machine using graph grammars
University of Twente Department of Computer Science A simulation of the Java Virtual Machine using graph grammars Master of Science thesis M. R. Arends, November 2003 A simulation of the Java Virtual Machine
The Java Virtual Machine (JVM) Pat Morin COMP 3002
The Java Virtual Machine (JVM) Pat Morin COMP 3002 Outline Topic 1 Topic 2 Subtopic 2.1 Subtopic 2.2 Topic 3 2 What is the JVM? The JVM is a specification of a computing machine Instruction set Primitive
Under the Hood: The Java Virtual Machine. Lecture 24 CS 2110 Fall 2011
Under the Hood: The Java Virtual Machine Lecture 24 CS 2110 Fall 2011 Compiling for Different Platforms Program written in some high-level language (C, Fortran, ML,...) Compiled to intermediate form Optimized
Inside the Java Virtual Machine
CS1Bh Practical 2 Inside the Java Virtual Machine This is an individual practical exercise which requires you to submit some files electronically. A system which measures software similarity will be used
The Java Virtual Machine and Mobile Devices. John Buford, Ph.D. [email protected] Oct 2003 Presented to Gordon College CS 311
The Java Virtual Machine and Mobile Devices John Buford, Ph.D. [email protected] Oct 2003 Presented to Gordon College CS 311 Objectives Review virtual machine concept Introduce stack machine architecture
Habanero Extreme Scale Software Research Project
Habanero Extreme Scale Software Research Project Comp215: Java Method Dispatch Zoran Budimlić (Rice University) Always remember that you are absolutely unique. Just like everyone else. - Margaret Mead
HOTPATH VM. An Effective JIT Compiler for Resource-constrained Devices
HOTPATH VM An Effective JIT Compiler for Resource-constrained Devices based on the paper by Andreas Gal, Christian W. Probst and Michael Franz, VEE 06 INTRODUCTION INTRODUCTION Most important factor: speed
Interpreters and virtual machines. Interpreters. Interpreters. Why interpreters? Tree-based interpreters. Text-based interpreters
Interpreters and virtual machines Michel Schinz 2007 03 23 Interpreters Interpreters Why interpreters? An interpreter is a program that executes another program, represented as some kind of data-structure.
Java Programming. Binnur Kurt [email protected]. Istanbul Technical University Computer Engineering Department. Java Programming. Version 0.0.
Java Programming Binnur Kurt [email protected] Istanbul Technical University Computer Engineering Department Java Programming 1 Version 0.0.4 About the Lecturer BSc İTÜ, Computer Engineering Department,
Introduction. Application Security. Reasons For Reverse Engineering. This lecture. Java Byte Code
Introduction Application Security Tom Chothia Computer Security, Lecture 16 Compiled code is really just data which can be edit and inspected. By examining low level code protections can be removed and
C Compiler Targeting the Java Virtual Machine
C Compiler Targeting the Java Virtual Machine Jack Pien Senior Honors Thesis (Advisor: Javed A. Aslam) Dartmouth College Computer Science Technical Report PCS-TR98-334 May 30, 1998 Abstract One of the
- Applet java appaiono di frequente nelle pagine web - Come funziona l'interprete contenuto in ogni browser di un certo livello? - Per approfondire
- Applet java appaiono di frequente nelle pagine web - Come funziona l'interprete contenuto in ogni browser di un certo livello? - Per approfondire il funzionamento della Java Virtual Machine (JVM): -
Structural Typing on the Java Virtual. Machine with invokedynamic
WRIGHT STATE UNIVERSITY Structural Typing on the Java Virtual Machine with invokedynamic by Brian Diekelman A thesis submitted in partial fulfillment for the degree of Bachelor of Science in the Department
X86-64 Architecture Guide
X86-64 Architecture Guide For the code-generation project, we shall expose you to a simplified version of the x86-64 platform. Example Consider the following Decaf program: class Program { int foo(int
AVR 32-bit Microcontroller. Java Technical Reference. 1. Introduction. 1.1 Intended audience. 1.2 The AVR32 Java Extension Module
1. Introduction 1.1 Intended audience This manual is intended for developers implementing Java virtual machines or Java debuggers using the AVR 32 Java Extension Module, or others needing information on
Virtual Machines. Case Study: JVM. Virtual Machine, Intermediate Language. JVM Case Study. JVM: Java Byte-Code. JVM: Type System
Case Study: JVM Virtual Machines What is a machine? does something (...useful) programmable concrete (hardware) What is a virtual machine? a machine that is not concrete a software emulation of a physical
Chapter 4 Lecture 5 The Microarchitecture Level Integer JAVA Virtual Machine
Chapter 4 Lecture 5 The Microarchitecture Level Integer JAVA Virtual Machine This is a limited version of a hardware implementation to execute the JAVA programming language. 1 of 23 Structured Computer
Java Virtual Machine, JVM
Java Virtual Machine, JVM a Teodor Rus [email protected] The University of Iowa, Department of Computer Science a These slides have been developed by Teodor Rus. They are copyrighted materials and may not
1 The Java Virtual Machine
1 The Java Virtual Machine About the Spec Format This document describes the Java virtual machine and the instruction set. In this introduction, each component of the machine is briefly described. This
Built-in Concurrency Primitives in Java Programming Language. by Yourii Martiak and Mahir Atmis
Built-in Concurrency Primitives in Java Programming Language by Yourii Martiak and Mahir Atmis Overview One of the many strengths of Java is the built into the programming language support for concurrency
Introduction to Java
Introduction to Java The HelloWorld program Primitive data types Assignment and arithmetic operations User input Conditional statements Looping Arrays CSA0011 Matthew Xuereb 2008 1 Java Overview A high
Java Virtual Machine Locks
Java Virtual Machine Locks SS 2008 Synchronized Gerald SCHARITZER (e0127228) 2008-05-27 Synchronized 1 / 13 Table of Contents 1 Scope...3 1.1 Constraints...3 1.2 In Scope...3 1.3 Out of Scope...3 2 Logical
Introduction to Programming
Introduction to Programming Lecturer: Steve Maybank Department of Computer Science and Information Systems [email protected] Spring 2015 Week 2b: Review of Week 1, Variables 16 January 2015 Birkbeck
The Java Virtual Machine Specification. Java SE 8 Edition
The Java Virtual Machine Specification Java SE 8 Edition This page intentionally left blank The Java Virtual Machine Specification Java SE 8 Edition Tim Lindholm Frank Yellin Gilad Bracha Alex Buckley
picojava TM : A Hardware Implementation of the Java Virtual Machine
picojava TM : A Hardware Implementation of the Java Virtual Machine Marc Tremblay and Michael O Connor Sun Microelectronics Slide 1 The Java picojava Synergy Java s origins lie in improving the consumer
Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner.
Handout 1 CS603 Object-Oriented Programming Fall 15 Page 1 of 11 Handout 1 Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner. Java
Lecture 32: The Java Virtual Machine. The Java Virtual Machine
The University of North Carolina at Chapel Hill Spring 2002 Lecture 32: The Java Virtual Machine April 12 1 The Java Virtual Machine Java Architecture Java Programming Language Java Virtual Machine (JVM)
MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.
Exam Name MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. 1) The JDK command to compile a class in the file Test.java is A) java Test.java B) java
Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C
Embedded Systems A Review of ANSI C and Considerations for Embedded C Programming Dr. Jeff Jackson Lecture 2-1 Review of ANSI C Topics Basic features of C C fundamentals Basic data types Expressions Selection
First Java Programs. V. Paúl Pauca. CSC 111D Fall, 2015. Department of Computer Science Wake Forest University. Introduction to Computer Science
First Java Programs V. Paúl Pauca Department of Computer Science Wake Forest University CSC 111D Fall, 2015 Hello World revisited / 8/23/15 The f i r s t o b l i g a t o r y Java program @author Paul Pauca
Java Interview Questions and Answers
1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write and compile the java
Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA) * Instruction set architecture of a machine fills the semantic gap between the user and the machine. * ISA serves as the starting point for the design of a new machine
Java CPD (I) Frans Coenen Department of Computer Science
Java CPD (I) Frans Coenen Department of Computer Science Content Session 1, 12:45-14:30 (First Java Programme, Inheritance, Arithmetic) Session 2, 14:45-16:45 (Input and Programme Constructs) Materials
Retargeting Android Applications to Java Bytecode
Retargeting Android Applications to Java Bytecode Damien Octeau Department of Computer Science and Engineering Pennsylvania State University [email protected] Somesh Jha Computer Sciences Department University
Stack machines The MIPS assembly language A simple source language Stack-machine implementation of the simple language Readings: 9.1-9.
Code Generation I Stack machines The MIPS assembly language A simple source language Stack-machine implementation of the simple language Readings: 9.1-9.7 Stack Machines A simple evaluation model No variables
Java Language Tools COPYRIGHTED MATERIAL. Part 1. In this part...
Part 1 Java Language Tools This beginning, ground-level part presents reference information for setting up the Java development environment and for compiling and running Java programs. This includes downloading
J a v a Quiz (Unit 3, Test 0 Practice)
Computer Science S-111a: Intensive Introduction to Computer Science Using Java Handout #11 Your Name Teaching Fellow J a v a Quiz (Unit 3, Test 0 Practice) Multiple-choice questions are worth 2 points
The Java Series. Java Essentials I What is Java? Basic Language Constructs. Java Essentials I. What is Java?. Basic Language Constructs Slide 1
The Java Series Java Essentials I What is Java? Basic Language Constructs Slide 1 What is Java? A general purpose Object Oriented programming language. Created by Sun Microsystems. It s a general purpose
CS412/CS413. Introduction to Compilers Tim Teitelbaum. Lecture 20: Stack Frames 7 March 08
CS412/CS413 Introduction to Compilers Tim Teitelbaum Lecture 20: Stack Frames 7 March 08 CS 412/413 Spring 2008 Introduction to Compilers 1 Where We Are Source code if (b == 0) a = b; Low-level IR code
JAVA - QUICK GUIDE. Java SE is freely available from the link Download Java. So you download a version based on your operating system.
http://www.tutorialspoint.com/java/java_quick_guide.htm JAVA - QUICK GUIDE Copyright tutorialspoint.com What is Java? Java is: Object Oriented Platform independent: Simple Secure Architectural- neutral
Chapter One Introduction to Programming
Chapter One Introduction to Programming 1-1 Algorithm and Flowchart Algorithm is a step-by-step procedure for calculation. More precisely, algorithm is an effective method expressed as a finite list of
Platform Independent Dynamic Java Virtual Machine Analysis: the Java Grande Forum Benchmark Suite
Platform Independent Dynamic Java Virtual Machine Analysis: the Java Grande Forum Benchmark Suite Charles Daly Computer Applications, Dublin City University, Dublin 9, Ireland. Jane Horgan Computer Applications,
Moving from CS 61A Scheme to CS 61B Java
Moving from CS 61A Scheme to CS 61B Java Introduction Java is an object-oriented language. This document describes some of the differences between object-oriented programming in Scheme (which we hope you
Checking Access to Protected Members in the Java Virtual Machine
Checking Access to Protected Members in the Java Virtual Machine Alessandro Coglio Kestrel Institute 3260 Hillview Avenue, Palo Alto, CA 94304, USA Ph. +1-650-493-6871 Fax +1-650-424-1807 http://www.kestrel.edu/
Java Card 3 Platform. Virtual Machine Specification, Classic Edition. Version 3.0.5. May 2015
Java Card 3 Platform Virtual Machine Specification, Classic Edition Version 3.0.5 May 2015 Java Card 3 Platform Virtual Machine Specification, Classic Edition Version 3.0.5 Copyright 1998, 2015, Oracle
Introduction to Java Applications. 2005 Pearson Education, Inc. All rights reserved.
1 2 Introduction to Java Applications 2.2 First Program in Java: Printing a Line of Text 2 Application Executes when you use the java command to launch the Java Virtual Machine (JVM) Sample program Displays
Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.
Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to
An Introduction to Assembly Programming with the ARM 32-bit Processor Family
An Introduction to Assembly Programming with the ARM 32-bit Processor Family G. Agosta Politecnico di Milano December 3, 2011 Contents 1 Introduction 1 1.1 Prerequisites............................. 2
Briki: a Flexible Java Compiler
Briki: a Flexible Java Compiler Michał Cierniak Wei Li Technical Report 621 Department of Computer Science University of Rochester Rochester, NY 14627 cierniak,wei @cs.rochester.edu May 1996 Abstract We
Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives
Introduction to Programming and Algorithms Module 1 CS 146 Sam Houston State University Dr. Tim McGuire Module Objectives To understand: the necessity of programming, differences between hardware and software,
A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc
Other architectures Example. Accumulator-based machines A single register, called the accumulator, stores the operand before the operation, and stores the result after the operation. Load x # into acc
Installing Java (Windows) and Writing your First Program
Appendix Installing Java (Windows) and Writing your First Program We will be running Java from the command line and writing Java code in Notepad++ (or similar). The first step is to ensure you have installed
Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007
Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007 The Java Type System By now, you have seen a fair amount of Java. Time to study in more depth the foundations of the language,
Pemrograman Dasar. Basic Elements Of Java
Pemrograman Dasar Basic Elements Of Java Compiling and Running a Java Application 2 Portable Java Application 3 Java Platform Platform: hardware or software environment in which a program runs. Oracle
Semantic Analysis: Types and Type Checking
Semantic Analysis Semantic Analysis: Types and Type Checking CS 471 October 10, 2007 Source code Lexical Analysis tokens Syntactic Analysis AST Semantic Analysis AST Intermediate Code Gen lexical errors
Prototyping Faithful Execution in a Java Virtual Machine
SANDIA REPORT SAND2003-2327 Unlimited Release Printed July 2003 Prototyping Faithful Execution in a Java Virtual Machine Philip L. Campbell, Lyndon G. Pierson, Thomas D. Tarman Prepared by Sandia National
An Overview of Java. overview-1
An Overview of Java overview-1 Contents What is Java Major Java features Java virtual machine Java programming language Java class libraries (API) GUI Support in Java Networking and Threads in Java overview-2
Instrumenting Java bytecode
Instrumenting Java bytecode Seminar work for the Compilers-course, spring 2005 Jari Aarniala Department of Computer Science University of Helsinki, Finland [email protected] ABSTRACT Bytecode
What is Software Watermarking? Software Watermarking Through Register Allocation: Implementation, Analysis, and Attacks
hat is Software atermarking? Software atermarking Through Register Allocation: Implementation, Analysis, and Attacks Ginger Myles Christian Collberg {mylesg,collberg}@cs.arizona.edu University of Arizona
Write your own JVM compiler
Write your own JVM compiler OSCON Java 2011 Ian Dees @undees Hi, I m Ian. I m here to show that there s never been a better time than now to write your own compiler. the three paths Abstraction compilers
JDK 1.5 Updates for Introduction to Java Programming with SUN ONE Studio 4
JDK 1.5 Updates for Introduction to Java Programming with SUN ONE Studio 4 NOTE: SUN ONE Studio is almost identical with NetBeans. NetBeans is open source and can be downloaded from www.netbeans.org. I
Java Crash Course Part I
Java Crash Course Part I School of Business and Economics Institute of Information Systems HU-Berlin WS 2005 Sebastian Kolbe [email protected] Overview (Short) introduction to the environment Linux
Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2
Lecture Handout Computer Architecture Lecture No. 2 Reading Material Vincent P. Heuring&Harry F. Jordan Chapter 2,Chapter3 Computer Systems Design and Architecture 2.1, 2.2, 3.2 Summary 1) A taxonomy of
Object Oriented Software Design
Object Oriented Software Design Introduction to Java - II Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa September 14, 2011 G. Lipari (Scuola Superiore Sant Anna) Introduction
Chapter 1 Java Program Design and Development
presentation slides for JAVA, JAVA, JAVA Object-Oriented Problem Solving Third Edition Ralph Morelli Ralph Walde Trinity College Hartford, CT published by Prentice Hall Java, Java, Java Object Oriented
The Java Virtual Machine Specification
The Java Virtual Machine Specification Java SE 8 Edition Tim Lindholm Frank Yellin Gilad Bracha Alex Buckley 2015-02-13 Specification: JSR-337 Java SE 8 Release Contents ("Specification") Version: 8 Status:
Part I. Multiple Choice Questions (2 points each):
Part I. Multiple Choice Questions (2 points each): 1. Which of the following is NOT a key component of object oriented programming? (a) Inheritance (b) Encapsulation (c) Polymorphism (d) Parallelism ******
Stacks. Linear data structures
Stacks Linear data structures Collection of components that can be arranged as a straight line Data structure grows or shrinks as we add or remove objects ADTs provide an abstract layer for various operations
Debugging. Common Semantic Errors ESE112. Java Library. It is highly unlikely that you will write code that will work on the first go
Debugging ESE112 Java Programming: API, Psuedo-Code, Scope It is highly unlikely that you will write code that will work on the first go Bugs or errors Syntax Fixable if you learn to read compiler error
C++ INTERVIEW QUESTIONS
C++ INTERVIEW QUESTIONS http://www.tutorialspoint.com/cplusplus/cpp_interview_questions.htm Copyright tutorialspoint.com Dear readers, these C++ Interview Questions have been designed specially to get
Basic Java Constructs and Data Types Nuts and Bolts. Looking into Specific Differences and Enhancements in Java compared to C
Basic Java Constructs and Data Types Nuts and Bolts Looking into Specific Differences and Enhancements in Java compared to C 1 Contents Hello World Program Statements Explained Java Program Structure in
13 Classes & Objects with Constructors/Destructors
13 Classes & Objects with Constructors/Destructors 13.1 Introduction In object oriented programming, the emphasis is on data rather than function. Class is a way that binds the data & function together.
Checking Access to Protected Members in the Java Virtual Machine
Vol. 4, No. 8, 2005 Checking Access to Protected Members in the Java Virtual Machine Alessandro Coglio, Kestrel Institute, Palo Alto, California, USA This paper studies in detail how to correctly and efficiently
Introduction to programming
Unit 1 Introduction to programming Summary Architecture of a computer Programming languages Program = objects + operations First Java program Writing, compiling, and executing a program Program errors
Tutorial on C Language Programming
Tutorial on C Language Programming Teodor Rus [email protected] The University of Iowa, Department of Computer Science Introduction to System Software p.1/64 Tutorial on C programming C program structure:
General Introduction
Managed Runtime Technology: General Introduction Xiao-Feng Li ([email protected]) 2012-10-10 Agenda Virtual machines Managed runtime systems EE and MM (JIT and GC) Summary 10/10/2012 Managed Runtime
The C Programming Language course syllabus associate level
TECHNOLOGIES The C Programming Language course syllabus associate level Course description The course fully covers the basics of programming in the C programming language and demonstrates fundamental programming
Portable Profiling of Memory Allocation in Java
Portable Profiling of Memory Allocation in Java Walter Binder Ecole Polytechnique Fédérale de Lausanne (EPFL) Artificial Intelligence Laboratory CH-1015 Lausanne, Switzerland [email protected] Abstract.
Virtual Machine Showdown: Stack Versus Registers
Virtual Machine Showdown: Stack Versus Registers Yunhe Shi, David Gregg, Andrew Beatty Department of Computer Science University of Dublin, Trinity College Dublin 2, Ireland {yshi, David.Gregg, Andrew.Beatty}@cs.tcd.ie
EC 362 Problem Set #2
EC 362 Problem Set #2 1) Using Single Precision IEEE 754, what is FF28 0000? 2) Suppose the fraction enhanced of a processor is 40% and the speedup of the enhancement was tenfold. What is the overall speedup?
Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program
Free Java textbook available online "Thinking in Java" by Bruce Eckel, 4th edition, 2006, ISBN 0131872486, Pearson Education Introduction to the Java programming language CS 4354 Summer II 2015 The third
Basic Object-Oriented Programming in Java
core programming Basic Object-Oriented Programming in Java 1 2001-2003 Marty Hall, Larry Brown http:// Agenda Similarities and differences between Java and C++ Object-oriented nomenclature and conventions
2) Write in detail the issues in the design of code generator.
COMPUTER SCIENCE AND ENGINEERING VI SEM CSE Principles of Compiler Design Unit-IV Question and answers UNIT IV CODE GENERATION 9 Issues in the design of code generator The target machine Runtime Storage
Aalborg University. Master Thesis. Assessing Bit Flip Attacks and Countermeasures. Modelling Java Bytecode. Group:
Aalborg University Master Thesis Modelling Java Bytecode Assessing Bit Flip Attacks and Countermeasures Group: Christoffer Ndũrũ Kristian Mikkel Thomsen Supervisors: René Rydhof Hansen Mads Christian Olesen
Introduction to Data Structures
Introduction to Data Structures Albert Gural October 28, 2011 1 Introduction When trying to convert from an algorithm to the actual code, one important aspect to consider is how to store and manipulate
Crash Course in Java
Crash Course in Java Based on notes from D. Hollinger Based in part on notes from J.J. Johns also: Java in a Nutshell Java Network Programming and Distributed Computing Netprog 2002 Java Intro 1 What is
Boolean Expressions, Conditions, Loops, and Enumerations. Precedence Rules (from highest to lowest priority)
Boolean Expressions, Conditions, Loops, and Enumerations Relational Operators == // true if two values are equivalent!= // true if two values are not equivalent < // true if left value is less than the
1 Description of The Simpletron
Simulating The Simpletron Computer 50 points 1 Description of The Simpletron In this assignment you will write a program to simulate a fictional computer that we will call the Simpletron. As its name implies
Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program
Free Java textbook available online "Thinking in Java" by Bruce Eckel, 4th edition, 2006, ISBN 0131872486, Pearson Education Introduction to the Java programming language CS 4354 Summer II 2014 Jill Seaman
Object Oriented Software Design
Object Oriented Software Design Introduction to Java - II Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 28, 2010 G. Lipari (Scuola Superiore Sant Anna) Introduction
A Java Virtual Machine Architecture for Very Small Devices
A Java Virtual Machine Architecture for Very Small Devices Nik Shaylor Sun Microsystems Research Laboratories 2600 Casey Avenue Mountain View, CA 94043 USA [email protected] Douglas N. Simon Sun Microsystems
