# HG changeset patch # User Doug Simon # Date 1431980844 -7200 # Node ID 15a46a918fc11aeb67386fe3bc1812abb128dd31 # Parent 6df10903c9559c31f7295fe311e7bb660e298b50 removed unnecessary HotSpotCodeCache.MarkId enum (JBS:GRAAL-53) converted some uses of GraalInternalError to InternalError diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java Mon May 18 22:27:24 2015 +0200 @@ -39,7 +39,6 @@ import com.oracle.graal.compiler.gen.*; import com.oracle.graal.compiler.target.*; import com.oracle.graal.hotspot.*; -import com.oracle.graal.hotspot.meta.HotSpotCodeCacheProvider.MarkId; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.stubs.*; import com.oracle.graal.lir.*; @@ -251,7 +250,7 @@ emitCodeBody(installedCodeOwner, crb, lir); // Emit the suffix - emitCodeSuffix(installedCodeOwner, crb, asm, frameMap); + emitCodeSuffix(installedCodeOwner, crb, asm, config, frameMap); // Profile assembler instructions profileInstructions(lir, crb); @@ -265,7 +264,7 @@ public void emitCodePrefix(ResolvedJavaMethod installedCodeOwner, CompilationResultBuilder crb, AMD64MacroAssembler asm, RegisterConfig regConfig, HotSpotVMConfig config, Label verifiedEntry) { HotSpotProviders providers = getProviders(); if (installedCodeOwner != null && !installedCodeOwner.isStatic()) { - MarkId.recordMark(crb, MarkId.UNVERIFIED_ENTRY); + crb.recordMark(config.MARKID_UNVERIFIED_ENTRY); CallingConvention cc = regConfig.getCallingConvention(JavaCallee, null, new JavaType[]{providers.getMetaAccess().lookupJavaType(Object.class)}, getTarget(), false); Register inlineCacheKlass = rax; // see definition of IC_Klass in // c1_LIRAssembler_x86.cpp @@ -287,9 +286,9 @@ } asm.align(config.codeEntryAlignment); - MarkId.recordMark(crb, MarkId.OSR_ENTRY); + crb.recordMark(config.MARKID_OSR_ENTRY); asm.bind(verifiedEntry); - MarkId.recordMark(crb, MarkId.VERIFIED_ENTRY); + crb.recordMark(config.MARKID_VERIFIED_ENTRY); } /** @@ -303,15 +302,16 @@ /** * @param installedCodeOwner see {@link Backend#emitCode} + * @param config */ - public void emitCodeSuffix(ResolvedJavaMethod installedCodeOwner, CompilationResultBuilder crb, AMD64MacroAssembler asm, FrameMap frameMap) { + public void emitCodeSuffix(ResolvedJavaMethod installedCodeOwner, CompilationResultBuilder crb, AMD64MacroAssembler asm, HotSpotVMConfig config, FrameMap frameMap) { HotSpotProviders providers = getProviders(); HotSpotFrameContext frameContext = (HotSpotFrameContext) crb.frameContext; if (!frameContext.isStub) { HotSpotForeignCallsProvider foreignCalls = providers.getForeignCalls(); - MarkId.recordMark(crb, MarkId.EXCEPTION_HANDLER_ENTRY); + crb.recordMark(config.MARKID_EXCEPTION_HANDLER_ENTRY); AMD64Call.directCall(crb, asm, foreignCalls.lookupForeignCall(EXCEPTION_HANDLER), null, false, null); - MarkId.recordMark(crb, MarkId.DEOPT_HANDLER_ENTRY); + crb.recordMark(config.MARKID_DEOPT_HANDLER_ENTRY); AMD64Call.directCall(crb, asm, foreignCalls.lookupForeignCall(DEOPTIMIZATION_HANDLER), null, false, null); } else { // No need to emit the stubs for entries back into the method since diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java Mon May 18 22:27:24 2015 +0200 @@ -223,7 +223,7 @@ } protected HotSpotCodeCacheProvider createCodeCache(HotSpotGraalRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { - return new HotSpotCodeCacheProvider(runtime, target, regConfig); + return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); } protected HotSpotMetaAccessProvider createMetaAccess(HotSpotGraalRuntimeProvider runtime) { @@ -269,15 +269,15 @@ } else { /* * System V Application Binary Interface, AMD64 Architecture Processor Supplement - * + * * Draft Version 0.96 - * + * * http://www.uclibc.org/docs/psABI-x86_64.pdf - * + * * 3.2.1 - * + * * ... - * + * * This subsection discusses usage of each register. Registers %rbp, %rbx and %r12 * through %r15 "belong" to the calling function and the called function is required to * preserve their values. In other words, a called function must preserve these diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCardTableAddressOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCardTableAddressOp.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCardTableAddressOp.java Mon May 18 22:27:24 2015 +0200 @@ -25,20 +25,22 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; -import com.oracle.graal.hotspot.meta.HotSpotCodeCacheProvider.*; +import com.oracle.graal.hotspot.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.amd64.*; import com.oracle.graal.lir.asm.*; -import com.oracle.graal.hotspot.HotSpotGraalRuntime; public final class AMD64HotSpotCardTableAddressOp extends AMD64LIRInstruction { public static final LIRInstructionClass TYPE = LIRInstructionClass.create(AMD64HotSpotCardTableAddressOp.class); @Def({OperandFlag.REG}) private AllocatableValue result; - public AMD64HotSpotCardTableAddressOp(AllocatableValue result) { + private final HotSpotVMConfig config; + + public AMD64HotSpotCardTableAddressOp(AllocatableValue result, HotSpotVMConfig config) { super(TYPE); this.result = result; + this.config = config; } @Override @@ -48,7 +50,7 @@ JavaConstant address = JavaConstant.forIntegerKind(hostWordKind, 0); // recordDataReferenceInCode forces the mov to be rip-relative asm.movq(ValueUtil.asRegister(result), (AMD64Address) crb.recordDataReferenceInCode(address, alignment)); - MarkId.recordMark(crb, MarkId.CARD_TABLE_ADDRESS); + crb.recordMark(config.MARKID_CARD_TABLE_ADDRESS); } } diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCardTableShiftOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCardTableShiftOp.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCardTableShiftOp.java Mon May 18 22:27:24 2015 +0200 @@ -25,20 +25,22 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; -import com.oracle.graal.hotspot.meta.HotSpotCodeCacheProvider.*; +import com.oracle.graal.hotspot.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.amd64.*; import com.oracle.graal.lir.asm.*; -import com.oracle.graal.hotspot.HotSpotGraalRuntime; public final class AMD64HotSpotCardTableShiftOp extends AMD64LIRInstruction { public static final LIRInstructionClass TYPE = LIRInstructionClass.create(AMD64HotSpotCardTableShiftOp.class); @Def({OperandFlag.REG, OperandFlag.ILLEGAL}) private AllocatableValue result; - public AMD64HotSpotCardTableShiftOp(AllocatableValue result) { + private final HotSpotVMConfig config; + + public AMD64HotSpotCardTableShiftOp(AllocatableValue result, HotSpotVMConfig config) { super(TYPE); this.result = result; + this.config = config; } @Override @@ -48,6 +50,6 @@ JavaConstant shift = JavaConstant.forIntegerKind(hostWordKind, 0); // recordDataReferenceInCode forces the mov to be rip-relative asm.movq(ValueUtil.asRegister(result), (AMD64Address) crb.recordDataReferenceInCode(shift, alignment)); - MarkId.recordMark(crb, MarkId.CARD_TABLE_SHIFT); + crb.recordMark(config.MARKID_CARD_TABLE_SHIFT); } } diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Mon May 18 22:27:24 2015 +0200 @@ -255,14 +255,14 @@ @Override public Value emitCardTableShift() { Variable result = newVariable(LIRKind.value(Kind.Long)); - append(new AMD64HotSpotCardTableShiftOp(result)); + append(new AMD64HotSpotCardTableShiftOp(result, config)); return result; } @Override public Value emitCardTableAddress() { Variable result = newVariable(LIRKind.value(Kind.Long)); - append(new AMD64HotSpotCardTableAddressOp(result)); + append(new AMD64HotSpotCardTableAddressOp(result, config)); return result; } diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java Mon May 18 22:27:24 2015 +0200 @@ -158,7 +158,7 @@ assert invokeKind.isDirect(); HotSpotResolvedJavaMethod resolvedMethod = (HotSpotResolvedJavaMethod) callTarget.targetMethod(); assert resolvedMethod.isConcrete() : "Cannot make direct call to abstract method."; - append(new AMD64HotspotDirectStaticCallOp(callTarget.targetMethod(), result, parameters, temps, callState, invokeKind)); + append(new AMD64HotspotDirectStaticCallOp(callTarget.targetMethod(), result, parameters, temps, callState, invokeKind, runtime.getConfig())); } } @@ -171,7 +171,7 @@ AllocatableValue targetAddressDst = AMD64.rax.asValue(targetAddressSrc.getLIRKind()); gen.emitMove(metaspaceMethodDst, metaspaceMethodSrc); gen.emitMove(targetAddressDst, targetAddressSrc); - append(new AMD64IndirectCallOp(callTarget.targetMethod(), result, parameters, temps, metaspaceMethodDst, targetAddressDst, callState)); + append(new AMD64IndirectCallOp(callTarget.targetMethod(), result, parameters, temps, metaspaceMethodDst, targetAddressDst, callState, runtime.getConfig())); } else { super.emitIndirectCall(callTarget, result, parameters, temps, callState); } diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotSafepointOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotSafepointOp.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotSafepointOp.java Mon May 18 22:27:24 2015 +0200 @@ -30,7 +30,6 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.hotspot.*; -import com.oracle.graal.hotspot.meta.HotSpotCodeCacheProvider.MarkId; import com.oracle.graal.lir.*; import com.oracle.graal.lir.amd64.*; import com.oracle.graal.lir.asm.*; @@ -84,21 +83,21 @@ // co-located with the immutable code. asm.movq(scratch, (AMD64Address) crb.recordDataReferenceInCode(pollingPageAddress, alignment)); final int pos = asm.position(); - MarkId.recordMark(crb, atReturn ? MarkId.POLL_RETURN_FAR : MarkId.POLL_FAR); + crb.recordMark(atReturn ? config.MARKID_POLL_RETURN_FAR : config.MARKID_POLL_FAR); if (state != null) { crb.recordInfopoint(pos, state, InfopointReason.SAFEPOINT); } asm.testl(rax, new AMD64Address(scratch)); } else if (isPollingPageFar(config)) { asm.movq(scratch, config.safepointPollingAddress); - MarkId.recordMark(crb, atReturn ? MarkId.POLL_RETURN_FAR : MarkId.POLL_FAR); + crb.recordMark(atReturn ? config.MARKID_POLL_RETURN_FAR : config.MARKID_POLL_FAR); final int pos = asm.position(); if (state != null) { crb.recordInfopoint(pos, state, InfopointReason.SAFEPOINT); } asm.testl(rax, new AMD64Address(scratch)); } else { - MarkId.recordMark(crb, atReturn ? MarkId.POLL_RETURN_NEAR : MarkId.POLL_NEAR); + crb.recordMark(atReturn ? config.MARKID_POLL_RETURN_NEAR : config.MARKID_POLL_NEAR); final int pos = asm.position(); if (state != null) { crb.recordInfopoint(pos, state, InfopointReason.SAFEPOINT); diff -r 6df10903c955 -r 15a46a918fc1 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 Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotspotDirectStaticCallOp.java Mon May 18 22:27:24 2015 +0200 @@ -24,7 +24,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; -import com.oracle.graal.hotspot.meta.HotSpotCodeCacheProvider.MarkId; +import com.oracle.graal.hotspot.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.amd64.AMD64Call.DirectCallOp; import com.oracle.graal.lir.asm.*; @@ -39,16 +39,18 @@ public static final LIRInstructionClass TYPE = LIRInstructionClass.create(AMD64HotspotDirectStaticCallOp.class); private final InvokeKind invokeKind; + private final HotSpotVMConfig config; - AMD64HotspotDirectStaticCallOp(ResolvedJavaMethod target, Value result, Value[] parameters, Value[] temps, LIRFrameState state, InvokeKind invokeKind) { + AMD64HotspotDirectStaticCallOp(ResolvedJavaMethod target, Value result, Value[] parameters, Value[] temps, LIRFrameState state, InvokeKind invokeKind, HotSpotVMConfig config) { super(TYPE, target, result, parameters, temps, state); assert invokeKind.isDirect(); this.invokeKind = invokeKind; + this.config = config; } @Override public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) { - MarkId.recordMark(crb, invokeKind == InvokeKind.Static ? MarkId.INVOKESTATIC : MarkId.INVOKESPECIAL); + crb.recordMark(invokeKind == InvokeKind.Static ? config.MARKID_INVOKESTATIC : config.MARKID_INVOKESPECIAL); super.emitCode(crb, masm); } } diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotspotDirectVirtualCallOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotspotDirectVirtualCallOp.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotspotDirectVirtualCallOp.java Mon May 18 22:27:24 2015 +0200 @@ -26,9 +26,8 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.hotspot.*; -import com.oracle.graal.hotspot.meta.HotSpotCodeCacheProvider.MarkId; import com.oracle.graal.lir.*; -import com.oracle.graal.lir.amd64.AMD64Call.*; +import com.oracle.graal.lir.amd64.AMD64Call.DirectCallOp; import com.oracle.graal.lir.asm.*; import com.oracle.graal.nodes.CallTargetNode.InvokeKind; @@ -54,7 +53,7 @@ public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler 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. - MarkId.recordMark(crb, invokeKind == InvokeKind.Virtual ? MarkId.INVOKEVIRTUAL : MarkId.INVOKEINTERFACE); + crb.recordMark(invokeKind == InvokeKind.Virtual ? config.MARKID_INVOKEVIRTUAL : config.MARKID_INVOKEINTERFACE); // This must be emitted exactly like this to ensure it's patchable masm.movq(AMD64.rax, config.nonOopBits); super.emitCode(crb, masm); diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64IndirectCallOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64IndirectCallOp.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64IndirectCallOp.java Mon May 18 22:27:24 2015 +0200 @@ -29,7 +29,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; -import com.oracle.graal.hotspot.meta.HotSpotCodeCacheProvider.MarkId; +import com.oracle.graal.hotspot.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.amd64.*; import com.oracle.graal.lir.amd64.AMD64Call.IndirectCallOp; @@ -52,14 +52,17 @@ @Use({REG}) protected Value metaspaceMethod; - AMD64IndirectCallOp(ResolvedJavaMethod targetMethod, Value result, Value[] parameters, Value[] temps, Value metaspaceMethod, Value targetAddress, LIRFrameState state) { + private final HotSpotVMConfig config; + + AMD64IndirectCallOp(ResolvedJavaMethod targetMethod, Value result, Value[] parameters, Value[] temps, Value metaspaceMethod, Value targetAddress, LIRFrameState state, HotSpotVMConfig config) { super(TYPE, targetMethod, result, parameters, temps, targetAddress, state); this.metaspaceMethod = metaspaceMethod; + this.config = config; } @Override public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) { - MarkId.recordMark(crb, MarkId.INLINE_INVOKE); + crb.recordMark(config.MARKID_INLINE_INVOKE); Register callReg = asRegister(targetAddress); assert !callReg.equals(METHOD); AMD64Call.indirectCall(crb, masm, callReg, callTarget, state); diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java Mon May 18 22:27:24 2015 +0200 @@ -42,7 +42,6 @@ import com.oracle.graal.asm.sparc.SPARCMacroAssembler.Setx; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.hotspot.*; -import com.oracle.graal.hotspot.meta.HotSpotCodeCacheProvider.MarkId; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.stubs.*; import com.oracle.graal.lir.*; @@ -222,7 +221,7 @@ // Emit the prefix if (unverifiedStub != null) { - MarkId.recordMark(crb, MarkId.UNVERIFIED_ENTRY); + crb.recordMark(config.MARKID_UNVERIFIED_ENTRY); // We need to use JavaCall here because we haven't entered the frame yet. CallingConvention cc = regConfig.getCallingConvention(JavaCall, null, new JavaType[]{getProviders().getMetaAccess().lookupJavaType(Object.class)}, getTarget(), false); Register inlineCacheKlass = g5; // see MacroAssembler::ic_call @@ -240,8 +239,8 @@ } masm.align(config.codeEntryAlignment); - MarkId.recordMark(crb, MarkId.OSR_ENTRY); - MarkId.recordMark(crb, MarkId.VERIFIED_ENTRY); + crb.recordMark(config.MARKID_OSR_ENTRY); + crb.recordMark(config.MARKID_VERIFIED_ENTRY); // Emit code for the LIR crb.emit(lir); @@ -252,9 +251,9 @@ HotSpotFrameContext frameContext = (HotSpotFrameContext) crb.frameContext; HotSpotForeignCallsProvider foreignCalls = getProviders().getForeignCalls(); if (!frameContext.isStub) { - MarkId.recordMark(crb, MarkId.EXCEPTION_HANDLER_ENTRY); + crb.recordMark(config.MARKID_EXCEPTION_HANDLER_ENTRY); SPARCCall.directCall(crb, masm, foreignCalls.lookupForeignCall(EXCEPTION_HANDLER), null, false, null); - MarkId.recordMark(crb, MarkId.DEOPT_HANDLER_ENTRY); + crb.recordMark(config.MARKID_DEOPT_HANDLER_ENTRY); SPARCCall.directCall(crb, masm, foreignCalls.lookupForeignCall(DEOPTIMIZATION_HANDLER), null, false, null); } else { // No need to emit the stubs for entries back into the method since diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackendFactory.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackendFactory.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackendFactory.java Mon May 18 22:27:24 2015 +0200 @@ -91,7 +91,7 @@ } protected HotSpotCodeCacheProvider createCodeCache(HotSpotGraalRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { - return new HotSpotCodeCacheProvider(runtime, target, regConfig); + return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); } protected SPARCHotSpotBackend createBackend(HotSpotGraalRuntimeProvider runtime, HotSpotProviders providers) { diff -r 6df10903c955 -r 15a46a918fc1 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 Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java Mon May 18 22:27:24 2015 +0200 @@ -104,7 +104,7 @@ assert invokeKind.isDirect(); HotSpotResolvedJavaMethod resolvedMethod = (HotSpotResolvedJavaMethod) callTarget.targetMethod(); assert resolvedMethod.isConcrete() : "Cannot make direct call to abstract method."; - append(new SPARCHotspotDirectStaticCallOp(callTarget.targetMethod(), result, parameters, temps, callState, invokeKind)); + append(new SPARCHotspotDirectStaticCallOp(callTarget.targetMethod(), result, parameters, temps, callState, invokeKind, runtime.getConfig())); } } @@ -117,7 +117,7 @@ Value targetAddressSrc = operand(callTarget.computedAddress()); AllocatableValue targetAddress = o7.asValue(targetAddressSrc.getLIRKind()); gen.emitMove(targetAddress, targetAddressSrc); - append(new SPARCIndirectCallOp(callTarget.targetMethod(), result, parameters, temps, metaspaceMethod, targetAddress, callState)); + append(new SPARCIndirectCallOp(callTarget.targetMethod(), result, parameters, temps, metaspaceMethod, targetAddress, callState, runtime.getConfig())); } @Override diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotSafepointOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotSafepointOp.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotSafepointOp.java Mon May 18 22:27:24 2015 +0200 @@ -29,7 +29,6 @@ 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.gen.*; @@ -64,7 +63,7 @@ public static void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm, HotSpotVMConfig config, boolean atReturn, LIRFrameState state, Register scratch) { new Setx(config.safepointPollingAddress, scratch).emit(masm); - MarkId.recordMark(crb, atReturn ? MarkId.POLL_RETURN_FAR : MarkId.POLL_FAR); + crb.recordMark(atReturn ? config.MARKID_POLL_RETURN_FAR : config.MARKID_POLL_FAR); final int pos = masm.position(); masm.ldx(new SPARCAddress(scratch, 0), g0); if (state != null) { diff -r 6df10903c955 -r 15a46a918fc1 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 Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotspotDirectStaticCallOp.java Mon May 18 22:27:24 2015 +0200 @@ -24,7 +24,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; -import com.oracle.graal.hotspot.meta.HotSpotCodeCacheProvider.MarkId; +import com.oracle.graal.hotspot.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.sparc.SPARCCall.DirectCallOp; @@ -39,15 +39,17 @@ public static final LIRInstructionClass TYPE = LIRInstructionClass.create(SPARCHotspotDirectStaticCallOp.class); private final InvokeKind invokeKind; + private final HotSpotVMConfig config; - SPARCHotspotDirectStaticCallOp(ResolvedJavaMethod target, Value result, Value[] parameters, Value[] temps, LIRFrameState state, InvokeKind invokeKind) { + SPARCHotspotDirectStaticCallOp(ResolvedJavaMethod target, Value result, Value[] parameters, Value[] temps, LIRFrameState state, InvokeKind invokeKind, HotSpotVMConfig config) { super(TYPE, target, result, parameters, temps, state); assert invokeKind.isDirect(); this.invokeKind = invokeKind; + this.config = config; } @Override public void emitCallPrefixCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { - MarkId.recordMark(crb, invokeKind == InvokeKind.Static ? MarkId.INVOKESTATIC : MarkId.INVOKESPECIAL); + crb.recordMark(invokeKind == InvokeKind.Static ? config.MARKID_INVOKESTATIC : config.MARKID_INVOKESPECIAL); } } diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java Mon May 18 22:27:24 2015 +0200 @@ -27,9 +27,8 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; -import com.oracle.graal.asm.sparc.SPARCMacroAssembler.*; +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; @@ -57,7 +56,7 @@ public void emitCallPrefixCode(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. - MarkId.recordMark(crb, invokeKind == InvokeKind.Virtual ? MarkId.INVOKEVIRTUAL : MarkId.INVOKEINTERFACE); + crb.recordMark(invokeKind == InvokeKind.Virtual ? config.MARKID_INVOKEVIRTUAL : config.MARKID_INVOKEINTERFACE); Register scratchRegister = g5; new Setx(config.nonOopBits, scratchRegister, true).emit(masm); } diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCIndirectCallOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCIndirectCallOp.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCIndirectCallOp.java Mon May 18 22:27:24 2015 +0200 @@ -29,7 +29,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; -import com.oracle.graal.hotspot.meta.HotSpotCodeCacheProvider.MarkId; +import com.oracle.graal.hotspot.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.sparc.*; @@ -52,14 +52,17 @@ @Use({REG}) protected Value metaspaceMethod; - SPARCIndirectCallOp(ResolvedJavaMethod targetMethod, Value result, Value[] parameters, Value[] temps, Value metaspaceMethod, Value targetAddress, LIRFrameState state) { + private final HotSpotVMConfig config; + + SPARCIndirectCallOp(ResolvedJavaMethod targetMethod, Value result, Value[] parameters, Value[] temps, Value metaspaceMethod, Value targetAddress, LIRFrameState state, HotSpotVMConfig config) { super(TYPE, targetMethod, result, parameters, temps, targetAddress, state); this.metaspaceMethod = metaspaceMethod; + this.config = config; } @Override public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { - MarkId.recordMark(crb, MarkId.INLINE_INVOKE); + crb.recordMark(config.MARKID_INLINE_INVOKE); Register callReg = asRegister(targetAddress); assert !callReg.equals(METHOD); SPARCCall.indirectCall(crb, masm, callReg, callTarget, state); diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotBackend.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotBackend.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotBackend.java Mon May 18 22:27:24 2015 +0200 @@ -64,8 +64,8 @@ /** * Descriptor for {@link ExceptionHandlerStub}. This stub is called by the - * {@linkplain HotSpotVMConfig#codeInstallerMarkIdExceptionHandlerEntry exception handler} in a - * compiled method. + * {@linkplain HotSpotVMConfig#MARKID_EXCEPTION_HANDLER_ENTRY exception handler} in a compiled + * method. */ public static final ForeignCallDescriptor EXCEPTION_HANDLER = new ForeignCallDescriptor("exceptionHandler", void.class, Object.class, Word.class); diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotReferenceMap.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotReferenceMap.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotReferenceMap.java Mon May 18 22:27:24 2015 +0200 @@ -27,7 +27,6 @@ import com.oracle.graal.api.code.CodeUtil.RefMapFormatter; import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; public final class HotSpotReferenceMap extends ReferenceMap { @@ -347,7 +346,7 @@ private void set(HotSpotOopMap refMap, int index, LIRKind kind) { if (kind.isDerivedReference()) { - throw GraalInternalError.shouldNotReachHere("derived reference cannot be inserted in ReferenceMap"); + throw new InternalError("derived reference cannot be inserted in ReferenceMap"); } int bytesPerElement = bytesPerElement(kind); diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java Mon May 18 22:27:24 2015 +0200 @@ -1512,23 +1512,26 @@ @HotSpotVMConstant(name = "CompilerToVM::KLASS_TAG") @Stable public int compilerToVMKlassTag; @HotSpotVMConstant(name = "CompilerToVM::SYMBOL_TAG") @Stable public int compilerToVMSymbolTag; - @HotSpotVMConstant(name = "CodeInstaller::VERIFIED_ENTRY") @Stable public int codeInstallerMarkIdVerifiedEntry; - @HotSpotVMConstant(name = "CodeInstaller::UNVERIFIED_ENTRY") @Stable public int codeInstallerMarkIdUnverifiedEntry; - @HotSpotVMConstant(name = "CodeInstaller::OSR_ENTRY") @Stable public int codeInstallerMarkIdOsrEntry; - @HotSpotVMConstant(name = "CodeInstaller::EXCEPTION_HANDLER_ENTRY") @Stable public int codeInstallerMarkIdExceptionHandlerEntry; - @HotSpotVMConstant(name = "CodeInstaller::DEOPT_HANDLER_ENTRY") @Stable public int codeInstallerMarkIdDeoptHandlerEntry; - @HotSpotVMConstant(name = "CodeInstaller::INVOKEINTERFACE") @Stable public int codeInstallerMarkIdInvokeinterface; - @HotSpotVMConstant(name = "CodeInstaller::INVOKEVIRTUAL") @Stable public int codeInstallerMarkIdInvokevirtual; - @HotSpotVMConstant(name = "CodeInstaller::INVOKESTATIC") @Stable public int codeInstallerMarkIdInvokestatic; - @HotSpotVMConstant(name = "CodeInstaller::INVOKESPECIAL") @Stable public int codeInstallerMarkIdInvokespecial; - @HotSpotVMConstant(name = "CodeInstaller::INLINE_INVOKE") @Stable public int codeInstallerMarkIdInlineInvoke; - @HotSpotVMConstant(name = "CodeInstaller::POLL_NEAR") @Stable public int codeInstallerMarkIdPollNear; - @HotSpotVMConstant(name = "CodeInstaller::POLL_RETURN_NEAR") @Stable public int codeInstallerMarkIdPollReturnNear; - @HotSpotVMConstant(name = "CodeInstaller::POLL_FAR") @Stable public int codeInstallerMarkIdPollFar; - @HotSpotVMConstant(name = "CodeInstaller::POLL_RETURN_FAR") @Stable public int codeInstallerMarkIdPollReturnFar; - @HotSpotVMConstant(name = "CodeInstaller::CARD_TABLE_SHIFT") @Stable public int codeInstallerMarkIdCardTableShift; - @HotSpotVMConstant(name = "CodeInstaller::CARD_TABLE_ADDRESS") @Stable public int codeInstallerMarkIdCardTableAddress; - @HotSpotVMConstant(name = "CodeInstaller::INVOKE_INVALID") @Stable public int codeInstallerMarkIdInvokeInvalid; + // Checkstyle: stop + @HotSpotVMConstant(name = "CodeInstaller::VERIFIED_ENTRY") @Stable public int MARKID_VERIFIED_ENTRY; + @HotSpotVMConstant(name = "CodeInstaller::UNVERIFIED_ENTRY") @Stable public int MARKID_UNVERIFIED_ENTRY; + @HotSpotVMConstant(name = "CodeInstaller::OSR_ENTRY") @Stable public int MARKID_OSR_ENTRY; + @HotSpotVMConstant(name = "CodeInstaller::EXCEPTION_HANDLER_ENTRY") @Stable public int MARKID_EXCEPTION_HANDLER_ENTRY; + @HotSpotVMConstant(name = "CodeInstaller::DEOPT_HANDLER_ENTRY") @Stable public int MARKID_DEOPT_HANDLER_ENTRY; + @HotSpotVMConstant(name = "CodeInstaller::INVOKEINTERFACE") @Stable public int MARKID_INVOKEINTERFACE; + @HotSpotVMConstant(name = "CodeInstaller::INVOKEVIRTUAL") @Stable public int MARKID_INVOKEVIRTUAL; + @HotSpotVMConstant(name = "CodeInstaller::INVOKESTATIC") @Stable public int MARKID_INVOKESTATIC; + @HotSpotVMConstant(name = "CodeInstaller::INVOKESPECIAL") @Stable public int MARKID_INVOKESPECIAL; + @HotSpotVMConstant(name = "CodeInstaller::INLINE_INVOKE") @Stable public int MARKID_INLINE_INVOKE; + @HotSpotVMConstant(name = "CodeInstaller::POLL_NEAR") @Stable public int MARKID_POLL_NEAR; + @HotSpotVMConstant(name = "CodeInstaller::POLL_RETURN_NEAR") @Stable public int MARKID_POLL_RETURN_NEAR; + @HotSpotVMConstant(name = "CodeInstaller::POLL_FAR") @Stable public int MARKID_POLL_FAR; + @HotSpotVMConstant(name = "CodeInstaller::POLL_RETURN_FAR") @Stable public int MARKID_POLL_RETURN_FAR; + @HotSpotVMConstant(name = "CodeInstaller::CARD_TABLE_SHIFT") @Stable public int MARKID_CARD_TABLE_SHIFT; + @HotSpotVMConstant(name = "CodeInstaller::CARD_TABLE_ADDRESS") @Stable public int MARKID_CARD_TABLE_ADDRESS; + @HotSpotVMConstant(name = "CodeInstaller::INVOKE_INVALID") @Stable public int MARKID_INVOKE_INVALID; + + // Checkstyle: resume public boolean check() { for (Field f : getClass().getDeclaredFields()) { diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java Mon May 18 22:27:24 2015 +0200 @@ -27,9 +27,9 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.compiler.common.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; + import com.oracle.graal.hotspotvmconfig.*; /** @@ -205,7 +205,7 @@ this.value = config.codeInstallResultCodeTooLarge; break; default: - throw GraalInternalError.shouldNotReachHere("unknown enum name " + name); + throw new IllegalArgumentException(name); } this.message = name; } @@ -219,7 +219,7 @@ return e; } } - throw GraalInternalError.shouldNotReachHere("unknown enum value " + value); + throw new IllegalArgumentException(String.valueOf(value)); } @Override @@ -294,8 +294,8 @@ long readUnsafeKlassPointer(Object o); /** - * Reads an object pointer within a VM data structures. That is, any {@link HotSpotVMField} - * whose {@link HotSpotVMField#type() type} is {@code "oop"} (e.g., + * Reads an object pointer within a VM data structure. That is, any {@link HotSpotVMField} whose + * {@link HotSpotVMField#type() type} is {@code "oop"} (e.g., * {@code ArrayKlass::_component_mirror}, {@code Klass::_java_mirror}, * {@code JavaThread::_threadObj}). * diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotCodeCacheProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotCodeCacheProvider.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotCodeCacheProvider.java Mon May 18 22:27:24 2015 +0200 @@ -43,8 +43,6 @@ import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.bridge.*; import com.oracle.graal.hotspot.bridge.CompilerToVM.CodeInstallResult; -import com.oracle.graal.java.*; -import com.oracle.graal.lir.asm.*; import com.oracle.graal.printer.*; /** @@ -53,65 +51,17 @@ public class HotSpotCodeCacheProvider implements CodeCacheProvider { protected final HotSpotGraalRuntimeProvider runtime; + public final HotSpotVMConfig config; protected final TargetDescription target; protected final RegisterConfig regConfig; - public HotSpotCodeCacheProvider(HotSpotGraalRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { + public HotSpotCodeCacheProvider(HotSpotGraalRuntimeProvider runtime, HotSpotVMConfig config, TargetDescription target, RegisterConfig regConfig) { this.runtime = runtime; + this.config = config; this.target = target; this.regConfig = regConfig; } - /** - * Constants used to mark special positions in code being installed into the code cache by Graal - * C++ code. - */ - public enum MarkId { - VERIFIED_ENTRY(config().codeInstallerMarkIdVerifiedEntry), - UNVERIFIED_ENTRY(config().codeInstallerMarkIdUnverifiedEntry), - OSR_ENTRY(config().codeInstallerMarkIdOsrEntry), - EXCEPTION_HANDLER_ENTRY(config().codeInstallerMarkIdExceptionHandlerEntry), - DEOPT_HANDLER_ENTRY(config().codeInstallerMarkIdDeoptHandlerEntry), - INVOKEINTERFACE(config().codeInstallerMarkIdInvokeinterface), - INVOKEVIRTUAL(config().codeInstallerMarkIdInvokevirtual), - INVOKESTATIC(config().codeInstallerMarkIdInvokestatic), - INVOKESPECIAL(config().codeInstallerMarkIdInvokespecial), - INLINE_INVOKE(config().codeInstallerMarkIdInlineInvoke), - POLL_NEAR(config().codeInstallerMarkIdPollNear), - POLL_RETURN_NEAR(config().codeInstallerMarkIdPollReturnNear), - POLL_FAR(config().codeInstallerMarkIdPollFar), - POLL_RETURN_FAR(config().codeInstallerMarkIdPollReturnFar), - CARD_TABLE_SHIFT(config().codeInstallerMarkIdCardTableShift), - CARD_TABLE_ADDRESS(config().codeInstallerMarkIdCardTableAddress); - - private final int value; - - private MarkId(int value) { - this.value = value; - } - - private static HotSpotVMConfig config() { - return HotSpotGraalRuntime.runtime().getConfig(); - } - - public static MarkId getEnum(int value) { - for (MarkId e : values()) { - if (e.value == value) { - return e; - } - } - throw GraalInternalError.shouldNotReachHere("unknown enum value " + value); - } - - /** - * Helper method to {@link CompilationResultBuilder#recordMark(Object) record a mark} with a - * {@link CompilationResultBuilder}. - */ - public static void recordMark(CompilationResultBuilder crb, MarkId mark) { - crb.recordMark(mark.value); - } - } - @Override public String disassemble(CompilationResult compResult, InstalledCode installedCode) { byte[] code = installedCode == null ? Arrays.copyOf(compResult.getTargetCode(), compResult.getTargetCodeSize()) : installedCode.getCode(); @@ -144,7 +94,7 @@ hcf.addOperandComment(site.pcOffset, "{" + site.reference.toString() + "}"); } for (Mark mark : compResult.getMarks()) { - hcf.addComment(mark.pcOffset, MarkId.getEnum((int) mark.id).toString()); + hcf.addComment(mark.pcOffset, getMarkIdName((int) mark.id)); } } String hcfEmbeddedString = hcf.toEmbeddedString(); @@ -181,6 +131,22 @@ } } + private String getMarkIdName(int markId) { + Field[] fields = runtime.getConfig().getClass().getDeclaredFields(); + for (Field f : fields) { + if (f.getName().startsWith("MARKID_")) { + f.setAccessible(true); + try { + if (f.getInt(runtime.getConfig()) == markId) { + return f.getName(); + } + } catch (Exception e) { + } + } + } + return String.valueOf(markId); + } + /** * Decodes a call target to a mnemonic if possible. */ @@ -361,10 +327,6 @@ return null; } - public String disassemble(ResolvedJavaMethod method) { - return new BytecodeDisassembler().disassemble(method); - } - public SpeculationLog createSpeculationLog() { return new HotSpotSpeculationLog(); } diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ExceptionHandlerStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ExceptionHandlerStub.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ExceptionHandlerStub.java Mon May 18 22:27:24 2015 +0200 @@ -32,7 +32,6 @@ 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.HotSpotCodeCacheProvider.MarkId; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.nodes.*; import com.oracle.graal.replacements.*; @@ -40,10 +39,10 @@ import com.oracle.graal.word.*; /** - * Stub called by the {@linkplain MarkId#EXCEPTION_HANDLER_ENTRY exception handler entry point} in a - * compiled method. This entry point is used when returning to a method to handle an exception - * thrown by a callee. It is not used for routing implicit exceptions. Therefore, it does not need - * to save any registers as HotSpot uses a caller save convention. + * Stub called by the {@linkplain HotSpotVMConfig#MARKID_EXCEPTION_HANDLER_ENTRY exception handler + * entry point} in a compiled method. This entry point is used when returning to a method to handle + * an exception thrown by a callee. It is not used for routing implicit exceptions. Therefore, it + * does not need to save any registers as HotSpot uses a caller save convention. *

* The descriptor for a call to this stub is {@link HotSpotBackend#EXCEPTION_HANDLER}. */ diff -r 6df10903c955 -r 15a46a918fc1 graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/OptimizedCallTargetInstrumentation.java --- a/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/OptimizedCallTargetInstrumentation.java Mon May 18 17:44:43 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/OptimizedCallTargetInstrumentation.java Mon May 18 22:27:24 2015 +0200 @@ -29,7 +29,6 @@ import com.oracle.graal.asm.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.hotspot.*; -import com.oracle.graal.hotspot.meta.HotSpotCodeCacheProvider.MarkId; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.framemap.*; @@ -48,7 +47,8 @@ @Override public Mark recordMark(Object id) { Mark mark = super.recordMark(id); - if (MarkId.getEnum((int) id) == MarkId.VERIFIED_ENTRY) { + HotSpotCodeCacheProvider hsCodeCache = (HotSpotCodeCacheProvider) codeCache; + if ((int) id == hsCodeCache.config.MARKID_VERIFIED_ENTRY) { HotSpotRegistersProvider registers = HotSpotGraalRuntime.runtime().getHostProviders().getRegisters(); injectTailCallCode(HotSpotGraalRuntime.runtime().getConfig(), registers); }