# HG changeset patch # User Doug Simon # Date 1466495282 -7200 # Node ID 9ac04c6047c87a641f5637f5f1e7764bfc8812f3 # Parent abebb99b6b509dcedf9dc60f717914d0eaf247eb sync with jdk9 changes for JDK-8159613 diff -r abebb99b6b50 -r 9ac04c6047c8 jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodeFrame.java --- a/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodeFrame.java Sun Jun 19 16:08:40 2016 +0200 +++ b/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodeFrame.java Tue Jun 21 09:48:02 2016 +0200 @@ -66,10 +66,10 @@ * Note that the number of locals and the number of stack slots may be smaller than the maximum * number of locals and stack slots as specified in the compiled method. * - * This field is intentional exposed as a mutable array that a compiler may modify (e.g. during - * register allocation). + * This field is intentionally exposed as a mutable array that a compiler may modify (e.g. + * during register allocation). */ - @SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "field is intentional mutable")// + @SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "field is intentionally mutable")// public final JavaValue[] values; /** diff -r abebb99b6b50 -r 9ac04c6047c8 jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterAttributes.java --- a/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterAttributes.java Sun Jun 19 16:08:40 2016 +0200 +++ b/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterAttributes.java Tue Jun 21 09:48:02 2016 +0200 @@ -78,23 +78,24 @@ } /** - * @return if a register that is available for use by a register allocator. + * @return {@code true} if a register is available for use by a register allocator otherwise + * {@code false} */ public boolean isAllocatable() { return allocatable; } /** - * @return if a register whose value preservation (if required) across a call is the - * responsibility of the callee. + * @return {@code true} if a register whose value preservation (if required) across a call is + * the responsibility of the callee otherwise {@code false} */ public boolean isCalleeSave() { return calleeSave; } /** - * @return if a register whose value preservation (if required) across a call is the - * responsibility of the caller. + * @return {@code true} if a register whose value preservation (if required) across a call is + * the responsibility of the caller otherwise {@code false} */ public boolean isCallerSave() { return callerSave; diff -r abebb99b6b50 -r 9ac04c6047c8 jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java --- a/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java Sun Jun 19 16:08:40 2016 +0200 +++ b/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java Tue Jun 21 09:48:02 2016 +0200 @@ -631,7 +631,7 @@ */ public String getName() { final int nameIndex = getNameIndex(); - return isInternal() ? HotSpotVmSymbols.symbolAt(nameIndex) : getConstantPool().lookupUtf8(nameIndex); + return isInternal() ? config().symbolAt(nameIndex) : getConstantPool().lookupUtf8(nameIndex); } /** @@ -640,7 +640,7 @@ */ public String getSignature() { final int signatureIndex = getSignatureIndex(); - return isInternal() ? HotSpotVmSymbols.symbolAt(signatureIndex) : getConstantPool().lookupUtf8(signatureIndex); + return isInternal() ? config().symbolAt(signatureIndex) : getConstantPool().lookupUtf8(signatureIndex); } public JavaType getType() { diff -r abebb99b6b50 -r 9ac04c6047c8 jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java --- a/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java Sun Jun 19 16:08:40 2016 +0200 +++ b/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java Tue Jun 21 09:48:02 2016 +0200 @@ -22,6 +22,10 @@ */ package jdk.vm.ci.hotspot; +import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE; + +import sun.misc.Unsafe; + /** * Used to access native configuration details. */ @@ -224,6 +228,21 @@ final int vmSymbolsFirstSID = getConstant("vmSymbols::FIRST_SID", Integer.class); final int vmSymbolsSIDLimit = getConstant("vmSymbols::SID_LIMIT", Integer.class); + /** + * Returns the symbol in the {@code vmSymbols} table at position {@code index} as a + * {@link String}. + * + * @param index position in the symbol table + * @return the symbol at position id + */ + String symbolAt(int index) { + HotSpotJVMCIRuntime runtime = HotSpotJVMCIRuntime.runtime(); + assert vmSymbolsFirstSID <= index && index < vmSymbolsSIDLimit : "index " + index + " is out of bounds"; + assert symbolPointerSize == Unsafe.ADDRESS_SIZE : "the following address read is broken"; + int offset = index * symbolPointerSize; + return runtime.getCompilerToVM().getSymbol(UNSAFE.getAddress(vmSymbolsSymbols + offset)); + } + final int klassHasFinalizerFlag = getConstant("JVM_ACC_HAS_FINALIZER", Integer.class); // Modifier.SYNTHETIC is not so we get it via vmStructs. diff -r abebb99b6b50 -r 9ac04c6047c8 jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVmSymbols.java --- a/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVmSymbols.java Sun Jun 19 16:08:40 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.hotspot; - -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; -import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE; -import sun.misc.Unsafe; - -/** - * Class to access the C++ {@code vmSymbols} table. - */ -final class HotSpotVmSymbols { - - /** - * Returns the symbol in the {@code vmSymbols} table at position {@code index} as a - * {@link String}. - * - * @param index position in the symbol table - * @return the symbol at position id - */ - static String symbolAt(int index) { - HotSpotJVMCIRuntimeProvider runtime = runtime(); - HotSpotVMConfig config = runtime.getConfig(); - assert config.vmSymbolsFirstSID <= index && index < config.vmSymbolsSIDLimit : "index " + index + " is out of bounds"; - assert config.symbolPointerSize == Unsafe.ADDRESS_SIZE : "the following address read is broken"; - int offset = index * config.symbolPointerSize; - return runtime.getCompilerToVM().getSymbol(UNSAFE.getAddress(config.vmSymbolsSymbols + offset)); - } -}