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

Rework bitmanipulation of ScaningOption sets

XMLWordPrintable

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

      ScanningOption is an enum:

      enum ScanningOption {
        SO_None = 0x0,
        SO_AllClasses = 0x1,
        SO_SystemClasses = 0x2,
        SO_Strings = 0x4,
        SO_AllCodeCache = 0x8,
        SO_ScavengeCodeCache = 0x10
      };

      but we combine the individual enum values into ScanningOption values that are not part of the enum definition.

      E.g.:
         int so = SharedHeap::SO_AllClasses | SharedHeap::SO_Strings |
      SharedHeap::SO_ScavengeCodeCache;

      and later the cast "so", a set of values, to ScanningOption:

         gch->gen_process_strong_roots(_gen->level(),
                                       true, // Process younger gens, if any,
                                              // as strong roots.
                                       false, // [...]
      ----> SharedHeap::ScanningOption(so),
                                       &par_scan_state.to_space_root_closure(),
                                       &par_scan_state.older_gen_closure(),
                                       &klass_scan_closure);

      We might want to clean this up so that we don't have to transition back and forth between ScanningOption (single value), int, and ScanningOption (combined values).

            Unassigned Unassigned
            stefank Stefan Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: