--- a/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp Thu Nov 01 20:37:45 2018 -0700
+++ b/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp Fri Nov 02 00:26:25 2018 -0700
@@ -209,6 +209,7 @@
return map;
}
+#if INCLUDE_AOT
AOTOopRecorder::AOTOopRecorder(Arena* arena, bool deduplicate) : OopRecorder(arena, deduplicate) {
_meta_refs = new GrowableArray<jobject>();
}
@@ -268,6 +269,7 @@
assert(index == _meta_refs->length(), "must be last");
_meta_refs->append(o);
}
+#endif // INCLUDE_AOT
void* CodeInstaller::record_metadata_reference(CodeSection* section, address dest, Handle constant, TRAPS) {
/*
@@ -555,6 +557,7 @@
}
}
+#if INCLUDE_AOT
RelocBuffer::~RelocBuffer() {
if (_buffer != NULL) {
FREE_C_HEAP_ARRAY(char, _buffer);
@@ -593,9 +596,7 @@
// Get instructions and constants CodeSections early because we need it.
_instructions = buffer.insts();
_constants = buffer.consts();
-#if INCLUDE_AOT
buffer.set_immutable_PIC(_immutable_pic_compilation);
-#endif
initialize_fields(target(), JNIHandles::resolve(compiled_code_obj), CHECK_OK);
JVMCIEnv::CodeInstallResult result = initialize_buffer(buffer, false, CHECK_OK);
@@ -618,6 +619,7 @@
reloc_buffer->set_size(size);
return JVMCIEnv::ok;
}
+#endif // INCLUDE_AOT
// constructor used to create a method
JVMCIEnv::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler, Handle target, Handle compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log, TRAPS) {
@@ -769,6 +771,7 @@
}
}
}
+#if INCLUDE_AOT
if (UseAOT && site->is_a(site_Call::klass())) {
oop target = site_Call::target(site);
InstanceKlass* target_klass = InstanceKlass::cast(target->klass());
@@ -777,6 +780,7 @@
aot_call_stubs++;
}
}
+#endif
}
}
int size = static_call_stubs * CompiledStaticCall::to_interp_stub_size();
@@ -1278,10 +1282,12 @@
if (!_immutable_pic_compilation) {
pd_patch_MetaspaceConstant(pc_offset, constant, CHECK);
}
+#if INCLUDE_AOT
} else if (constant->is_a(HotSpotSentinelConstant::klass())) {
if (!_immutable_pic_compilation) {
JVMCI_ERROR("sentinel constant not supported for normal compiles: %s", constant->klass()->signature_name());
}
+#endif
} else {
JVMCI_ERROR("unknown constant type in data patch: %s", constant->klass()->signature_name());
}
--- a/src/hotspot/share/jvmci/jvmciCodeInstaller.hpp Thu Nov 01 20:37:45 2018 -0700
+++ b/src/hotspot/share/jvmci/jvmciCodeInstaller.hpp Fri Nov 02 00:26:25 2018 -0700
@@ -28,6 +28,7 @@
#include "jvmci/jvmciEnv.hpp"
#include "code/nativeInst.hpp"
+#if INCLUDE_AOT
class RelocBuffer : public StackObj {
enum { stack_size = 1024 };
public:
@@ -106,6 +107,7 @@
AOTOopRecorder* _oop_recorder;
ExceptionHandlerTable* _exception_table;
};
+#endif // INCLUDE_AOT
/*
* This class handles the conversion from a InstalledCode to a CodeBlob or an nmethod.
@@ -202,7 +204,9 @@
CodeInstaller(bool immutable_pic_compilation) : _arena(mtCompiler), _immutable_pic_compilation(immutable_pic_compilation) {}
+#if INCLUDE_AOT
JVMCIEnv::CodeInstallResult gather_metadata(Handle target, Handle compiled_code, CodeMetadata& metadata, TRAPS);
+#endif
JVMCIEnv::CodeInstallResult install(JVMCICompiler* compiler, Handle target, Handle compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log, TRAPS);
static address runtime_call_target_address(oop runtime_call);
--- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp Thu Nov 01 20:37:45 2018 -0700
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp Fri Nov 02 00:26:25 2018 -0700
@@ -714,6 +714,7 @@
C2V_END
C2V_VMENTRY(jint, getMetadata, (JNIEnv *jniEnv, jobject, jobject target, jobject compiled_code, jobject metadata))
+#if INCLUDE_AOT
ResourceMark rm;
HandleMark hm;
@@ -783,6 +784,9 @@
HotSpotMetaData::set_exceptionBytes(metadata_handle, exceptionArrayOop());
return result;
+#else
+ THROW_MSG_0(vmSymbols::java_lang_InternalError(), "unimplemented");
+#endif
C2V_END
C2V_VMENTRY(void, resetCompilationStatistics, (JNIEnv *jniEnv, jobject))
@@ -1426,12 +1430,16 @@
C2V_END
C2V_VMENTRY(jlong, getFingerprint, (JNIEnv*, jobject, jlong metaspace_klass))
+#if INCLUDE_AOT
Klass *k = CompilerToVM::asKlass(metaspace_klass);
if (k->is_instance_klass()) {
return InstanceKlass::cast(k)->get_stored_fingerprint();
} else {
return 0;
}
+#else
+ THROW_MSG_0(vmSymbols::java_lang_InternalError(), "unimplemented");
+#endif
C2V_END
C2V_VMENTRY(jobject, getHostClass, (JNIEnv*, jobject, jobject jvmci_type))
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/package-info.java Fri Nov 02 00:26:25 2018 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+/**
+ * The AArch64 platform independent portions of the JVMCI API.
+ */
+package jdk.vm.ci.aarch64;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/package-info.java Fri Nov 02 00:26:25 2018 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+/**
+ * The AMD64 platform independent portions of the JVMCI API.
+ */
+package jdk.vm.ci.amd64;
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodePosition.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodePosition.java Fri Nov 02 00:26:25 2018 -0700
@@ -43,13 +43,19 @@
*
* @param caller the parent position
* @param method the method
- * @param bci a BCI within the method
+ * @param bci a BCI such that {@code method.codeSize() == 0 || bci < method.getCodeSize()}. That
+ * is, if code size is 0 then allow any value, otherwise the bci must be less than
+ * the code size.
*/
public BytecodePosition(BytecodePosition caller, ResolvedJavaMethod method, int bci) {
assert method != null;
this.caller = caller;
this.method = method;
this.bci = bci;
+ int codeSize = method.getCodeSize();
+ if (codeSize != 0 && bci >= codeSize) {
+ throw new IllegalArgumentException(String.format("bci %d is out of range for %s %d bytes", bci, method.format("%H.%n(%p)"), codeSize));
+ }
}
/**
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/package-info.java Fri Nov 02 00:26:25 2018 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2018, 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 that defines the information associated with various {@link jdk.vm.ci.code.site.Site
+ * sites} in generated code.
+ */
+package jdk.vm.ci.code.site;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/package-info.java Fri Nov 02 00:26:25 2018 -0700
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2018, 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 that defines the interface for runtime stack introspection.
+ */
+package jdk.vm.ci.code.stack;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/package-info.java Fri Nov 02 00:26:25 2018 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+/**
+ * Common utility classes used by the JVMCI API.
+ */
+package jdk.vm.ci.common;
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java Fri Nov 02 00:26:25 2018 -0700
@@ -43,7 +43,7 @@
public class AArch64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory {
- protected EnumSet<AArch64.CPUFeature> computeFeatures(@SuppressWarnings("unused") AArch64HotSpotVMConfig config) {
+ private static EnumSet<AArch64.CPUFeature> computeFeatures(@SuppressWarnings("unused") AArch64HotSpotVMConfig config) {
// Configure the feature set using the HotSpot flag settings.
EnumSet<AArch64.CPUFeature> features = EnumSet.noneOf(AArch64.CPUFeature.class);
@@ -87,7 +87,7 @@
return features;
}
- protected EnumSet<AArch64.Flag> computeFlags(@SuppressWarnings("unused") AArch64HotSpotVMConfig config) {
+ private static EnumSet<AArch64.Flag> computeFlags(@SuppressWarnings("unused") AArch64HotSpotVMConfig config) {
EnumSet<AArch64.Flag> flags = EnumSet.noneOf(AArch64.Flag.class);
if (config.useBarriersForVolatile) {
@@ -115,7 +115,7 @@
return flags;
}
- protected TargetDescription createTarget(AArch64HotSpotVMConfig config) {
+ private static TargetDescription createTarget(AArch64HotSpotVMConfig config) {
final int stackFrameAlignment = 16;
final int implicitNullCheckLimit = 4096;
final boolean inlineObjects = true;
@@ -127,12 +127,12 @@
return new HotSpotConstantReflectionProvider(runtime);
}
- protected RegisterConfig createRegisterConfig(AArch64HotSpotVMConfig config, TargetDescription target) {
+ private static RegisterConfig createRegisterConfig(AArch64HotSpotVMConfig config, TargetDescription target) {
return new AArch64HotSpotRegisterConfig(target, config.useCompressedOops);
}
protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntime runtime, TargetDescription target, RegisterConfig regConfig) {
- return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig);
+ return new HotSpotCodeCacheProvider(runtime, target, regConfig);
}
protected HotSpotMetaAccessProvider createMetaAccess(HotSpotJVMCIRuntime runtime) {
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java Fri Nov 02 00:26:25 2018 -0700
@@ -126,8 +126,7 @@
public static final Register threadRegister = r28;
public static final Register fp = r29;
- private static final RegisterArray reservedRegisters
- = new RegisterArray(rscratch1, rscratch2, threadRegister, fp, lr, r31, zr, sp);
+ private static final RegisterArray reservedRegisters = new RegisterArray(rscratch1, rscratch2, threadRegister, fp, lr, r31, zr, sp);
private static RegisterArray initAllocatable(Architecture arch, boolean reserveForHeapBase) {
RegisterArray allRegisters = arch.getAvailableValueRegisters();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/package-info.java Fri Nov 02 00:26:25 2018 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+/**
+ * The AArch64 HotSpot specific portions of the JVMCI API.
+ */
+package jdk.vm.ci.hotspot.aarch64;
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java Fri Nov 02 00:26:25 2018 -0700
@@ -43,7 +43,7 @@
public class AMD64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory {
- protected EnumSet<AMD64.CPUFeature> computeFeatures(AMD64HotSpotVMConfig config) {
+ private static EnumSet<AMD64.CPUFeature> computeFeatures(AMD64HotSpotVMConfig config) {
// Configure the feature set using the HotSpot flag settings.
EnumSet<AMD64.CPUFeature> features = EnumSet.noneOf(AMD64.CPUFeature.class);
if ((config.vmVersionFeatures & config.amd643DNOWPREFETCH) != 0) {
@@ -130,7 +130,7 @@
return features;
}
- protected EnumSet<AMD64.Flag> computeFlags(AMD64HotSpotVMConfig config) {
+ private static EnumSet<AMD64.Flag> computeFlags(AMD64HotSpotVMConfig config) {
EnumSet<AMD64.Flag> flags = EnumSet.noneOf(AMD64.Flag.class);
if (config.useCountLeadingZerosInstruction) {
flags.add(AMD64.Flag.UseCountLeadingZerosInstruction);
@@ -141,7 +141,7 @@
return flags;
}
- protected TargetDescription createTarget(AMD64HotSpotVMConfig config) {
+ private static TargetDescription createTarget(AMD64HotSpotVMConfig config) {
final int stackFrameAlignment = 16;
final int implicitNullCheckLimit = 4096;
final boolean inlineObjects = true;
@@ -153,12 +153,12 @@
return new HotSpotConstantReflectionProvider(runtime);
}
- protected RegisterConfig createRegisterConfig(AMD64HotSpotVMConfig config, TargetDescription target) {
+ private static RegisterConfig createRegisterConfig(AMD64HotSpotVMConfig config, TargetDescription target) {
return new AMD64HotSpotRegisterConfig(target, config.useCompressedOops, config.windowsOs);
}
protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntime runtime, TargetDescription target, RegisterConfig regConfig) {
- return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig);
+ return new HotSpotCodeCacheProvider(runtime, target, regConfig);
}
protected HotSpotMetaAccessProvider createMetaAccess(HotSpotJVMCIRuntime runtime) {
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotVMConfig.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotVMConfig.java Fri Nov 02 00:26:25 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, 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
@@ -25,6 +25,9 @@
import jdk.vm.ci.hotspot.HotSpotVMConfigAccess;
import jdk.vm.ci.hotspot.HotSpotVMConfigStore;
+/**
+ * Used to access AMD64 specific native configuration details.
+ */
class AMD64HotSpotVMConfig extends HotSpotVMConfigAccess {
AMD64HotSpotVMConfig(HotSpotVMConfigStore config) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/package-info.java Fri Nov 02 00:26:25 2018 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+/**
+ * The AMD64 HotSpot specific portions of the JVMCI API.
+ */
+package jdk.vm.ci.hotspot.amd64;
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java Fri Nov 02 00:26:25 2018 -0700
@@ -43,7 +43,7 @@
public class SPARCHotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory {
- protected TargetDescription createTarget(SPARCHotSpotVMConfig config) {
+ private static TargetDescription createTarget(SPARCHotSpotVMConfig config) {
final int stackFrameAlignment = 16;
final int implicitNullCheckLimit = 4096;
final boolean inlineObjects = false;
@@ -52,10 +52,10 @@
}
protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntime runtime, TargetDescription target, RegisterConfig regConfig) {
- return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig);
+ return new HotSpotCodeCacheProvider(runtime, target, regConfig);
}
- protected EnumSet<CPUFeature> computeFeatures(SPARCHotSpotVMConfig config) {
+ private static EnumSet<CPUFeature> computeFeatures(SPARCHotSpotVMConfig config) {
EnumSet<CPUFeature> features = EnumSet.noneOf(CPUFeature.class);
if ((config.vmVersionFeatures & 1L << config.sparc_ADI) != 0) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/package-info.java Fri Nov 02 00:26:25 2018 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+/**
+ * The SPARC HotSpot specific portions of the JVMCI API.
+ */
+package jdk.vm.ci.hotspot.sparc;
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java Fri Nov 02 00:26:25 2018 -0700
@@ -261,9 +261,9 @@
/**
* If {@code cpi} denotes an entry representing a resolved dynamic adapter (see
- * {@code resolveInvokeDynamicInPool} and {@code resolveInvokeHandleInPool}), return the opcode
- * of the instruction for which the resolution was performed ({@code invokedynamic} or
- * {@code invokevirtual}}, or {@code -1} otherwise.
+ * {@link #resolveInvokeDynamicInPool} and {@link #resolveInvokeHandleInPool}), return the
+ * opcode of the instruction for which the resolution was performed ({@code invokedynamic} or
+ * {@code invokevirtual}), or {@code -1} otherwise.
*/
native int isResolvedInvokeHandleInPool(HotSpotConstantPool constantPool, int cpi);
@@ -543,12 +543,11 @@
native boolean shouldDebugNonSafepoints();
/**
- * Writes {@code length} bytes from {@code bytes} starting at offset {@code offset} to the
- * HotSpot's log stream.
+ * Writes {@code length} bytes from {@code bytes} starting at offset {@code offset} to HotSpot's
+ * log stream.
*
- * @exception NullPointerException if {@code bytes == null}
- * @exception IndexOutOfBoundsException if copying would cause access of data outside array
- * bounds
+ * @throws NullPointerException if {@code bytes == null}
+ * @throws IndexOutOfBoundsException if copying would cause access of data outside array bounds
*/
native void writeDebugOutput(byte[] bytes, int offset, int length);
@@ -620,7 +619,7 @@
native int methodDataProfileDataSize(long metaspaceMethodData, int position);
/**
- * Gets the fingerprint for a given Klass*
+ * Gets the fingerprint for a given Klass*.
*
* @param metaspaceKlass
* @return the value of the fingerprint (zero for arrays and synthetic classes).
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EventProvider.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EventProvider.java Fri Nov 02 00:26:25 2018 -0700
@@ -91,7 +91,7 @@
*
* @return a compilation event
*/
- public abstract CompilationEvent newCompilationEvent();
+ CompilationEvent newCompilationEvent();
/**
* A compilation event.
@@ -117,7 +117,7 @@
*
* @return a compiler failure event
*/
- public abstract CompilerFailureEvent newCompilerFailureEvent();
+ CompilerFailureEvent newCompilerFailureEvent();
/**
* A compiler failure event.
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java Fri Nov 02 00:26:25 2018 -0700
@@ -42,13 +42,13 @@
public class HotSpotCodeCacheProvider implements CodeCacheProvider {
protected final HotSpotJVMCIRuntime runtime;
- protected final HotSpotVMConfig config;
+ private final HotSpotVMConfig config;
protected final TargetDescription target;
protected final RegisterConfig regConfig;
- public HotSpotCodeCacheProvider(HotSpotJVMCIRuntime runtime, HotSpotVMConfig config, TargetDescription target, RegisterConfig regConfig) {
+ public HotSpotCodeCacheProvider(HotSpotJVMCIRuntime runtime, TargetDescription target, RegisterConfig regConfig) {
this.runtime = runtime;
- this.config = config;
+ this.config = runtime.getConfig();
this.target = target;
this.regConfig = regConfig;
}
@@ -91,7 +91,7 @@
@Override
public int getMinimumOutgoingSize() {
- return runtime.getConfig().runtimeCallStackSize;
+ return config.runtimeCallStackSize;
}
private InstalledCode logOrDump(InstalledCode installedCode, CompiledCode compiledCode) {
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java Fri Nov 02 00:26:25 2018 -0700
@@ -646,7 +646,7 @@
}
}
- /*
+ /**
* Converts a raw index from the bytecodes to a constant pool index (not a cache index).
*
* @param rawIndex index from the bytecode
@@ -760,6 +760,8 @@
/**
* Determines if {@code type} contains signature polymorphic methods.
*/
+ @SuppressFBWarnings(value = "LI_LAZY_INIT_STATIC", justification = "signaturePolymorphicHolders is a cache, not a singleton that must be constructed exactly once" +
+ "and compiler re-ordering is not an issue due to the VM call")
static boolean isSignaturePolymorphicHolder(final ResolvedJavaType type) {
String name = type.getName();
if (signaturePolymorphicHolders == null) {
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPoolObject.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPoolObject.java Fri Nov 02 00:26:25 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -60,7 +60,7 @@
if (o instanceof HotSpotConstantPoolObject) {
if (super.equals(o)) {
HotSpotConstantPoolObject other = (HotSpotConstantPoolObject) o;
- return type == other.type && cpi == other.cpi;
+ return type.equals(other.type) && cpi == other.cpi;
}
}
return false;
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java Fri Nov 02 00:26:25 2018 -0700
@@ -42,7 +42,7 @@
protected final HotSpotJVMCIRuntime runtime;
protected final HotSpotMethodHandleAccessProvider methodHandleAccess;
- protected final HotSpotMemoryAccessProviderImpl memoryAccess;
+ private final HotSpotMemoryAccessProviderImpl memoryAccess;
public HotSpotConstantReflectionProvider(HotSpotJVMCIRuntime runtime) {
this.runtime = runtime;
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java Fri Nov 02 00:26:25 2018 -0700
@@ -36,7 +36,6 @@
import java.util.Objects;
import java.util.ServiceLoader;
import java.util.Set;
-import java.util.TreeMap;
import java.util.function.Predicate;
import jdk.internal.misc.VM;
@@ -240,16 +239,16 @@
return runtime().getHostJVMCIBackend().getCodeCache().getTarget().wordJavaKind;
}
- protected final CompilerToVM compilerToVm;
+ final CompilerToVM compilerToVm;
protected final HotSpotVMConfigStore configStore;
- protected final HotSpotVMConfig config;
+ private final HotSpotVMConfig config;
private final JVMCIBackend hostBackend;
private final JVMCICompilerFactory compilerFactory;
private final HotSpotJVMCICompilerFactory hsCompilerFactory;
private volatile JVMCICompiler compiler;
- protected final HotSpotJVMCIMetaAccessContext metaAccessContext;
+ final HotSpotJVMCIMetaAccessContext metaAccessContext;
/**
* Stores the result of {@link HotSpotJVMCICompilerFactory#getCompilationLevelAdjustment} so
@@ -324,7 +323,7 @@
}
if (Option.PrintConfig.getBoolean()) {
- printConfig(configStore, compilerToVm);
+ configStore.printConfig();
}
}
@@ -343,11 +342,11 @@
return configStore;
}
- public HotSpotVMConfig getConfig() {
+ HotSpotVMConfig getConfig() {
return config;
}
- public CompilerToVM getCompilerToVM() {
+ CompilerToVM getCompilerToVM() {
return compilerToVm;
}
@@ -578,41 +577,6 @@
}
}
- @SuppressFBWarnings(value = "DM_DEFAULT_ENCODING", justification = "no localization here please!")
- private static void printConfigLine(CompilerToVM vm, String format, Object... args) {
- String line = String.format(format, args);
- byte[] lineBytes = line.getBytes();
- vm.writeDebugOutput(lineBytes, 0, lineBytes.length);
- vm.flushDebugOutput();
- }
-
- private static void printConfig(HotSpotVMConfigStore store, CompilerToVM vm) {
- TreeMap<String, VMField> fields = new TreeMap<>(store.getFields());
- for (VMField field : fields.values()) {
- if (!field.isStatic()) {
- printConfigLine(vm, "[vmconfig:instance field] %s %s {offset=%d[0x%x]}%n", field.type, field.name, field.offset, field.offset);
- } else {
- String value = field.value == null ? "null" : field.value instanceof Boolean ? field.value.toString() : String.format("%d[0x%x]", field.value, field.value);
- printConfigLine(vm, "[vmconfig:static field] %s %s = %s {address=0x%x}%n", field.type, field.name, value, field.address);
- }
- }
- TreeMap<String, VMFlag> flags = new TreeMap<>(store.getFlags());
- for (VMFlag flag : flags.values()) {
- printConfigLine(vm, "[vmconfig:flag] %s %s = %s%n", flag.type, flag.name, flag.value);
- }
- TreeMap<String, Long> addresses = new TreeMap<>(store.getAddresses());
- for (Map.Entry<String, Long> e : addresses.entrySet()) {
- printConfigLine(vm, "[vmconfig:address] %s = %d[0x%x]%n", e.getKey(), e.getValue(), e.getValue());
- }
- TreeMap<String, Long> constants = new TreeMap<>(store.getConstants());
- for (Map.Entry<String, Long> e : constants.entrySet()) {
- printConfigLine(vm, "[vmconfig:constant] %s = %d[0x%x]%n", e.getKey(), e.getValue(), e.getValue());
- }
- for (VMIntrinsicMethod e : store.getIntrinsics()) {
- printConfigLine(vm, "[vmconfig:intrinsic] %d = %s.%s %s%n", e.id, e.declaringClass, e.name, e.descriptor);
- }
- }
-
/**
* Gets an output stream that writes to HotSpot's {@code tty} stream.
*/
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodData.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodData.java Fri Nov 02 00:26:25 2018 -0700
@@ -579,8 +579,9 @@
totalCount += getMethodsNotRecordedExecutionCount(data, position);
- // Fixup the case of C1's inability to optimize profiling of a statically bindable call site.
- // If it's a monomorphic call site, attribute all the counts to the first type (if any is recorded).
+ // Fixup the case of C1's inability to optimize profiling of a statically bindable call
+ // site. If it's a monomorphic call site, attribute all the counts to the first type (if
+ // any is recorded).
if (entries == 1) {
counts[0] = totalCount;
}
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodDataAccessor.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodDataAccessor.java Fri Nov 02 00:26:25 2018 -0700
@@ -82,8 +82,8 @@
}
TriState getExceptionSeen(HotSpotMethodData data, int position) {
- final int EXCEPTIONS_MASK = 1 << config.bitDataExceptionSeenFlag;
- return TriState.get((getFlags(data, position) & EXCEPTIONS_MASK) != 0);
+ final int exceptionsMask = 1 << config.bitDataExceptionSeenFlag;
+ return TriState.get((getFlags(data, position) & exceptionsMask) != 0);
}
/**
@@ -148,4 +148,4 @@
abstract StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos);
-}
\ No newline at end of file
+}
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstant.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstant.java Fri Nov 02 00:26:25 2018 -0700
@@ -91,4 +91,7 @@
* {@code null}
*/
Object asObject(ResolvedJavaType type);
+
+ @Override
+ String toValueString();
}
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotProfilingInfo.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotProfilingInfo.java Fri Nov 02 00:26:25 2018 -0700
@@ -28,7 +28,7 @@
import jdk.vm.ci.meta.ProfilingInfo;
import jdk.vm.ci.meta.TriState;
-public final class HotSpotProfilingInfo implements ProfilingInfo {
+final class HotSpotProfilingInfo implements ProfilingInfo {
private final HotSpotMethodData methodData;
private final HotSpotResolvedJavaMethod method;
@@ -42,7 +42,7 @@
private boolean includeNormal;
private boolean includeOSR;
- public HotSpotProfilingInfo(HotSpotMethodData methodData, HotSpotResolvedJavaMethod method, boolean includeNormal, boolean includeOSR) {
+ HotSpotProfilingInfo(HotSpotMethodData methodData, HotSpotResolvedJavaMethod method, boolean includeNormal, boolean includeOSR) {
this.methodData = methodData;
this.method = method;
this.includeNormal = includeNormal;
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java Fri Nov 02 00:26:25 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, 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
@@ -28,8 +28,6 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
-import jdk.internal.vm.annotation.Stable;
-
import jdk.vm.ci.meta.JavaConstant;
import jdk.vm.ci.meta.JavaType;
import jdk.vm.ci.meta.ResolvedJavaType;
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java Fri Nov 02 00:26:25 2018 -0700
@@ -58,7 +58,8 @@
boolean hasReservedStackAccess();
/**
- * Sets flags on {@code method} indicating that it should never be inlined or compiled by the VM.
+ * Sets flags on {@code method} indicating that it should never be inlined or compiled by the
+ * VM.
*/
void setNotInlinableOrCompilable();
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java Fri Nov 02 00:26:25 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, 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
@@ -22,6 +22,24 @@
*/
package jdk.vm.ci.hotspot;
+import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM;
+import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
+import static jdk.vm.ci.hotspot.HotSpotModifiers.BRIDGE;
+import static jdk.vm.ci.hotspot.HotSpotModifiers.SYNTHETIC;
+import static jdk.vm.ci.hotspot.HotSpotModifiers.VARARGS;
+import static jdk.vm.ci.hotspot.HotSpotModifiers.jvmMethodModifiers;
+import static jdk.vm.ci.hotspot.HotSpotVMConfig.config;
+import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Executable;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
import jdk.vm.ci.common.JVMCIError;
import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option;
import jdk.vm.ci.meta.Constant;
@@ -40,24 +58,6 @@
import jdk.vm.ci.meta.SpeculationLog;
import jdk.vm.ci.meta.TriState;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Executable;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Type;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-
-import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM;
-import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
-import static jdk.vm.ci.hotspot.HotSpotModifiers.BRIDGE;
-import static jdk.vm.ci.hotspot.HotSpotModifiers.SYNTHETIC;
-import static jdk.vm.ci.hotspot.HotSpotModifiers.VARARGS;
-import static jdk.vm.ci.hotspot.HotSpotModifiers.jvmMethodModifiers;
-import static jdk.vm.ci.hotspot.HotSpotVMConfig.config;
-import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
-
/**
* Implementation of {@link JavaMethod} for resolved HotSpot methods.
*/
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java Fri Nov 02 00:26:25 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -102,8 +102,6 @@
int layoutHelper();
- long getFingerprint();
-
@Override
HotSpotResolvedObjectType getEnclosingType();
@@ -127,4 +125,11 @@
return isUnsafeAnonymous();
}
+ /**
+ * Gets the fingerprint for this type.
+ *
+ * @return the value of the fingerprint ({@code 0} for arrays and synthetic classes or if the VM
+ * does not support fingerprints)
+ */
+ long getFingerprint();
}
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java Fri Nov 02 00:26:25 2018 -0700
@@ -66,7 +66,7 @@
}
@Override
- public HotSpotResolvedObjectTypeImpl getArrayClass() {
+ public HotSpotResolvedObjectType getArrayClass() {
if (kind == JavaKind.Void) {
return null;
}
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java Fri Nov 02 00:26:25 2018 -0700
@@ -24,8 +24,8 @@
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Map;
import java.util.Set;
-import java.util.Map;
import jdk.vm.ci.meta.JavaConstant;
import jdk.vm.ci.meta.SpeculationLog;
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java Fri Nov 02 00:26:25 2018 -0700
@@ -50,7 +50,8 @@
if (notPresent != null) {
return notPresent;
}
- throw new JVMCIError("expected VM symbol not found: " + name);
+ store.printConfig();
+ throw new JVMCIError("expected VM symbol not found in " + store + ": " + name);
}
return entry;
}
@@ -81,7 +82,8 @@
if (notPresent != null) {
return notPresent;
}
- throw new JVMCIError("expected VM constant not found: " + name);
+ store.printConfig();
+ throw new JVMCIError("expected VM constant not found in " + store + ": " + name);
}
return type.cast(convertValue(name, type, c, null));
}
@@ -241,7 +243,8 @@
if (!required) {
return null;
}
- throw new JVMCIError("expected VM field not found: " + name);
+ store.printConfig();
+ throw new JVMCIError("expected VM field not found in " + store + ": " + name);
}
// Make sure the native type is still the type we expect.
@@ -285,7 +288,8 @@
if (notPresent != null) {
return notPresent;
}
- throw new JVMCIError("expected VM flag not found: " + name);
+ store.printConfig();
+ throw new JVMCIError("expected VM flag not found in " + store + ": " + name);
} else {
cppType = null;
}
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java Fri Nov 02 00:26:25 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -29,8 +29,10 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.TreeMap;
import jdk.vm.ci.common.InitTimer;
+import jdk.vm.ci.common.JVMCIError;
/**
* Access to VM configuration data.
@@ -108,7 +110,9 @@
try (InitTimer t = timer("CompilerToVm readConfiguration")) {
data = compilerToVm.readConfiguration();
}
- assert data.length == 5 : data.length;
+ if (data.length != 5) {
+ throw new JVMCIError("Expected data.length to be 5, not %d", data.length);
+ }
// @formatter:off
VMField[] vmFieldsInfo = (VMField[]) data[0];
@@ -145,4 +149,52 @@
}
}
}
+
+ @Override
+ public String toString() {
+ return String.format("%s[%d fields, %d constants, %d addresses, %d flags, %d intrinsics]",
+ getClass().getSimpleName(),
+ vmFields.size(),
+ vmConstants.size(),
+ vmAddresses.size(),
+ vmFlags.size(),
+ vmIntrinsics.size());
+ }
+
+ void printConfig() {
+ CompilerToVM vm = compilerToVm;
+ TreeMap<String, VMField> fields = new TreeMap<>(getFields());
+ for (VMField field : fields.values()) {
+ if (!field.isStatic()) {
+ printConfigLine(vm, "[vmconfig:instance field] %s %s {offset=%d[0x%x]}%n", field.type, field.name, field.offset, field.offset);
+ } else {
+ String value = field.value == null ? "null" : field.value instanceof Boolean ? field.value.toString() : String.format("%d[0x%x]", field.value, field.value);
+ printConfigLine(vm, "[vmconfig:static field] %s %s = %s {address=0x%x}%n", field.type, field.name, value, field.address);
+ }
+ }
+ TreeMap<String, VMFlag> flags = new TreeMap<>(getFlags());
+ for (VMFlag flag : flags.values()) {
+ printConfigLine(vm, "[vmconfig:flag] %s %s = %s%n", flag.type, flag.name, flag.value);
+ }
+ TreeMap<String, Long> addresses = new TreeMap<>(getAddresses());
+ for (Map.Entry<String, Long> e : addresses.entrySet()) {
+ printConfigLine(vm, "[vmconfig:address] %s = %d[0x%x]%n", e.getKey(), e.getValue(), e.getValue());
+ }
+ TreeMap<String, Long> constants = new TreeMap<>(getConstants());
+ for (Map.Entry<String, Long> e : constants.entrySet()) {
+ printConfigLine(vm, "[vmconfig:constant] %s = %d[0x%x]%n", e.getKey(), e.getValue(), e.getValue());
+ }
+ for (VMIntrinsicMethod e : getIntrinsics()) {
+ printConfigLine(vm, "[vmconfig:intrinsic] %d = %s.%s %s%n", e.id, e.declaringClass, e.name, e.descriptor);
+ }
+ }
+
+ @SuppressFBWarnings(value = "DM_DEFAULT_ENCODING", justification = "no localization here please!")
+ private static void printConfigLine(CompilerToVM vm, String format, Object... args) {
+ String line = String.format(format, args);
+ byte[] lineBytes = line.getBytes();
+ vm.writeDebugOutput(lineBytes, 0, lineBytes.length);
+ vm.flushDebugOutput();
+ }
+
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/package-info.java Fri Nov 02 00:26:25 2018 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+/**
+ * HotSpot specific portions of the JVMCI API.
+ */
+package jdk.vm.ci.hotspot;
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java Fri Nov 02 00:26:25 2018 -0700
@@ -98,7 +98,7 @@
}
/**
- * An assumption that a given class has no subclasses implementing {@code Object#finalize()}).
+ * An assumption that a given class has no subclasses implementing {@link Object#finalize()}).
*/
public static final class NoFinalizableSubclass extends Assumption {
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantPool.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantPool.java Fri Nov 02 00:26:25 2018 -0700
@@ -49,8 +49,8 @@
/**
* Looks up a reference to a field. If {@code opcode} is non-negative, then resolution checks
* specific to the bytecode it denotes are performed if the field is already resolved. Checks
- * for some bytecodes require the method that contains the bytecode to be specified. Should
- * any of these checks fail, an unresolved field reference is returned.
+ * for some bytecodes require the method that contains the bytecode to be specified. Should any
+ * of these checks fail, an unresolved field reference is returned.
*
* @param cpi the constant pool index
* @param opcode the opcode of the instruction for which the lookup is being performed or
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LocalVariableTable.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LocalVariableTable.java Fri Nov 02 00:26:25 2018 -0700
@@ -47,7 +47,7 @@
/**
* Gets a description of a local variable that occupies the bytecode frame slot indexed by
- * {@code slot} and is live at the bytecode index {@code bci}
+ * {@code slot} and is live at the bytecode index {@code bci}.
*
* @return a description of the requested local variable or null if no such variable matches
* {@code slot} and {@code bci}
@@ -74,7 +74,7 @@
}
/**
- * Gets a description of all the local variables live at the bytecode index {@code bci}
+ * Gets a description of all the local variables live at the bytecode index {@code bci}.
*/
public Local[] getLocalsAt(int bci) {
List<Local> result = new ArrayList<>();
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ModifiersProvider.java Thu Nov 01 20:37:45 2018 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ModifiersProvider.java Fri Nov 02 00:26:25 2018 -0700
@@ -22,12 +22,12 @@
*/
package jdk.vm.ci.meta;
+import java.lang.reflect.Modifier;
+
import static java.lang.reflect.Modifier.PRIVATE;
import static java.lang.reflect.Modifier.PROTECTED;
import static java.lang.reflect.Modifier.PUBLIC;
-import java.lang.reflect.Modifier;
-
/**
* A Java element (i.e., a class, interface, field or method) that is described by a set of Java
* language {@linkplain #getModifiers() modifiers}.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/package-info.java Fri Nov 02 00:26:25 2018 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+/**
+ * The core runtime interface of the JVMCI API.
+ */
+package jdk.vm.ci.runtime;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/package-info.java Fri Nov 02 00:26:25 2018 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+/**
+ * The service related portions of the JVMCI API.
+ */
+package jdk.vm.ci.services;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/package-info.java Fri Nov 02 00:26:25 2018 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+/**
+ * The SPARC platform independent portions of the JVMCI API.
+ */
+package jdk.vm.ci.sparc;