Preview

java virtual machine

Good Essays
Open Document
Open Document
731 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
java virtual machine
Java Virtual Machine, An inside story!!
Java Virtual Machine, or JVM as its name suggest is a “virtual” computer that resides in the “real” computer as a software process. JVM gives Java the flexibility of platform independence. Let us see first how exactly Java program is created, compiled and executed.
Java code is written in .java file. This code contains one or more Java language attributes like Classes, Methods, Variable, Objects etc. Javac is used to compile this code and to generate .class file. Class file is also known as “byte code“. The name byte code is given may be because of the structure of the instruction set of Java program. We will see more about the instruction set later in this tutorial. Java byte code is an input to Java Virtual Machine. JVM read this code and interpret it and executes the program.

Java Virtual Machine
Java Virtual Machine like its real counter part, executes the program and generate output. To execute any code, JVM utilizes different components.
JVM is divided into several components like the stack, the garbage-collected heap, the registers and the method area. Let us see diagram representation of JVM.

The Stack
Stack in Java virtual machine stores various method arguments as well as the local variables of any method. Stack also keep track of each an every method invocation. This is called Stack Frame. There are three registers thats help in stack manipulation. They are vars, frame, optop. This registers points to different parts of current Stack.
There are three sections in Java stack frame:
Local Variables
The local variables section contains all the local variables being used by the current method invocation. It is pointed to by the vars register.
Execution Environment
The execution environment section is used to maintain the operations of the stack itself. It is pointed to by the frame register.
Operand Stack
The operand stack is used as a work space by bytecode instructions. It is here that the

You May Also Find These Documents Helpful

  • Good Essays

    To explain this, we should already know that in real life scenarios, stack increases to lower memory addresses, whenever program calls some function, the address of function call instruction is saved in stack as a return for the function. When the function executes, it allocates local variables, including buffers to stack and they are given a lower address than the return address. So, in this scenario the return address is a certain level above the base address for buffers and if the buffer is overflowing, then it is most likely that an attacker can change return address as well. If the return address is changed to some random value, then it will cause segmentation fault, but if the return address is changed to a certain address where some executable code is present, then that may complete attackers intended tasks with the application.…

    • 335 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Unit 59 Assignment 3

    • 645 Words
    • 3 Pages

    The process of how the subroutine works within an operating environment is as follows. While the main part of the program is running, there will be a call command sent to the CPU to tell it to stop wherever the program is at, store the W, Z and status along with where in the main program the CPU is at in the stack. Then the main program is cleared from memory and the subroutine is loaded for the CPU to start processing the code. Once the subroutine has finished, the subroutine code is deleted from memory and the CPU will load up the main program back on and will retrieve from stack the stored information (W, Z and status) which will allow the CPU know exactly where it needs to start from.…

    • 645 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Cis 207 Week 2/3 Quiz

    • 383 Words
    • 2 Pages

    Registers are used to store data in RAM, the control unit, and the arithmetic logic unit. True…

    • 383 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Homework Week 2

    • 743 Words
    • 3 Pages

    A compiler translates one computer language into another. It also pics up errors in the program being put together.…

    • 743 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Unit 5 PT1420

    • 959 Words
    • 7 Pages

    The case structure lets the value of a variable or an expression determine which path of execution the program will take.…

    • 959 Words
    • 7 Pages
    Good Essays
  • Satisfactory Essays

    CS305 Final Exam Questions

    • 1044 Words
    • 6 Pages

    a. It decrements the stack pointer (by 2 or 4) and copies the operand into the stack at the location pointed to by the stack pointer.…

    • 1044 Words
    • 6 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Deitel, H.M., & Deitel, P.J. (2002). Java: How to program (6th ed.). Upper Saddle River, NJ: Pearson…

    • 253 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    unit 4

    • 691 Words
    • 4 Pages

    4. What is a local variable? What statements are able to access a local variable?…

    • 691 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Homework

    • 343 Words
    • 2 Pages

    68. In the HCS12, the stack pointer (SP) points to _____________ (the last used, next available) location of the stack.…

    • 343 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    After running the above program, what is the content of memory location $2100 and $2101? Completely explain your answer!…

    • 694 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    As a Java developer you will join a team of developers, where you will be taking part in designing, building,…

    • 273 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    My Jobs

    • 1767 Words
    • 8 Pages

    Latest answer: The java runtime system can be accessed by the Runtime class. The runtime information – memory availability, invoking the garbage collector is possible by using Runtime class............…

    • 1767 Words
    • 8 Pages
    Satisfactory Essays
  • Powerful Essays

    After having seen the basic types in Java and how to declare variables of each type, we are now going to show what basic operations can be performed with and on variables of the basic types.…

    • 1312 Words
    • 6 Pages
    Powerful Essays
  • Powerful Essays

    This lecture notes covers unit1. 1. Introduction: M255 module: Object Oriented Programming with Java concerns on teaching the principles of Object Oriented such as objects, classes, inheritance, and polymorphism using Java language. You have two CDs in this module: • Online Application CD which has the StarOffice application, and • M255 CD that has the blueJ, microworld and others. When you install M255 CD be sure that all options are selected, just determine the folders you want to install on and follow instructions during the installation process. 2. Fundamental hardware and software concepts What is a computer? A device that accepts input, processes data, stores data, and produces output. These are the main basic tasks of a computer. Simply, any computer system is composed of computer hardware and software. The hardware components of a computer system are the electronic and mechanical parts. The software components of a computer system are the intangible parts: it is a general term of all the applications, programs, and systems that run on your computer. Software consists of sets of instructions that tell a computer how to perform a particular task. 2.1 Computer Hardware The main hardware devices are classified as: 1. Essential parts of a computer : CPU & main memory 2. Peripheral devices, which is any component of the computer that is not part of essential devices, such as: Input/Output devices, secondary storage (Storage devices). Some peripherals are mounted in the same case as processor such as hard disks, others such as printers are physically outside the computer. An input device gathers and translates input into a form that the computer can process, these are devices such as: keyboard, mouse, scanner, microphone, cardreader, and bar reader.…

    • 5210 Words
    • 21 Pages
    Powerful Essays
  • Good Essays

    Have you ever wondered how your electronic devices work? Well most likely your electronic devise is programmed by a computer language called Java. Java is one of the most popular languages for application development. It is going to continue to be one of the most popular languages because it’s free, it runs on any modern operating system, and Java is open source software so it can evolve to fit the needs of programmers. Java allows you to play online games, chat with people around the world, do calculations, and view images in 3D, just to name a few. It's also integral to the intranet applications and other e-business solutions that are the foundation of corporate computing (Java, par. 1). There are three types of programs you can create with Java they include: applications, applets, and servlets. These can work together or independently to make programs work.…

    • 768 Words
    • 4 Pages
    Good Essays

Related Topics