Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8156922

[ppc] Implement template interpreter stack overflow checks as on x86/sparc.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • hotspot
    • None
    • b122
    • ppc

      Stack overflow handling in the template interpreter differs on ppc.

      On x86/sparc, the frame is pushed before stack banging. Before the frame is pushed, the interpreter checks whether the frame fits below the boundary
      of "stack_end() - MAX2(guard zones, shadow zone)". If not, a stack overflow exception is thrown without using yellow and reserved stack zones.

      If it fits, the frame is pushed, and the proper stack bang is executed.

      On ppc, we only do a stack check before we push the frame. We check whether the frame fits below the boundary of "stack_end() - (guard zones + shadow zone)" which replaces the full stack bang. Unfortunately this does not allow to use the yellow zone. The reserved zone is not yet implemented on ppc.

      This change implements stack banging for ppc as on x86/sparc.
      This is in preparation of porting "JEP 270: Reserved Stack Areas for Critical Sections"

      Note:

      The x86/sparc design can not handle frames bigger than (guard zone + shadow zone) - MAX2(guard zone, shadow zone) = MIN2(guard zone, shadow zone). This is the case if the frame before (the sender frame) reached close to the shadow zone boundary. In consequence, this means that MIN2(guard zone, shadow zone) must suffice to handle the stack overflows. Also, because the yellow zone is not enabled, this handling may not use any Java code which will bang the stack and might miss the yellow zone.

      Finally, during handling an overflow after enabling the yellow zone, this first check limits Java frames, as the boundary (the value MAX2(guard zone, shadow zone)) is hard-coded into the interpreter and not adapted if the yellow zone is unprotected.

            goetz Goetz Lindenmaier
            goetz Goetz Lindenmaier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: