Issue Details (XML | Word | Printable)

Key: RVM-116
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Ian Rogers
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
RVM

Solve/remove comments in ScanThread

Created: 05/Jul/07 12:24 PM   Updated: 15/Oct/08 07:48 AM
Component/s: MMTk
Affects Version/s: None
Fix Version/s: 3.0.2

Time Tracking:
Not Specified


 Description  « Hide
In MMTk/ext/vm/jikesrvm/org/jikesrvm/mm/mmtk/ScanThread.java there are 3 rather worrying comments highlighting issues from Steve:

(1)
/**

  • When an exception occurs, registers are saved temporarily. If
  • the stack being scanned is in this state, we need to scan those
  • registers for code pointers. If the codeLocations deque is null,
  • then scanning for code pointers is not required, so we don't need
  • to do anything. (SB: Why only code pointers?)
    *
  • @param verbosity The level of verbosity to be used when
  • performing the scan.
    */
    private void getHWExceptionRegisters(int verbosity) {
    ...

(2)
/**

  • Identify all pointers into code pointers associated with a frame.
  • There are two cases to be considered: a) the instruction pointer
  • associated with each frame (stored in the thread's metadata for
  • the top frame and as a return address for all subsequent frames),
  • and b) local variables on the stack which happen to be pointers
  • to code.<p>
    *
  • FIXME: SB: Why is it that JNI frames are skipped when considering
  • top of stack frames, while boot image frames are skipped when
  • considering other frames. Shouldn't they both be considered in
  • both cases?
    *
  • @param verbosity The level of verbosity to be used when
  • performing the scan.
    */
    private void processFrameForCode(int verbosity) {
    ...

(3)
/**

  • AIX-specific code.<p>
    *
  • If we are scanning the stack of a thread that entered the VM via
  • a createVM or attachVM then the "bottom" of the stack had native
  • C frames instead of the usual java frames. The JNIEnv for the
  • thread may still contain jniRefs that have been returned to the
  • native C code, but have not been reported for GC. calling
  • getNextReferenceAddress without first calling setup... will
  • report the remaining jniRefs in the current "frame" of the
  • jniRefs stack. (this should be the bottom frame)
    *
  • FIXME: SB: Why is this AIX specific? Why depend on the
  • preprocessor?
    *
  • @param verbosity The level of verbosity to be used when
  • performing the scan.
    */
    private void checkJNIBase(int verbosity) {
    ...

These issues should be addressed, fixing the possible problems and the comments removed.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
David Grove added a comment - 28/Mar/08 08:44 PM
The GPRs of the hardwareExceptionRegisters are handled by VM_HardwareTrapGCMapIterator which updates the stack scan register location objects to point into the hardwareExceptionRegisters object. That's why we don't need to process the contents of the registers in the MMTk stack scanning routine. I'll add a comment to the code to point this out.

Ian Rogers added a comment - 03/Apr/08 04:32 AM
Did you change the comment, can we close the issue? Thanks.

David Grove added a comment - 03/Apr/08 08:58 AM
(1) Is not an issue (I updated comment). (2) and (3) still need to be dealt with at some point.