Problem regarding the java bytecode analysis

Assignment Help JAVA Programming
Reference no: EM13963551

Java Bytecode Analysis

One property of a Java program that is checked by the veri?er is that each object must be properly initialized before it is used. This property is fairly dif?cult to check. One relatively simple part of the analysis, however, is to guarantee that each subclass constructor must call the superclass constructor. The reason for this check is to guarantee that the inherited parts of every object will be initialized properly. If we were designing our own bytecode veri?er, there are two ways we might consider designing this check:

(i) The veri?er can analyze the bytecode program to make sure that on every ex- ecution of a subclass constructor, there is some call to a superclass constructor.

(ii) The veri?er can check that the ?rst few bytecode instructions of a subclass constructor contain a call to the superclass constructor, before any loop or jump inside the subclass constructor.

In design (i), the veri?er should accept every bytecode program that satis?es this condition and reject every bytecode program that allows some subclass constructor to complete without calling the superclass constructor. In design (ii), some subclass constructors that would be acceptable according to condition (i) will be rejected by the bytecode veri?er. However, it may be possible to design the Java source code compiler so that every correct Java source code program is compiled to bytecode that meets the condition described in design (ii).

(a) If you were writing a Java compiler and another person on your team was writing the bytecode veri?er, which design would you prefer? Explain brie?y.

(b) If you were writing a Java compiler and your manager told you that the standard veri?er used design (ii) instead of (i), could you still write a decent compiler? Explain brie?y.

(c) If you were writing a bytecode veri?er and your manager offered to double your salary if you satis?ed design condition (i) instead of (ii) but would ?re you if you failed, would you accept the offer? Explain in one sentence.

Reference no: EM13963551

Questions Cloud

Calculate probability that at a later time tf electron spin : At t=0 this field is pointing in the x direction, but it rotates counterclockwise in the x-z plane with angular frequency ω, so that at any later time t this field is at an angle ωt relative to the x-axis:Calculate the probability that at a later t..
Exceptions-memory management and concurrency : This question asks you to compare properties of exceptions in C++ and Java.
Smith-kline company maintains inventory : Smith-Kline Company maintains inventory records at selling prices as well as at cost.
What is the tension in the support cable : A certain steam engine has an output of 500 hp and its efficiency in the use of fuel is 14%. It burns fuel oil that has a heat of combustion of 10,000 cal/g. How many kg of oil does the engine consume each hour?
Problem regarding the java bytecode analysis : One property of a Java program that is checked by the veri?er is that each object must be properly initialized before it is used. This property is fairly dif?cult to check. One relatively simple part of the analysis, however, is to guarantee that ..
The amount of the average investment for a proposed : The amount of the average investment for a proposed investment of $120,000 in a fixed asset with a useful life of 4 years, straight-line depreciation
Java interfaces-multiple inheritance : In C++, a derived class may have multiple base classes. In contrast, a Java derived class may only have one base class but may implement more than one interface. This question asks you to compare these two language designs.
A complete physical inventory : A complete physical inventory taken at year-end indicates only 50 units of this product actually are on hand
Find perturbation to energy of lowest-energy singlet state : Suppose that the particles interact weakly by the potential V_1(x)=Kdelta(x_1 - x_2), where x_1 and x_2 are the positions of the two particles , K is a constant, and delta is the Dirac delta function. This represents a very short-range weak force ..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a recursive method to print all permutations of string

Write a recursive method to print all the permutations of a string. For instance, for a string abc, the printout is: abc acb bac bca cab cba

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Process of identifying classes or functions for replacement

A 700- to 1050-word paper describing the following: How the two programs were selected and The process of identifying the classes or functions for replacement

  Write java program which will permit user to make selection

Write the Java Program which will permit the user to make selection. You will present user with two options to perform, then you will perform action selected by user.

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  The application with all the specifications should be

the application with all the specifications should be developed based on a graphical user interface.1. implement proper

  What are differences between trusted and untrusted applets

What are the differences between trusted and untrusted applets? Why doesn't an applet viewed through the browser respond to keyboard events, but the same works fine from within appletviewer?

  1 what makes a program easy to modify2 describe the order

1. what makes a program easy to modify?2. describe the order of magnitude of the following code section using bigo

  Write a test program that obtains from the user

Write a test program that obtains from the user the items to store in two sets A and B, and displays the union A u B, the inter- section A n B, and the dierence A \ B. The data type of the items is your choice. ( you can only store objects.)

  Prepare demo program that implements all of above method

Specify, design, and implement a class that can be used in a program that simulates a combination lock.

  Java program to determine roots of a quadratic equation

Write a java program to determine roots of a quadratic equation, the program should use GUI to display the output, either complex or simple roots.

  What is the smallest exponent

In storing number in a string of 16 bits, the first bit is used for the sign of the number, and the next 5 bits store the exponent plus the bias, and the remaining 10 bits store the mantissa. The bias is 15.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd