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

Refactor similar code in ReservedHeapSpace::try_reserve_heap and ReservedSpace::initialize

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • 9
    • 9
    • hotspot


      They could be the same except metaspace uses them for compressed class space.

      From Goetz:

      1) Merging ReservedHeap::initialize and ReservedHeapSpace::try_reserve_heap.
       
      The new code calls initialize() with requested_address = NULL, but metaspace.cpp
      passes a real requested_address. Therefore I can not clean up the calls to
      failed_to_reserve_as_requested() in initialize(). Without that cleanup, I need to pass flags
      into initialize() to configure all the different behaviours I would need in a
      merged case.
      I think with 'large' and 'requested_address' there is already enough cases
      in that method, so that I don't want to add more.

      2) Moving _noaccess_prefix to ReservedHeapSpace

      This does not work as ReservedHeapSpace is casted to
      ReservedSpace and returned by value. So ReservedHeapSpace can not have
      fields or virtual methods.
      It would be probably better to change the code to return ReservedHeapSpace
      by pointer, or, at least under that type, but I think that exceeds the scope of this change.

      (Is duplicate code a bug or RFE?)

            Unassigned Unassigned
            coleenp Coleen Phillimore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: