RFR 8224631 [lworld] C1 asserts - Could not resolve circular dependency

Ioi Lam ioi.lam at oracle.com
Thu May 23 05:13:43 UTC 2019


The verified entry point of a C1-compiled method packs scalarized fields 
into buffered value objects. The assert happens when the fields of a 
value argument (rp4 in the following example) span across a reserved 
entry in the stack:

  test63(RefPoint_Access rpa, RefPoint rp1, RefPoint rp2, Number n1, 
RefPoint rp3, RefPoint rp4, Number n2) {}

(The only "Q" type is RefPoint)

[Verified Entry Point]
   rsi:rsi   = (this)
   rdx:rdx   = L RefPoint_Access rpa
   rcx:rcx   = Q RefPoint rp1.x
   r8:r8     = Q RefPoint rp1.y
   r9:r9     = Q RefPoint rp2.x
   rdi:rdi   = Q RefPoint rp2.x
   [sp+0x50] = L Number n1
   [sp+0x58] = [RESERVED]
   [sp+0x60] = Q RefPoint rp3.x
   [sp+0x68] = Q RefPoint rp3.y
   [sp+0x70] = Q RefPoint rp4.x <<
   [sp+0x78] = [RESERVED] <<<<<<<<<<<<<
   [sp+0x80] = Q RefPoint rp4.y <<
   [sp+0x88] = L Number n1

C1 does not use the RESREVED entries. The fix is to properly mark 
[sp+0x78] as writable, before we start shuffling. This is done in the 
new mark_reserved_entries_writable() method.

I also refactored the initialization of reg_state[] into a separate 
method, to make the code more manageable.

- Ioi

More information about the valhalla-dev mailing list