Mercurial > hg > graal-jvmci-8
changeset 9463:902a974d55c8
Merge.
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 30 Apr 2013 23:24:25 +0200 |
parents | 861a9e0aba38 (diff) 56c12e0c15c1 (current diff) |
children | b5d83338286f |
files | graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRuntime.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/IdentityHashCodeStub.java src/cpu/x86/vm/graalRuntime_x86.cpp src/share/vm/graal/graalCompilerToVM.cpp src/share/vm/graal/graalRuntime.hpp |
diffstat | 8 files changed, 76 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRuntime.java Tue Apr 30 22:22:42 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRuntime.java Tue Apr 30 23:24:25 2013 +0200 @@ -25,7 +25,6 @@ import static com.oracle.graal.amd64.AMD64.*; import static com.oracle.graal.compiler.amd64.AMD64LIRGenerator.*; import static com.oracle.graal.hotspot.amd64.AMD64HotSpotUnwindOp.*; -import static com.oracle.graal.hotspot.nodes.IdentityHashCodeStubCall.*; import static com.oracle.graal.hotspot.nodes.MonitorEnterStubCall.*; import static com.oracle.graal.hotspot.nodes.MonitorExitStubCall.*; import static com.oracle.graal.hotspot.nodes.VMErrorNode.*; @@ -106,11 +105,6 @@ /* arg1: format */ Kind.Object, /* arg2: value */ Kind.Long)); - addRuntimeCall(IDENTITY_HASHCODE, config.identityHashCodeStub, - /* temps */ null, - /* ret */ rax.asValue(Kind.Int), - /* arg0: obj */ javaCallingConvention(Kind.Object)); - addRuntimeCall(ENCRYPT_BLOCK, config.aescryptEncryptBlockStub, /* temps */ null, /* ret */ ret(Kind.Void),
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java Tue Apr 30 22:22:42 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java Tue Apr 30 23:24:25 2013 +0200 @@ -369,7 +369,6 @@ public long logObjectStub; public long logPrintfStub; public int deoptReasonNone; - public long identityHashCodeStub; public long aescryptEncryptBlockStub; public long aescryptDecryptBlockStub; public long cipherBlockChainingEncryptAESCryptStub; @@ -381,6 +380,7 @@ public long registerFinalizerAddress; public long threadIsInterruptedAddress; public long stubPrintfAddress; + public long identityHashCodeAddress; public int deoptReasonNullCheck; public int deoptReasonRangeCheck;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Tue Apr 30 22:22:42 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Tue Apr 30 23:24:25 2013 +0200 @@ -30,11 +30,13 @@ import static com.oracle.graal.graph.UnsafeAccess.*; import static com.oracle.graal.hotspot.HotSpotBackend.*; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; +import static com.oracle.graal.hotspot.nodes.IdentityHashCodeStubCall.*; import static com.oracle.graal.hotspot.nodes.NewArrayStubCall.*; import static com.oracle.graal.hotspot.nodes.NewInstanceStubCall.*; import static com.oracle.graal.hotspot.nodes.NewMultiArrayStubCall.*; import static com.oracle.graal.hotspot.nodes.ThreadIsInterruptedStubCall.*; import static com.oracle.graal.hotspot.replacements.SystemSubstitutions.*; +import static com.oracle.graal.hotspot.stubs.IdentityHashCodeStub.*; import static com.oracle.graal.hotspot.stubs.NewArrayStub.*; import static com.oracle.graal.hotspot.stubs.NewInstanceStub.*; import static com.oracle.graal.hotspot.stubs.NewMultiArrayStub.*; @@ -344,6 +346,16 @@ addRuntimeCall(IC_MISS_HANDLER, config.inlineCacheMissStub, /* temps */ null, /* ret */ ret(Kind.Void)); + + addStubCall(IDENTITY_HASHCODE, + /* ret */ ret(Kind.Int), + /* arg0: obj */ javaCallingConvention(Kind.Object)); + + addCRuntimeCall(IDENTITY_HASH_CODE_C, config.identityHashCodeAddress, + /* ret */ ret(Kind.Int), + /* arg0: thread */ nativeCallingConvention(word, + /* arg1: object */ Kind.Object)); + // @formatter:on } @@ -441,6 +453,7 @@ registerStub(new NewMultiArrayStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(NEW_MULTI_ARRAY))); registerStub(new RegisterFinalizerStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(REGISTER_FINALIZER))); registerStub(new ThreadIsInterruptedStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(THREAD_IS_INTERRUPTED))); + registerStub(new IdentityHashCodeStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(IDENTITY_HASHCODE))); } private void registerStub(Stub stub) {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/IdentityHashCodeStubCall.java Tue Apr 30 22:22:42 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/IdentityHashCodeStubCall.java Tue Apr 30 23:24:25 2013 +0200 @@ -27,12 +27,13 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.compiler.target.*; +import com.oracle.graal.hotspot.stubs.*; import com.oracle.graal.lir.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.type.*; /** - * Node implementing a call to HotSpot's {@code graal_identityhashcode} stub. + * Node implementing a call to {@link IdentityHashCodeStub}. */ public class IdentityHashCodeStubCall extends DeoptimizingStubCall implements LIRGenLowerable {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/IdentityHashCodeStub.java Tue Apr 30 23:24:25 2013 +0200 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2012, 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 com.oracle.graal.hotspot.stubs; + +import static com.oracle.graal.hotspot.replacements.HotSpotSnippetUtils.*; + +import com.oracle.graal.api.code.RuntimeCallTarget.Descriptor; +import com.oracle.graal.api.code.*; +import com.oracle.graal.graph.Node.ConstantNodeParameter; +import com.oracle.graal.graph.Node.NodeIntrinsic; +import com.oracle.graal.hotspot.*; +import com.oracle.graal.hotspot.meta.*; +import com.oracle.graal.hotspot.nodes.*; +import com.oracle.graal.nodes.spi.*; +import com.oracle.graal.replacements.*; +import com.oracle.graal.word.*; + +/** + * Stub called from {@link IdentityHashCodeStubCall}. + */ +public class IdentityHashCodeStub extends CRuntimeStub { + + public IdentityHashCodeStub(final HotSpotRuntime runtime, Replacements replacements, TargetDescription target, HotSpotRuntimeCallTarget linkage) { + super(runtime, replacements, target, linkage); + } + + @Snippet + private static int identityHashCode(Object object) { + int result = identityHashCodeC(IDENTITY_HASH_CODE_C, thread(), object); + handlePendingException(false); + return result; + } + + public static final Descriptor IDENTITY_HASH_CODE_C = descriptorFor(IdentityHashCodeStub.class, "identityHashCodeC", false); + + @NodeIntrinsic(CRuntimeCall.class) + public static native int identityHashCodeC(@ConstantNodeParameter Descriptor identityHashCodeC, Word thread, Object object); +}
--- a/src/cpu/x86/vm/graalRuntime_x86.cpp Tue Apr 30 22:22:42 2013 +0200 +++ b/src/cpu/x86/vm/graalRuntime_x86.cpp Tue Apr 30 23:24:25 2013 +0200 @@ -1038,20 +1038,6 @@ break; } - case identity_hash_code_id: { - Register obj = j_rarg0; // Incoming - __ set_info("identity_hash_code", dont_gc_arguments); - __ enter(); - OopMap* map = save_live_registers(sasm, 1); - int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, identity_hash_code), obj); - oop_maps = new OopMapSet(); - oop_maps->add_gc_map(call_offset, map); - restore_live_registers_except_rax(sasm); - __ leave(); - __ ret(0); - break; - } - default: { GraalStubFrame f(sasm, "unimplemented entry", dont_gc_arguments); __ movptr(rax, (int)id);
--- a/src/share/vm/graal/graalCompilerToVM.cpp Tue Apr 30 22:22:42 2013 +0200 +++ b/src/share/vm/graal/graalCompilerToVM.cpp Tue Apr 30 23:24:25 2013 +0200 @@ -754,7 +754,6 @@ set_address("wbPreCallStub", GraalRuntime::entry_for(GraalRuntime::wb_pre_call_id)); set_address("wbPostCallStub", GraalRuntime::entry_for(GraalRuntime::wb_post_call_id)); - set_address("identityHashCodeStub", GraalRuntime::entry_for(GraalRuntime::identity_hash_code_id)); set_address("inlineCacheMissStub", SharedRuntime::get_ic_miss_stub()); set_address("handleExceptionStub", GraalRuntime::entry_for(GraalRuntime::handle_exception_nofpu_id)); set_address("handleDeoptStub", SharedRuntime::deopt_blob()->unpack()); @@ -788,6 +787,7 @@ set_address("threadIsInterruptedAddress", GraalRuntime::thread_is_interrupted); set_address("uncommonTrapStub", SharedRuntime::deopt_blob()->uncommon_trap()); set_address("stubPrintfAddress", GraalRuntime::stub_printf); + set_address("identityHashCodeAddress", GraalRuntime::identity_hash_code); set_int("deoptReasonNone", Deoptimization::Reason_none); set_int("deoptReasonNullCheck", Deoptimization::Reason_null_check);
--- a/src/share/vm/graal/graalRuntime.hpp Tue Apr 30 22:22:42 2013 +0200 +++ b/src/share/vm/graal/graalRuntime.hpp Tue Apr 30 23:24:25 2013 +0200 @@ -95,7 +95,6 @@ stub(log_object) \ stub(log_printf) \ stub(log_primitive) \ - stub(identity_hash_code) \ stub(wb_pre_call) \ stub(wb_post_call) \ last_entry(number_of_ids) @@ -141,7 +140,6 @@ static void wb_pre_call(JavaThread* thread, oopDesc* obj); static void wb_post_call(JavaThread* thread, oopDesc* obj, void* card); - static jint identity_hash_code(JavaThread* thread, oopDesc* objd); // Note: Must be kept in sync with constants in com.oracle.graal.replacements.Log enum { @@ -157,6 +155,7 @@ static void new_multi_array(JavaThread* thread, Klass* klass, int rank, jint* dims); static jboolean thread_is_interrupted(JavaThread* thread, oopDesc* obj, jboolean clear_interrupte); static void stub_printf(jlong format, jlong v1, jlong v2, jlong v3); + static jint identity_hash_code(JavaThread* thread, oopDesc* objd); // initialization static void initialize(BufferBlob* blob);