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

  Implement a class person with two fields name

Implement a class Person with two fields name and age, and a class Car with three fields - implement a class that saves the details of the person.

  Create an array of five employee objects

Create an array of five Employee objects. Prompt the user to enter data for each Employee. Do not allow duplicate ID numbers to be entered.

  Write a class encapsulating a pc-based game

Write a class encapsulating a PC-based game, which inherits from Game. A PC-bases game has the following additional attributes: the minimum megabytes of RAM needed to play the fame, the number of megabytes needed on the hard drive to install the fame..

  Calculate the new date by adding a fixed number of days

What I have done is the "ExtendedDate.java", which improved the "data.java" that the program will firstly check if the date input from users is valid then store it with the setDate method.

  How are exceptions caught

How are exceptions caught? When should Exception Handling be used

  Two java application using java netbeans ide

The application should ask the user to enter annual sales, and it should display the total annual compensation.

  Create simple java application that uses the string class

Create your own simple Java application that uses the String class and/or the StringBuffer class and at least 4 of the class methods. Show the code, demonstrate it works properly and describe what it is doing.

  Write a program to print out a simplified bill

Write a program to print out a simplified bill. The customer's name, the number of hours of labor, and the cost of parts and supplies should be entered in response to INPUT statements.

  Digital image processing using java

Digital image processing using java ..create plugin using Jedit and run it in imageJ

  What are the various types of dns servers and their purpose

question 1 what is the role of dns how is it structured and why it is necessary?question 2 what are the different kinds

  Java program to compute invoice for client

You need a java program to compute the invoice for client and then print out invoice to the screen. The consulting rate is $200 per hour.

  Write a point class that represents points on an x y axis

write a point class that represents points on an x y axis. the data members should be doubles x and y plus an int value

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