Implement High-level Program Language on JVM CSCE 531 ZHONGHAO LIU ZHONGHAO LIU XIAO LIN.

Slides:



Advertisements
Similar presentations
Chapter 16 Java Virtual Machine. To compile a java program in Simple.java, enter javac Simple.java javac outputs Simple.class, a file that contains bytecode.
Advertisements

Virtual Machines Matthew Dwyer 324E Nichols Hall
Java security (in a nutshell)
1 1 Lecture 14 Java Virtual Machine Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
CSCE 145: Algorithmic Design I Chapter 1 Intro to Computers and Java Muhammad Nazmus Sakib.
Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
Lab#1 (14/3/1431h) Introduction To java programming cs425
Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
JETT 2003 Java.compareTo(C++). JAVA Java Platform consists of 4 parts: –Java Language –Java API –Java class format –Java Virtual Machine.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Run-Time Storage Organization
JVM-1 Introduction to Java Virtual Machine. JVM-2 Outline Java Language, Java Virtual Machine and Java Platform Organization of Java Virtual Machine Garbage.
Chapter 16 Java Virtual Machine. To compile a java program in Simple.java, enter javac Simple.java javac outputs Simple.class, a file that contains bytecode.
1 Software Testing and Quality Assurance Lecture 31 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques.
Introduction to Java.
CSc 453 Interpreters & Interpretation Saumya Debray The University of Arizona Tucson.
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
Java Security Updated May Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security.
Intro to Java The Java Virtual Machine. What is the JVM  a software emulation of a hypothetical computing machine that runs Java bytecodes (Java compiler.
Java Introduction 劉登榮 Deng-Rung Liu 87/7/15. Outline 4 History 4 Why Java? 4 Java Concept 4 Java in Real World 4 Language Overview 4 Java Performance!?
David Evans CS201j: Engineering Software University of Virginia Computer Science Lecture 18: 0xCAFEBABE (Java Byte Codes)
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
Compiler Construction Lecture 17 Mapping Variables to Memory.
Arpit Jain Mtech1. Outline Introduction Dalvik VM Java VM Examples Comparisons Experimental Evaluation.
1 The Java Virtual Machine Yearly Programming Project.
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 09/03/2010.
Java Virtual Machine Java Virtual Machine A Java Virtual Machine (JVM) is a set of computer software programs and data structures that use.
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
Lecture 10 : Introduction to Java Virtual Machine
Introduction to the Java Virtual Machine 井民全. JVM (Java Virtual Machine) the environment in which the java programs execute The specification define an.
Computer Programming A program is a set of instructions a computer follows in order to perform a task. solve a problem Collectively, these instructions.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
By Noorez Kassam Welcome to JNI. Why use JNI ? 1. You already have significantly large and tricky code written in another language and you would rather.
1 Comp 104: Operating Systems Concepts Java Development and Run-Time Store Organisation.
Roopa.T PESIT, Bangalore. Source and Credits Dalvik VM, Dan Bornstein Google IO 2008 The Dalvik virtual machine Architecture by David Ehringer.
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
David Streader Computer Science Victoria University of Wellington Copyright: David Streader, Victoria University of Wellington Java Programing Basics COMP.
Java 2 security model Valentina Casola. Components of Java the development environment –development lifecycle –Java language features –class files and.
12/10/2002© 2002 Hal Perkins & UW CSET-1 CSE 582 – Compilers Java Implementation – JVMs, JITs &c Hal Perkins Autumn 2002.
Conrad Benham Java Opcode and Runtime Data Analysis By: Conrad Benham Supervisor: Professor Arthur Sale.
Introduction to Object Oriented Programming CMSC 331.
Lecture 8 February 29, Topics Questions about Exercise 4, due Thursday? Object Based Programming (Chapter 8) –Basic Principles –Methods –Fields.
Sadegh Aliakbary Sharif University of Technology Spring 2011.
Programming Languages and Design Lecture 6 Names, Scopes and Binding Instructor: Li Ma Department of Computer Science Texas Southern University, Houston.
Programming Languages and Paradigms Activation Records in Java.
JAVA Ekapap Julnonyang When it was implemented? Developed by Sun Microsystems. The first public implementation was Java 1.0 in 1995 The language.
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Chap. 10, Intermediate Representations J. H. Wang Dec. 27, 2011.
CSCI 212 Object-Oriented Programming in Java. Prerequisite: CSCI 111 variable assignment statement while loop for loop post-increment (i++) strong typing.
 Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. 
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
RealTimeSystems Lab Jong-Koo, Lim
Software Engineering Algorithms, Compilers, & Lifecycle.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Object Oriented Programming in
Java™ 2 Platform Getting Started.
Basic Concepts: computer, program, programming …
Before You Begin Nahla Abuel-ola /WIT.
Java Primer 1: Types, Classes and Operators
Introduction Enosis Learning.
Java Virtual Machine Complete subject details are available at:
Mobile Handset Virtual Machine
Introduction Enosis Learning.
CSc 453 Interpreters & Interpretation
(Computer fundamental Lab)
M S COLLEGE ART’S, COMM., SCI. & BMS
CSc 453 Interpreters & Interpretation
Presentation transcript:

Implement High-level Program Language on JVM CSCE 531 ZHONGHAO LIU ZHONGHAO LIU XIAO LIN

Acknowledge The Java® Virtual Machine Specification, Compiler test case generation methods: a survey and assessment, A.S. Boujarwah, K.Saleh 2CSCE 531

History Initially designed to support only the Java More languages were implemented or designed to run on the Java platform. CSCE 5313

JVM languages FreePascal: an implementation of Pascal Clojue :a functional Lisp dialect Nashorn:an implementation of JavaScript Scala:an OO and functional programming language JRuby: an implementation of Ruby Jython:an implementation of Python JGNAT:an implementation of Ada …… Source: 4CSCE 531

How? JVM knows nothing about any language, even JAVA JVM has its own instruction sets which JVM can understand All you need to do is writing a compiler which compiles high-level language into java byte code CSCE 5315

6 … def f(x): print x … def f(x): print x … istore_1 iload_1 jsr 19 … istore_1 iload_1 jsr 19 … Windows Operating System Intel x86 JVM Java APIs JRE Mobile Operating System ARM JVM Java APIs JRE language source files.class files compiler run

2. JVM JAVA API CLASS Operating System HardwareHardware JRE

Advantages Less time: – Only focus on JVM – JVM supports many features – Just one compiler if you want – BCEL, ASM Nature Portable – Once compiled, can run on any devices installed JRE (Java Runtime Environment) 8CSCE 531

What we need to do CSCE 5319 Java Your Languagebytecode Define your language’s specification specification Understand JVM’s instructions and format of.class file

Basic structure of JVM Data types Run-Time Data Areas class File Format CSCE 53110

Data Types Two types: primitive types and reference types Primitive Types and Values – numeric types, integer types float-point types – boolean type – returnAddress type pointer to the opcodes of Java Virtual Machine instructions CSCE 53111

Data Types Reference Types – class types: references to dynamically created class instances – array types: references to dynamically created array instances – interface types: references to dynamically created class instances or arrays that implement interfaces CSCE 53112

Run-Time Data Areas pc Register – Each JVM thread has a pc Register Java Virtual Machine Stacks – Each JVM thread has a private JVM stacks – Stores frames – holds local variables and partial results, and plays a part in method invocation and return CSCE 53113

Run-Time Data Areas Heap – shared among all JVM threads – where all class instances and arrays are allocated – created on virtual machine start-up – automatic storage management system, known as Garbage Collector CSCE 53114

Run-Time Data Areas Method Area – shared among all Java Virtual Machine threads – analogous to the "text" segment – stores per-class structures run-time constant pool field and method data the code for methods and constructors CSCE 53115

class File Contains JVM instructions Each class file contains the definition of a single class or interface the only file format JVM can recognize. CSCE 53116

class File CSCE 53117

Issues in Compiler Testing The aim of compiler testing is to verify that the compiler implementation conforms to its specifications, which is to generate an object code that faithfully corresponds to the language semantic and syntax as specified in the language documentation. CSCE 53118

Test case: Test case: 1.A test purpose or test case description 2.A test input consisting of a source program for which the behavior of the compiler under test is verified 3.An expected output which may include a reference to an output file or error file. CSCE 53119

CSCE Grammar Test program generator Test programs Expected output Compiler under test Compiler output Test result analysis Test Report Test case generation and selection Dynamic test execution Test result analysis Different stages of compiler testing Compiler test suite

Criteria to assess test case generation methods: 1.Data definition coverage 2.Syntax coverage 3.Semantic coverage 4.Extent of automation 5.Implementation and efficiency CSCE 53121

Thank You CSCE 53122