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

  Survey conductor application

Survey Conductor Application: You have been asked by your manager to create a user-friendly application that will present a survey to your customers

  Generate an array of random integers from zero to nine

Generate an array of 20 random integers from zero to nine. Search for the first occurrence, if any, of the number 7, and report its position in the array

  Implement your client-server system

A detailed discussion of the methodology you used to implement your client-server system and a concise and detailed design for the client-server system

  Find method of the class is passed each of the targets

How many calls to the recFind method of the ArraySortedList3 class are made when the find method of the class is passed each of the targets?

  Write a java statement to create an arraylist

Write a java statement to create an ArrayList called list to hold 25 integers - What is the type of the ArrayList defined in question number 1.

  Cse-241 advance programming conceptspoint of sale

cse-241 advance programming conceptspoint of sale terminalin this assignment you will be tested on the concepts related

  Write a java method that repeatedly selects

Write a Java method that repeatedly selects and removes a random entry from an array until the array holds no more entries.

  Compilers check programs for syntax errors

Compilers check programs for syntax errors, but frequently a lack of one symbol (such as a missing brace or comment starter) will cause the compiler to spill out a number of diagnostics without identifying the real error

  Create a class named date that stores date values

Create a class named Date that stores date values

  Implement/update specific methods for the dfs of a graph

show the DFS order of vertices in the graph, and for each node, specify its parent node in the search (the node from which the currect node was reached). Moreover, display for each node the discovery and finishing time, to check that the Parenthesis ..

  Implements the measurable interface

Implement a class Quiz that implements the Measurable interface. A quiz has a score and a letter grade (such as B+).

  Create a graphical application stackdemogui

Create a graphical application StackDemoGUI that provides a button for push and pop from a stack, a text field to accept a string as input for push, and a text area to show the contents of the stack after each operation.

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