# HG changeset patch # User Andreas Woess # Date 1397239614 -7200 # Node ID ed724a473832d33d6df62fe9bf3e732acb7863d7 # Parent d8e0e684f7f509ca5949e6d8ee6d9e90fa1facf5# Parent d1a75d0e9bbff002621a2d8aa7d1d82aca8e23e2 Merge diff -r d8e0e684f7f5 -r ed724a473832 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotspotDirectStaticCallOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotspotDirectStaticCallOp.java Fri Apr 11 19:27:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotspotDirectStaticCallOp.java Fri Apr 11 20:06:54 2014 +0200 @@ -31,8 +31,8 @@ import com.oracle.graal.nodes.java.MethodCallTargetNode.InvokeKind; /** - * A direct call that complies with the conventions for such calls in HotSpot. In particular, for - * calls using an inline cache, a MOVE instruction is emitted just prior to the aligned direct call. + * A direct call that complies with the conventions for such calls in HotSpot. It doesn't use an + * inline cache so it's just a patchable call site. */ @Opcode("CALL_DIRECT") final class AMD64HotspotDirectStaticCallOp extends DirectCallOp { diff -r d8e0e684f7f5 -r ed724a473832 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java Fri Apr 11 19:27:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java Fri Apr 11 20:06:54 2014 +0200 @@ -101,8 +101,7 @@ assert invokeKind == InvokeKind.Static || invokeKind == InvokeKind.Special; HotSpotResolvedJavaMethod resolvedMethod = (HotSpotResolvedJavaMethod) callTarget.target(); assert !Modifier.isAbstract(resolvedMethod.getModifiers()) : "Cannot make direct call to abstract method."; - Constant metaspaceMethod = resolvedMethod.getMetaspaceMethodConstant(); - append(new SPARCHotspotDirectStaticCallOp(callTarget.target(), result, parameters, temps, callState, invokeKind, metaspaceMethod)); + append(new SPARCHotspotDirectStaticCallOp(callTarget.target(), result, parameters, temps, callState, invokeKind)); } } diff -r d8e0e684f7f5 -r ed724a473832 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotspotDirectStaticCallOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotspotDirectStaticCallOp.java Fri Apr 11 19:27:39 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotspotDirectStaticCallOp.java Fri Apr 11 20:06:54 2014 +0200 @@ -22,44 +22,32 @@ */ package com.oracle.graal.hotspot.sparc; -import static com.oracle.graal.sparc.SPARC.*; - import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; -import com.oracle.graal.asm.sparc.SPARCMacroAssembler.Setx; -import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.HotSpotCodeCacheProvider.MarkId; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.sparc.SPARCCall.DirectCallOp; -import com.oracle.graal.lir.sparc.*; import com.oracle.graal.nodes.java.MethodCallTargetNode.InvokeKind; /** - * A direct call that complies with the conventions for such calls in HotSpot. In particular, for - * calls using an inline cache, a MOVE instruction is emitted just prior to the aligned direct call. + * A direct call that complies with the conventions for such calls in HotSpot. It doesn't use an + * inline cache so it's just a patchable call site. */ @Opcode("CALL_DIRECT") final class SPARCHotspotDirectStaticCallOp extends DirectCallOp { - private final Constant metaspaceMethod; private final InvokeKind invokeKind; - SPARCHotspotDirectStaticCallOp(ResolvedJavaMethod target, Value result, Value[] parameters, Value[] temps, LIRFrameState state, InvokeKind invokeKind, Constant metaspaceMethod) { + SPARCHotspotDirectStaticCallOp(ResolvedJavaMethod target, Value result, Value[] parameters, Value[] temps, LIRFrameState state, InvokeKind invokeKind) { super(target, result, parameters, temps, state); assert invokeKind == InvokeKind.Static || invokeKind == InvokeKind.Special; - this.metaspaceMethod = metaspaceMethod; this.invokeKind = invokeKind; } @Override public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { - // The mark for an invocation that uses an inline cache must be placed at the - // instruction that loads the Klass from the inline cache. - SPARCMove.move(crb, masm, g5.asValue(Kind.Long), metaspaceMethod); MarkId.recordMark(crb, invokeKind == InvokeKind.Static ? MarkId.INVOKESTATIC : MarkId.INVOKESPECIAL); - // SPARCMove.move(crb, masm, g3.asValue(Kind.Long), Constant.LONG_0); - new Setx(HotSpotGraalRuntime.runtime().getConfig().nonOopBits, g3, true).emit(masm); super.emitCode(crb, masm); } } diff -r d8e0e684f7f5 -r ed724a473832 src/share/vm/code/compiledIC.cpp --- a/src/share/vm/code/compiledIC.cpp Fri Apr 11 19:27:39 2014 +0200 +++ b/src/share/vm/code/compiledIC.cpp Fri Apr 11 20:06:54 2014 +0200 @@ -231,8 +231,8 @@ // for calling directly to vep without using the inline cache (i.e., cached_value == NULL) #ifdef ASSERT CodeBlob* caller = CodeCache::find_blob_unsafe(instruction_address()); - bool is_c1_method = caller->is_compiled_by_c1(); - assert( is_c1_method || + bool is_c1_or_graal_method = caller->is_compiled_by_c1() || caller->is_compiled_by_graal(); + assert( is_c1_or_graal_method || !is_monomorphic || is_optimized() || (cached_metadata() != NULL && cached_metadata()->is_klass()), "sanity check");