United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6490042 Bogus assert in InterpreterMacroAssembler::call_VM_leaf_base
JDK-6490042 : Bogus assert in InterpreterMacroAssembler::call_VM_leaf_base

Details
Type:
Bug
Submit Date:
2006-11-03
Status:
Closed
Updated Date:
2012-10-08
Project Name:
JDK
Resolved Date:
2006-11-14
Component:
hotspot
OS:
generic
Sub-Component:
runtime
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs10 (b03)

Related Reports
Backport:
Backport:

Sub Tasks

Description
In interp_masm_i486.cpp, InterpreterMacroAssembler::call_VM_leaf_base contains a
bogus assert that the fix for 6481691 occassionally triggers.

Steve Goldman found and removed the bogus assert as part of other work, but the
fix hasn't made it back into any group workspace.

This is the bogus assert

#ifdef ASSERT
  { Label L;
    cmpl(esi, Address(ebp, frame::interpreter_frame_bcx_offset * wordSize));
    jcc(Assembler::equal, L);
    stop("InterpreterMacroAssembler::call_VM_leaf_base: esi not callee saved?");    bind(L);
  }
  { Label L;
    cmpl(edi, Address(ebp, frame::interpreter_frame_locals_offset * wordSize));
    jcc(Assembler::equal, L);
    stop("InterpreterMacroAssembler::call_VM_leaf_base: edi not callee saved?");    bind(L);
  }
#endif

Essentially, we're checking that esi and edi have the same values they had when
before we called out to the runtime.  We do not, however, want to save them here,
as noted in a previous comment

  // Note: No need to save/restore bcp & locals (esi & edi) pointer
  //       since these are callee saved registers and no blocking/
  //       GC can happen in leaf calls.

                                    

Comments
EVALUATION

Ok.
                                     
2006-11-03
SUGGESTED FIX

Remove the bogus assert.

23a24,29
>   // Further Note: DO NOT save/restore bcp/locals. If a caller has
>   // already saved them so that it can use esi/edi as temporaries
>   // then a save/restore here will DESTROY the copy the caller
>   // saved! There used to be a save_bcp() that only happened in
>   // the ASSERT path (no restore_bcp). Which caused bizarre failures
>   // when jvm built with ASSERTs.
25d30
<   save_bcp();
36,49c41,44
< #ifdef ASSERT
<   { Label L;
<     cmpl(esi, Address(ebp, frame::interpreter_frame_bcx_offset * wordSize));
<     jcc(Assembler::equal, L);
<     stop("InterpreterMacroAssembler::call_VM_leaf_base: esi not callee saved?");
<     bind(L);
<   }
<   { Label L;
<     cmpl(edi, Address(ebp, frame::interpreter_frame_locals_offset * wordSize));
<     jcc(Assembler::equal, L);
<     stop("InterpreterMacroAssembler::call_VM_leaf_base: edi not callee saved?");
<     bind(L);
<   }
< #endif
---
>
>   // Used to ASSERT that esi/edi were equal to frame's bcp/locals
>   // but since they may not have been saved (and we don't want to
>   // save them here (see note above) the assert is invalid.
                                     
2006-11-03



Hardware and Software, Engineered to Work Together