Studio 8 and 9: Getting to know your target: The Java Virtual Machine

Grading note

This studio, which will last 2 weeks, counts for the two quizzes of those weeks and lab 5.

Preparation (2 hours, before studio)

Read through the following materials:
  1. Tutorial by Carl Bredlau
  2. Tutorial (author unknown)
Consider the following materials for reference:

Studio Sessions Overview:

The results of your studio session are to be reported and documented in a file that you save in your workspace. You are to print and turn in one copy of that report for your group. In the descriptions of the studio exercises, verbs like report and document are indications of activities you should summarize and discuss in your report.

In your groups, take turns documenting results, looking over shoulders, and staffing the keyboard.

It is unacceptable to copy anything without understanding it. At any point, the TA or instructor can point to something you've done and ask you why it works, or change it and ask what would happen with the modification.

Setup (5 minutes)

  1. Form groups as usual.
  2. Download this zip file.
  3. Install said zip file as usual: as an existing eclipse project from a zip archive file.
  4. Try to build it by running the build.xml file

Run, read, and write some JVM programs (1 hour)

Visit the Test1, Test2, Test3, Test4 programs in the zip. There are questions posed in each file. Follow the instructions and find answers to the questions, writing those answers into the files themselves.

Investigations (30 minutes)

Investigate following questions and issues as a team and write up your findings.
  1. The JVM is almost a zero-address machine.
    1. In what ways is the JVM not a zero-address machine?
    2. Why was it designed this way?
  2. There are many ways of setting the contents of a JVM register to 0.
    1. Describe 3 relatively efficient ways
    2. Devise an incredibly inefficient way; see if your way is less efficient than some other group's
    3. Why is the JVM designed this way (with many ways of doing the same thing)?

Contest (Lab 5) and finishing up

If you have time, begin work on the Contest.j file. You will continue this work next week. It counts as Lab 5.

Last modified 08:19:12 CDT 07 April 2008 by Ron K. Cytron