src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigVersioned.java
changeset 49873 26ebfe8ce852
child 50083 07015dd8157f
equal deleted inserted replaced
49872:0798eab12791 49873:26ebfe8ce852
       
     1 /*
       
     2  * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
       
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     4  *
       
     5  * This code is free software; you can redistribute it and/or modify it
       
     6  * under the terms of the GNU General Public License version 2 only, as
       
     7  * published by the Free Software Foundation.
       
     8  *
       
     9  * This code is distributed in the hope that it will be useful, but WITHOUT
       
    10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    12  * version 2 for more details (a copy is included in the LICENSE file that
       
    13  * accompanied this code).
       
    14  *
       
    15  * You should have received a copy of the GNU General Public License version
       
    16  * 2 along with this work; if not, write to the Free Software Foundation,
       
    17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    18  *
       
    19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
       
    20  * or visit www.oracle.com if you need additional information or have any
       
    21  * questions.
       
    22  */
       
    23 package org.graalvm.compiler.hotspot;
       
    24 
       
    25 import jdk.vm.ci.hotspot.HotSpotVMConfigAccess;
       
    26 import jdk.vm.ci.hotspot.HotSpotVMConfigStore;
       
    27 
       
    28 /**
       
    29  * This is a source with different versions for various JDKs. When modifying/adding a field in this
       
    30  * class accessed from outside this class, be sure to update the field appropriately in all source
       
    31  * files named {@code GraalHotSpotVMConfigVersioned.java}.
       
    32  *
       
    33  * Fields are grouped according to the most recent JBS issue showing why they are versioned.
       
    34  *
       
    35  * JDK Version: 11+
       
    36  */
       
    37 final class GraalHotSpotVMConfigVersioned extends HotSpotVMConfigAccess {
       
    38 
       
    39     GraalHotSpotVMConfigVersioned(HotSpotVMConfigStore store) {
       
    40         super(store);
       
    41     }
       
    42 
       
    43     // JDK-8073583
       
    44     final boolean useCRC32CIntrinsics = getFlag("UseCRC32CIntrinsics", Boolean.class);
       
    45 
       
    46     // JDK-8075171
       
    47     final boolean inlineNotify = getFlag("InlineNotify", Boolean.class);
       
    48 
       
    49     // JDK-8046936
       
    50     final int javaThreadReservedStackActivationOffset = getFieldOffset("JavaThread::_reserved_stack_activation", Integer.class, "address");
       
    51     final int methodFlagsOffset = getFieldOffset("Method::_flags", Integer.class, "u2");
       
    52     final long throwDelayedStackOverflowErrorEntry = getFieldValue("StubRoutines::_throw_delayed_StackOverflowError_entry", Long.class, "address");
       
    53     final long enableStackReservedZoneAddress = getAddress("SharedRuntime::enable_stack_reserved_zone");
       
    54 
       
    55     // JDK-8135085
       
    56     final int methodIntrinsicIdOffset = getFieldOffset("Method::_intrinsic_id", Integer.class, "u2");
       
    57 
       
    58     // JDK-8151956
       
    59     final int methodCodeOffset = getFieldOffset("Method::_code", Integer.class, "CompiledMethod*");
       
    60 
       
    61     // JDK-8059606
       
    62     final int invocationCounterIncrement = getConstant("InvocationCounter::count_increment", Integer.class);
       
    63     final int invocationCounterShift = getConstant("InvocationCounter::count_shift", Integer.class);
       
    64 
       
    65     // JDK-8195142
       
    66     final byte dirtyCardValue = getConstant("CardTable::dirty_card", Byte.class);
       
    67     final byte g1YoungCardValue = getConstant("G1CardTable::g1_young_gen", Byte.class);
       
    68 
       
    69     // JDK-8201318
       
    70     final int g1SATBQueueMarkingOffset = getConstant("G1ThreadLocalData::satb_mark_queue_active_offset", Integer.class);
       
    71     final int g1SATBQueueIndexOffset = getConstant("G1ThreadLocalData::satb_mark_queue_index_offset", Integer.class);
       
    72     final int g1SATBQueueBufferOffset = getConstant("G1ThreadLocalData::satb_mark_queue_buffer_offset", Integer.class);
       
    73     final int g1CardQueueIndexOffset = getConstant("G1ThreadLocalData::dirty_card_queue_index_offset", Integer.class);
       
    74     final int g1CardQueueBufferOffset = getConstant("G1ThreadLocalData::dirty_card_queue_buffer_offset", Integer.class);
       
    75 
       
    76     // JDK-8033552
       
    77     final long heapTopAddress = getFieldValue("CompilerToVM::Data::_heap_top_addr", Long.class, "HeapWord* volatile*");
       
    78 
       
    79     // JDK-8015774
       
    80     final long codeCacheLowBound = getFieldValue("CodeCache::_low_bound", Long.class, "address");
       
    81     final long codeCacheHighBound = getFieldValue("CodeCache::_high_bound", Long.class, "address");
       
    82 }