# HG changeset patch # User Doug Simon # Date 1368717137 -7200 # Node ID 4cd4926ec683117aefec395a84b8d4185646d4f8 # Parent 857632c8086a4dfcafde80f0f06173dde9a35bba rename: RuntimeCallTarget -> ForeignCallLinkage diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java Thu May 16 17:12:17 2013 +0200 @@ -67,9 +67,9 @@ int getMinimumOutgoingSize(); /** - * Gets the signature and linkage information for a runtime call. + * Gets the linkage for a foreign call. */ - RuntimeCallTarget lookupRuntimeCall(ForeignCallDescriptor descriptor); + ForeignCallLinkage lookupForeignCall(ForeignCallDescriptor descriptor); /** * Encodes a deoptimization action and a deoptimization reason in an integer value. diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ForeignCallLinkage.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ForeignCallLinkage.java Thu May 16 17:12:17 2013 +0200 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2009, 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.api.code; + +import com.oracle.graal.api.meta.*; + +/** + * The runtime specific details of a {@linkplain ForeignCallDescriptor foreign} call. + */ +public interface ForeignCallLinkage extends InvokeTarget { + + /** + * Gets the details of where parameters are passed and value(s) are returned. + */ + CallingConvention getCallingConvention(); + + /** + * Returns the maximum absolute offset of PC relative call to this stub from any position in the + * code cache or -1 when not applicable. Intended for determining the required size of + * address/offset fields. + */ + long getMaxCallTargetOffset(); + + ForeignCallDescriptor getDescriptor(); + + /** + * Determines if the foreign call target destroys all registers. + * + * @return {@code true} if the register allocator must save all live registers around a call to + * this target + */ + boolean destroysRegisters(); +} diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RuntimeCallTarget.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RuntimeCallTarget.java Thu May 16 16:41:37 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2009, 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.api.code; - -import com.oracle.graal.api.meta.*; - -/** - * The name, signature and calling convention of a call from compiled code to the runtime. The - * target of such a call may be a leaf stub or a call into the runtime code proper. - */ -public interface RuntimeCallTarget extends InvokeTarget { - - CallingConvention getCallingConvention(); - - /** - * Returns the maximum absolute offset of PC relative call to this stub from any position in the - * code cache or -1 when not applicable. Intended for determining the required size of - * address/offset fields. - */ - long getMaxCallTargetOffset(); - - ForeignCallDescriptor getDescriptor(); - - /** - * Determines if the target routine destroys all registers. - * - * @return {@code true} if the register allocator must save all live registers around a call to - * this target - */ - boolean destroysRegisters(); -} diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java --- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java Thu May 16 17:12:17 2013 +0200 @@ -784,7 +784,7 @@ } @Override - protected void emitCall(RuntimeCallTarget callTarget, Value result, Value[] arguments, Value[] temps, LIRFrameState info) { + protected void emitForeignCall(ForeignCallLinkage callTarget, Value result, Value[] arguments, Value[] temps, LIRFrameState info) { long maxOffset = callTarget.getMaxCallTargetOffset(); if (maxOffset != (int) maxOffset) { diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java --- a/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java Thu May 16 17:12:17 2013 +0200 @@ -642,7 +642,7 @@ } @Override - protected void emitCall(RuntimeCallTarget callTarget, Value result, Value[] arguments, Value[] temps, LIRFrameState info) { + protected void emitForeignCall(ForeignCallLinkage callTarget, Value result, Value[] arguments, Value[] temps, LIRFrameState info) { throw new InternalError("NYI"); } diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java --- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Thu May 16 17:12:17 2013 +0200 @@ -112,7 +112,7 @@ } @Override - protected void emitCall(RuntimeCallTarget callTarget, Value result, Value[] arguments, Value[] temps, LIRFrameState info) { + protected void emitForeignCall(ForeignCallLinkage linkage, Value result, Value[] arguments, Value[] temps, LIRFrameState info) { // SPARC: Auto-generated method stub } diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Thu May 16 17:12:17 2013 +0200 @@ -624,7 +624,7 @@ protected abstract void emitIndirectCall(IndirectCallTargetNode callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState callState); - protected abstract void emitCall(RuntimeCallTarget callTarget, Value result, Value[] arguments, Value[] temps, LIRFrameState info); + protected abstract void emitForeignCall(ForeignCallLinkage linkage, Value result, Value[] arguments, Value[] temps, LIRFrameState info); protected static AllocatableValue toStackKind(AllocatableValue value) { if (value.getKind().getStackKind() != value.getKind()) { @@ -659,7 +659,7 @@ } @Override - public Variable emitCall(RuntimeCallTarget callTarget, CallingConvention callCc, DeoptimizingNode info, Value... args) { + public Variable emitForeignCall(ForeignCallLinkage linkage, CallingConvention callCc, DeoptimizingNode info, Value... args) { LIRFrameState state = info != null ? state(info) : null; // move the arguments into the correct location @@ -672,7 +672,7 @@ emitMove(loc, arg); argLocations[i] = loc; } - emitCall(callTarget, callCc.getReturn(), argLocations, callCc.getTemporaries(), state); + emitForeignCall(linkage, callCc.getReturn(), argLocations, callCc.getTemporaries(), state); if (isLegal(callCc.getReturn())) { return emitMove(callCc.getReturn()); diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64DeoptimizeOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64DeoptimizeOp.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64DeoptimizeOp.java Thu May 16 17:12:17 2013 +0200 @@ -52,6 +52,6 @@ HotSpotGraalRuntime runtime = graalRuntime(); Register thread = runtime.getRuntime().threadRegister(); masm.movl(new AMD64Address(thread, runtime.getConfig().pendingDeoptimizationOffset), tasm.runtime.encodeDeoptActionAndReason(action, reason)); - AMD64Call.directCall(tasm, masm, tasm.runtime.lookupRuntimeCall(UNCOMMON_TRAP), null, false, info); + AMD64Call.directCall(tasm, masm, tasm.runtime.lookupForeignCall(UNCOMMON_TRAP), null, false, info); } } diff -r 857632c8086a -r 4cd4926ec683 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 Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java Thu May 16 17:12:17 2013 +0200 @@ -250,9 +250,9 @@ HotSpotFrameContext frameContext = (HotSpotFrameContext) tasm.frameContext; if (frameContext != null && !frameContext.isStub) { tasm.recordMark(Marks.MARK_EXCEPTION_HANDLER_ENTRY); - AMD64Call.directCall(tasm, asm, runtime().lookupRuntimeCall(EXCEPTION_HANDLER), null, false, null); + AMD64Call.directCall(tasm, asm, runtime().lookupForeignCall(EXCEPTION_HANDLER), null, false, null); tasm.recordMark(Marks.MARK_DEOPT_HANDLER_ENTRY); - AMD64Call.directCall(tasm, asm, runtime().lookupRuntimeCall(DEOPT_HANDLER), null, false, null); + AMD64Call.directCall(tasm, asm, runtime().lookupForeignCall(DEOPT_HANDLER), null, false, null); } else { // No need to emit the stubs for entries back into the method since // it has no calls that can cause such "return" entries @@ -261,7 +261,7 @@ if (unverifiedStub != null) { asm.bind(unverifiedStub); - AMD64Call.directJmp(tasm, asm, runtime().lookupRuntimeCall(IC_MISS_HANDLER)); + AMD64Call.directJmp(tasm, asm, runtime().lookupForeignCall(IC_MISS_HANDLER)); } } } diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotDeoptimizeCallerOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotDeoptimizeCallerOp.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotDeoptimizeCallerOp.java Thu May 16 17:12:17 2013 +0200 @@ -54,6 +54,6 @@ HotSpotGraalRuntime runtime = graalRuntime(); Register thread = runtime.getRuntime().threadRegister(); masm.movl(new AMD64Address(thread, runtime.getConfig().pendingDeoptimizationOffset), tasm.runtime.encodeDeoptActionAndReason(action, reason)); - AMD64Call.directJmp(tasm, masm, tasm.runtime.lookupRuntimeCall(UNCOMMON_TRAP)); + AMD64Call.directJmp(tasm, masm, tasm.runtime.lookupForeignCall(UNCOMMON_TRAP)); } } diff -r 857632c8086a -r 4cd4926ec683 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 Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Thu May 16 17:12:17 2013 +0200 @@ -186,9 +186,9 @@ private LIRFrameState currentRuntimeCallInfo; @Override - protected void emitCall(RuntimeCallTarget callTarget, Value result, Value[] arguments, Value[] temps, LIRFrameState info) { + protected void emitForeignCall(ForeignCallLinkage callTarget, Value result, Value[] arguments, Value[] temps, LIRFrameState info) { currentRuntimeCallInfo = info; - super.emitCall(callTarget, result, arguments, temps, info); + super.emitForeignCall(callTarget, result, arguments, temps, info); } protected AMD64SaveRegistersOp emitSaveRegisters(Register[] savedRegisters, StackSlot[] savedRegisterLocations) { @@ -209,10 +209,10 @@ } @Override - public Variable emitCall(RuntimeCallTarget callTarget, CallingConvention callCc, DeoptimizingNode info, Value... args) { + public Variable emitForeignCall(ForeignCallLinkage linkage, CallingConvention callCc, DeoptimizingNode info, Value... args) { Stub stub = getStub(); - HotSpotRuntimeCallTarget hsCallTarget = (HotSpotRuntimeCallTarget) callTarget; - boolean destroysRegisters = hsCallTarget.destroysRegisters(); + HotSpotRuntimeCallTarget hsLinkage = (HotSpotRuntimeCallTarget) linkage; + boolean destroysRegisters = hsLinkage.destroysRegisters(); AMD64SaveRegistersOp save = null; StackSlot[] savedRegisterLocations = null; @@ -231,13 +231,13 @@ } } } - if (!hsCallTarget.isLeaf()) { + if (!hsLinkage.isLeaf()) { append(new AMD64HotSpotCRuntimeCallPrologueOp()); } - Variable result = super.emitCall(callTarget, callCc, info, args); + Variable result = super.emitForeignCall(linkage, callCc, info, args); - if (!hsCallTarget.isLeaf()) { + if (!hsLinkage.isLeaf()) { append(new AMD64HotSpotCRuntimeCallEpilogueOp()); } @@ -340,10 +340,10 @@ @Override public void emitUnwind(Value exception) { - RuntimeCallTarget stub = getRuntime().lookupRuntimeCall(HotSpotBackend.UNWIND_EXCEPTION_TO_CALLER); - CallingConvention stubCc = stub.getCallingConvention(); - assert stubCc.getArgumentCount() == 2; - RegisterValue exceptionParameter = (RegisterValue) stubCc.getArgument(0); + ForeignCallLinkage linkage = getRuntime().lookupForeignCall(HotSpotBackend.UNWIND_EXCEPTION_TO_CALLER); + CallingConvention linkageCc = linkage.getCallingConvention(); + assert linkageCc.getArgumentCount() == 2; + RegisterValue exceptionParameter = (RegisterValue) linkageCc.getArgument(0); emitMove(exceptionParameter, exception); append(new AMD64HotSpotUnwindOp(exceptionParameter)); } @@ -366,11 +366,11 @@ @Override public void emitJumpToExceptionHandlerInCaller(ValueNode handlerInCallerPc, ValueNode exception, ValueNode exceptionPc) { Variable handler = load(operand(handlerInCallerPc)); - RuntimeCallTarget stub = getRuntime().lookupRuntimeCall(EXCEPTION_HANDLER_IN_CALLER); - CallingConvention stubCc = stub.getCallingConvention(); - assert stubCc.getArgumentCount() == 2; - RegisterValue exceptionFixed = (RegisterValue) stubCc.getArgument(0); - RegisterValue exceptionPcFixed = (RegisterValue) stubCc.getArgument(1); + ForeignCallLinkage linkage = getRuntime().lookupForeignCall(EXCEPTION_HANDLER_IN_CALLER); + CallingConvention linkageCc = linkage.getCallingConvention(); + assert linkageCc.getArgumentCount() == 2; + RegisterValue exceptionFixed = (RegisterValue) linkageCc.getArgument(0); + RegisterValue exceptionPcFixed = (RegisterValue) linkageCc.getArgument(1); emitMove(exceptionFixed, operand(exception)); emitMove(exceptionPcFixed, operand(exceptionPc)); AMD64HotSpotJumpToExceptionHandlerInCallerOp op = new AMD64HotSpotJumpToExceptionHandlerInCallerOp(handler, exceptionFixed, exceptionPcFixed); diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotUnwindOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotUnwindOp.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotUnwindOp.java Thu May 16 17:12:17 2013 +0200 @@ -51,8 +51,8 @@ public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) { leaveFrameAndRestoreRbp(tasm, masm); - RuntimeCallTarget stub = tasm.runtime.lookupRuntimeCall(UNWIND_EXCEPTION_TO_CALLER); - CallingConvention cc = stub.getCallingConvention(); + ForeignCallLinkage linkage = tasm.runtime.lookupForeignCall(UNWIND_EXCEPTION_TO_CALLER); + CallingConvention cc = linkage.getCallingConvention(); assert cc.getArgumentCount() == 2; assert exception.equals(cc.getArgument(0)); @@ -60,6 +60,6 @@ Register returnAddress = asRegister(cc.getArgument(1)); masm.movq(returnAddress, new AMD64Address(rsp, 0)); - AMD64Call.directJmp(tasm, masm, tasm.runtime.lookupRuntimeCall(HotSpotBackend.UNWIND_EXCEPTION_TO_CALLER)); + AMD64Call.directJmp(tasm, masm, tasm.runtime.lookupForeignCall(HotSpotBackend.UNWIND_EXCEPTION_TO_CALLER)); } } diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotRuntimeCallTarget.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotRuntimeCallTarget.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotRuntimeCallTarget.java Thu May 16 17:12:17 2013 +0200 @@ -38,7 +38,7 @@ /** * The details required to link a HotSpot runtime or stub call. */ -public class HotSpotRuntimeCallTarget implements RuntimeCallTarget, InvokeTarget { +public class HotSpotRuntimeCallTarget implements ForeignCallLinkage, InvokeTarget { /** * Constants for specifying whether a call destroys or preserves registers. A call will always diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Thu May 16 17:12:17 2013 +0200 @@ -192,14 +192,14 @@ /** * Registers the details for linking a call to a {@link Stub}. */ - protected RuntimeCallTarget registerStubCall(ForeignCallDescriptor descriptor) { + protected ForeignCallLinkage registerStubCall(ForeignCallDescriptor descriptor) { return register(HotSpotRuntimeCallTarget.create(descriptor, 0L, PRESERVES_REGISTERS, JavaCallee, NOT_LEAF)); } /** * Registers the details for a call to a runtime C/C++ function. */ - protected RuntimeCallTarget registerCRuntimeCall(ForeignCallDescriptor descriptor, long address) { + protected ForeignCallLinkage registerCRuntimeCall(ForeignCallDescriptor descriptor, long address) { Class resultType = descriptor.getResultType(); assert resultType.isPrimitive() || Word.class.isAssignableFrom(resultType) : "C runtime call must return object thread local storage: " + descriptor; return register(HotSpotRuntimeCallTarget.create(descriptor, address, DESTROYS_REGISTERS, NativeCall, NOT_LEAF)); @@ -208,7 +208,7 @@ /** * Registers the details for a call to a stub that never returns. */ - protected RuntimeCallTarget registerNoReturnStub(ForeignCallDescriptor descriptor, long address, CallingConvention.Type ccType) { + protected ForeignCallLinkage registerNoReturnStub(ForeignCallDescriptor descriptor, long address, CallingConvention.Type ccType) { return register(HotSpotRuntimeCallTarget.create(descriptor, address, PRESERVES_REGISTERS, ccType, NOT_LEAF)); } @@ -217,7 +217,7 @@ * throw exceptions. That is, the thread's execution state during the call is never inspected by * another thread. */ - protected RuntimeCallTarget registerLeafCall(ForeignCallDescriptor descriptor, long address, CallingConvention.Type ccType, RegisterEffect effect) { + protected ForeignCallLinkage registerLeafCall(ForeignCallDescriptor descriptor, long address, CallingConvention.Type ccType, RegisterEffect effect) { return register(HotSpotRuntimeCallTarget.create(descriptor, address, effect, ccType, LEAF)); } @@ -854,7 +854,7 @@ return HotSpotResolvedObjectType.fromClass(clazz); } - public HotSpotRuntimeCallTarget lookupRuntimeCall(ForeignCallDescriptor descriptor) { + public HotSpotRuntimeCallTarget lookupForeignCall(ForeignCallDescriptor descriptor) { HotSpotRuntimeCallTarget callTarget = runtimeCalls.get(descriptor); assert runtimeCalls != null : descriptor; callTarget.finalizeAddress(graalRuntime.getBackend()); diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CRuntimeCall.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CRuntimeCall.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CRuntimeCall.java Thu May 16 17:12:17 2013 +0200 @@ -48,12 +48,12 @@ @Override public void generate(LIRGenerator gen) { - RuntimeCallTarget stub = gen.getRuntime().lookupRuntimeCall(descriptor); + ForeignCallLinkage linkage = gen.getRuntime().lookupForeignCall(descriptor); Value[] args = new Value[arguments.size()]; for (int i = 0; i < args.length; i++) { args[i] = gen.operand(arguments.get(i)); } - Variable result = gen.emitCall(stub, stub.getCallingConvention(), this, args); + Variable result = gen.emitForeignCall(linkage, linkage.getCallingConvention(), this, args); if (result != null) { gen.setResult(this, result); } diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/MonitorEnterStubCall.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/MonitorEnterStubCall.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/MonitorEnterStubCall.java Thu May 16 17:12:17 2013 +0200 @@ -47,8 +47,8 @@ @Override public void generate(LIRGenerator gen) { - RuntimeCallTarget stub = gen.getRuntime().lookupRuntimeCall(MONITORENTER); - gen.emitCall(stub, stub.getCallingConvention(), this, gen.operand(object), gen.operand(lock)); + ForeignCallLinkage linkage = gen.getRuntime().lookupForeignCall(MONITORENTER); + gen.emitForeignCall(linkage, linkage.getCallingConvention(), this, gen.operand(object), gen.operand(lock)); } @NodeIntrinsic diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/MonitorExitStubCall.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/MonitorExitStubCall.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/MonitorExitStubCall.java Thu May 16 17:12:17 2013 +0200 @@ -51,8 +51,8 @@ assert lockDepth != -1; HotSpotLIRGenerator hsGen = (HotSpotLIRGenerator) gen; StackSlot slot = hsGen.getLockSlot(lockDepth); - RuntimeCallTarget stub = gen.getRuntime().lookupRuntimeCall(MonitorExitStubCall.MONITOREXIT); - gen.emitCall(stub, stub.getCallingConvention(), this, gen.operand(object), gen.emitAddress(slot)); + ForeignCallLinkage linkage = gen.getRuntime().lookupForeignCall(MonitorExitStubCall.MONITOREXIT); + gen.emitForeignCall(linkage, linkage.getCallingConvention(), this, gen.operand(object), gen.emitAddress(slot)); } @NodeIntrinsic diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewArrayStubCall.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewArrayStubCall.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewArrayStubCall.java Thu May 16 17:12:17 2013 +0200 @@ -62,8 +62,8 @@ @Override public void generate(LIRGenerator gen) { - RuntimeCallTarget stub = gen.getRuntime().lookupRuntimeCall(NEW_ARRAY); - Variable result = gen.emitCall(stub, stub.getCallingConvention(), this, gen.operand(hub), gen.operand(length)); + ForeignCallLinkage linkage = gen.getRuntime().lookupForeignCall(NEW_ARRAY); + Variable result = gen.emitForeignCall(linkage, linkage.getCallingConvention(), this, gen.operand(hub), gen.operand(length)); gen.setResult(this, result); } diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewInstanceStubCall.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewInstanceStubCall.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewInstanceStubCall.java Thu May 16 17:12:17 2013 +0200 @@ -60,8 +60,8 @@ @Override public void generate(LIRGenerator gen) { - RuntimeCallTarget stub = gen.getRuntime().lookupRuntimeCall(NEW_INSTANCE); - Variable result = gen.emitCall(stub, stub.getCallingConvention(), this, gen.operand(hub)); + ForeignCallLinkage linkage = gen.getRuntime().lookupForeignCall(NEW_INSTANCE); + Variable result = gen.emitForeignCall(linkage, linkage.getCallingConvention(), this, gen.operand(hub)); gen.setResult(this, result); } diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewMultiArrayStubCall.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewMultiArrayStubCall.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewMultiArrayStubCall.java Thu May 16 17:12:17 2013 +0200 @@ -64,8 +64,8 @@ @Override public void generate(LIRGenerator gen) { - RuntimeCallTarget stub = gen.getRuntime().lookupRuntimeCall(NewMultiArrayStubCall.NEW_MULTI_ARRAY); - Variable result = gen.emitCall(stub, stub.getCallingConvention(), this, gen.operand(hub), Constant.forInt(rank), gen.operand(dims)); + ForeignCallLinkage linkage = gen.getRuntime().lookupForeignCall(NewMultiArrayStubCall.NEW_MULTI_ARRAY); + Variable result = gen.emitForeignCall(linkage, linkage.getCallingConvention(), this, gen.operand(hub), Constant.forInt(rank), gen.operand(dims)); gen.setResult(this, result); } diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ThreadIsInterruptedStubCall.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ThreadIsInterruptedStubCall.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ThreadIsInterruptedStubCall.java Thu May 16 17:12:17 2013 +0200 @@ -51,8 +51,8 @@ @Override public void generate(LIRGenerator gen) { - RuntimeCallTarget stub = gen.getRuntime().lookupRuntimeCall(ThreadIsInterruptedStubCall.THREAD_IS_INTERRUPTED); - Variable result = gen.emitCall(stub, stub.getCallingConvention(), this, gen.operand(thread), gen.operand(clearIsInterrupted)); + ForeignCallLinkage linkage = gen.getRuntime().lookupForeignCall(ThreadIsInterruptedStubCall.THREAD_IS_INTERRUPTED); + Variable result = gen.emitForeignCall(linkage, linkage.getCallingConvention(), this, gen.operand(thread), gen.operand(clearIsInterrupted)); gen.setResult(this, result); } diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VMErrorNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VMErrorNode.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VMErrorNode.java Thu May 16 17:12:17 2013 +0200 @@ -57,8 +57,8 @@ Constant whereArg = Constant.forObject(whereString.intern()); Constant formatArg = Constant.forObject(format.intern()); - RuntimeCallTarget stub = gen.getRuntime().lookupRuntimeCall(VMErrorNode.VM_ERROR); - gen.emitCall(stub, stub.getCallingConvention(), null, whereArg, formatArg, gen.operand(value)); + ForeignCallLinkage linkage = gen.getRuntime().lookupForeignCall(VMErrorNode.VM_ERROR); + gen.emitForeignCall(linkage, linkage.getCallingConvention(), null, whereArg, formatArg, gen.operand(value)); } @NodeIntrinsic diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VerifyOopStubCall.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VerifyOopStubCall.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VerifyOopStubCall.java Thu May 16 17:12:17 2013 +0200 @@ -45,8 +45,8 @@ @Override public void generate(LIRGenerator gen) { - RuntimeCallTarget stub = gen.getRuntime().lookupRuntimeCall(VerifyOopStubCall.VERIFY_OOP); - gen.emitCall(stub, stub.getCallingConvention(), this, gen.operand(object)); + ForeignCallLinkage linkage = gen.getRuntime().lookupForeignCall(VerifyOopStubCall.VERIFY_OOP); + gen.emitForeignCall(linkage, linkage.getCallingConvention(), this, gen.operand(object)); } @NodeIntrinsic diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/WriteBarrierPostStubCall.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/WriteBarrierPostStubCall.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/WriteBarrierPostStubCall.java Thu May 16 17:12:17 2013 +0200 @@ -47,8 +47,8 @@ @Override public void generate(LIRGenerator gen) { - RuntimeCallTarget stub = gen.getRuntime().lookupRuntimeCall(WriteBarrierPostStubCall.WRITE_BARRIER_POST); - gen.emitCall(stub, stub.getCallingConvention(), null, gen.operand(object), gen.operand(card)); + ForeignCallLinkage linkage = gen.getRuntime().lookupForeignCall(WriteBarrierPostStubCall.WRITE_BARRIER_POST); + gen.emitForeignCall(linkage, linkage.getCallingConvention(), null, gen.operand(object), gen.operand(card)); } @NodeIntrinsic diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/WriteBarrierPreStubCall.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/WriteBarrierPreStubCall.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/WriteBarrierPreStubCall.java Thu May 16 17:12:17 2013 +0200 @@ -44,8 +44,8 @@ @Override public void generate(LIRGenerator gen) { - RuntimeCallTarget stub = gen.getRuntime().lookupRuntimeCall(WriteBarrierPreStubCall.WRITE_BARRIER_PRE); - gen.emitCall(stub, stub.getCallingConvention(), null, gen.operand(object)); + ForeignCallLinkage linkage = gen.getRuntime().lookupForeignCall(WriteBarrierPreStubCall.WRITE_BARRIER_PRE); + gen.emitForeignCall(linkage, linkage.getCallingConvention(), null, gen.operand(object)); } @NodeIntrinsic diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AESCryptSubstitutions.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AESCryptSubstitutions.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AESCryptSubstitutions.java Thu May 16 17:12:17 2013 +0200 @@ -96,8 +96,8 @@ @Override public void generate(LIRGenerator gen) { - RuntimeCallTarget stub = gen.getRuntime().lookupRuntimeCall(descriptor); - gen.emitCall(stub, stub.getCallingConvention(), null, gen.operand(in), gen.operand(out), gen.operand(key)); + ForeignCallLinkage linkage = gen.getRuntime().lookupForeignCall(descriptor); + gen.emitForeignCall(linkage, linkage.getCallingConvention(), null, gen.operand(in), gen.operand(out), gen.operand(key)); } } diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CipherBlockChainingSubstitutions.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CipherBlockChainingSubstitutions.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CipherBlockChainingSubstitutions.java Thu May 16 17:12:17 2013 +0200 @@ -117,8 +117,8 @@ @Override public void generate(LIRGenerator gen) { - RuntimeCallTarget stub = gen.getRuntime().lookupRuntimeCall(descriptor); - gen.emitCall(stub, stub.getCallingConvention(), null, gen.operand(in), gen.operand(out), gen.operand(key), gen.operand(r), gen.operand(inLength)); + ForeignCallLinkage linkage = gen.getRuntime().lookupForeignCall(descriptor); + gen.emitForeignCall(linkage, linkage.getCallingConvention(), null, gen.operand(in), gen.operand(out), gen.operand(key), gen.operand(r), gen.operand(inLength)); } } diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java Thu May 16 17:12:17 2013 +0200 @@ -104,9 +104,9 @@ public abstract static class RuntimeCallOp extends CallOp { - protected final RuntimeCallTarget callTarget; + protected final ForeignCallLinkage callTarget; - public RuntimeCallOp(RuntimeCallTarget callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState state) { + public RuntimeCallOp(ForeignCallLinkage callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState state) { super(result, parameters, temps, state); this.callTarget = callTarget; } @@ -120,7 +120,7 @@ @Opcode("CALL_NEAR_RUNTIME") public static class DirectNearRuntimeCallOp extends RuntimeCallOp { - public DirectNearRuntimeCallOp(RuntimeCallTarget callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState state) { + public DirectNearRuntimeCallOp(ForeignCallLinkage callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState state) { super(callTarget, result, parameters, temps, state); } @@ -135,7 +135,7 @@ @Temp({REG}) protected AllocatableValue callTemp; - public DirectFarRuntimeCallOp(LIRGeneratorTool gen, RuntimeCallTarget callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState state) { + public DirectFarRuntimeCallOp(LIRGeneratorTool gen, ForeignCallLinkage callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState state) { super(callTarget, result, parameters, temps, state); callTemp = gen.newVariable(Kind.Long); } diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ForeignCallNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ForeignCallNode.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ForeignCallNode.java Thu May 16 17:12:17 2013 +0200 @@ -55,12 +55,12 @@ @Override public void generate(LIRGeneratorTool gen) { - RuntimeCallTarget stub = gen.getRuntime().lookupRuntimeCall(descriptor); + ForeignCallLinkage linkage = gen.getRuntime().lookupForeignCall(descriptor); Value[] args = new Value[arguments.size()]; for (int i = 0; i < args.length; i++) { args[i] = gen.operand(arguments.get(i)); } - Value result = gen.emitCall(stub, stub.getCallingConvention(), this, args); + Value result = gen.emitForeignCall(linkage, linkage.getCallingConvention(), this, args); if (result != null) { gen.setResult(this, result); } diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/RegisterFinalizerNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/RegisterFinalizerNode.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/RegisterFinalizerNode.java Thu May 16 17:12:17 2013 +0200 @@ -50,8 +50,8 @@ @Override public void generate(LIRGeneratorTool gen) { - RuntimeCallTarget call = gen.getRuntime().lookupRuntimeCall(REGISTER_FINALIZER); - gen.emitCall(call, call.getCallingConvention(), this, gen.operand(object())); + ForeignCallLinkage linkage = gen.getRuntime().lookupForeignCall(REGISTER_FINALIZER); + gen.emitForeignCall(linkage, linkage.getCallingConvention(), this, gen.operand(object())); } @Override diff -r 857632c8086a -r 4cd4926ec683 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java Thu May 16 16:41:37 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java Thu May 16 17:12:17 2013 +0200 @@ -101,7 +101,7 @@ void emitNullCheck(ValueNode v, DeoptimizingNode deopting); - Value emitCall(RuntimeCallTarget callTarget, CallingConvention cc, DeoptimizingNode info, Value... args); + Value emitForeignCall(ForeignCallLinkage callTarget, CallingConvention cc, DeoptimizingNode info, Value... args); void emitIf(IfNode i);