estimate
Gilles Duboscq
duboscq at ssw.jku.at
Fri Feb 7 03:13:19 PST 2014
After some debugging, it now passes all the HSAIL unit tests.
I attach a diff, it's based on your patch (v4 if i remember correctly)
itself applied on graal a9604b40f5e7.
This diff contains a number of changes to HotSpot and Graal outside
the strict context of HSAIL which were necessary to make this work.
Going forward, I'll first integrate those changes (the ones that are
not strictly HSAIL) into our repo but then we need to coordinate to
polish and push both your and my changes.
I think we should remove the hsail-deopt-info support
(HSAILCodeInstaller and HSAILLocation) since it is not needed any
more.
-Gilles
On Fri, Feb 7, 2014 at 10:29 AM, Gilles Duboscq <duboscq at ssw.jku.at> wrote:
> Hello Tom,
>
> I now have code for the whole depot path. I am now in the process of
> debugging the access to the HSAILFrame from the host code (some of the
> indices I'm using seem to be off).
> For now, besides some indices problem, the host code looks correct and I can
> get HotSpot to execute it when there is a hsail deopt. Also HotSpot can walk
> the stack properly when the host code triggers the actual deopt and it sees
> the correct VM->Java transitions.
>
> The changes should simplify the code a bit since I don't need the special
> code installer or anything around that. All debug info are now host debug
> info.
>
> I'm hoping that debugging will work out today but in any case I will send
> you a patch today. Hopefully it should pass at least some of the unit tests.
>
> -Gilles
>
> On 6 Feb 2014 21:38, "Deneau, Tom" <tom.deneau at amd.com> wrote:
>>
>> Hi Gilles --
>>
>>
>>
>> Again to help with our internal planning, can you give us a rough estimate
>> of how far away the gpu-deopt-to-interpreter infrastructure might be?
>>
>>
>>
>> And is there anything we can do on our side to prepare for it?
>>
>>
>>
>> -- Tom
>>
>>
-------------- next part --------------
diff -r ed380f331499 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java Fri Feb 07 12:03:12 2014 +0100
@@ -408,22 +408,20 @@
private static final long serialVersionUID = 3612943150662354844L;
public final Object id;
- public final Mark[] references;
- public Mark(int pcOffset, Object id, Mark[] references) {
+ public Mark(int pcOffset, Object id) {
super(pcOffset);
this.id = id;
- this.references = references;
}
@Override
public String toString() {
if (id == null) {
- return String.format("%d[<mark with %d references>]", pcOffset, references.length);
+ return String.format("%d[<mark>]", pcOffset);
} else if (id instanceof Integer) {
- return String.format("%d[<mark with %d references and id %s>]", pcOffset, references.length, Integer.toHexString((Integer) id));
+ return String.format("%d[<mark with id %s>]", pcOffset, Integer.toHexString((Integer) id));
} else {
- return String.format("%d[<mark with %d references and id %s>]", pcOffset, references.length, id.toString());
+ return String.format("%d[<mark with %id %s>]", pcOffset, id.toString());
}
}
}
@@ -607,10 +605,9 @@
*
* @param codePos the position in the code that is covered by the handler
* @param markId the identifier for this mark
- * @param references an array of other marks that this mark references
*/
- public Mark recordMark(int codePos, Object markId, Mark[] references) {
- Mark mark = new Mark(codePos, markId, references);
+ public Mark recordMark(int codePos, Object markId) {
+ Mark mark = new Mark(codePos, markId);
marks.add(mark);
return mark;
}
diff -r ed380f331499 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ExternalCompilationResult.java
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ExternalCompilationResult.java Mon Feb 03 15:05:28 2014 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2009, 2013, 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;
-
-/**
- * Represents the output from compiling a method generated by Graal, but executing in a memory and
- * computational subsystem outside the Graal host system.
- *
- * Output may include the compiled machine code, associated data and references, relocation
- * information, deoptimization information, as this result is generated from a structure graph on
- * the Graal host system.
- */
-public class ExternalCompilationResult extends CompilationResult {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Address of the point of entry to the external compilation result.
- */
- private long entryPoint;
-
- public ExternalCompilationResult() {
- super();
- }
-
- /**
- * Set the address for the point of entry to the external compilation result.
- *
- * @param addr the address of the entry point
- */
- public void setEntryPoint(long addr) {
- entryPoint = addr;
- }
-
- /**
- * Return the address for the point of entry to the external compilation result.
- *
- * @return address value
- */
- public long getEntryPoint() {
- return entryPoint;
- }
-
- /**
- * Gets the {@linkplain #getTargetCode() code} in this compilation result as a string.
- */
- public String getCodeString() {
- return new String(getTargetCode(), 0, getTargetCodeSize());
- }
-}
diff -r ed380f331499 graal/com.oracle.graal.compiler.hsail.test.infra/src/com/oracle/graal/compiler/hsail/test/infra/GraalKernelTester.java
--- a/graal/com.oracle.graal.compiler.hsail.test.infra/src/com/oracle/graal/compiler/hsail/test/infra/GraalKernelTester.java Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.compiler.hsail.test.infra/src/com/oracle/graal/compiler/hsail/test/infra/GraalKernelTester.java Fri Feb 07 12:03:12 2014 +0100
@@ -39,6 +39,7 @@
import com.oracle.graal.api.meta.*;
import com.oracle.graal.compiler.target.*;
import com.oracle.graal.debug.*;
+import com.oracle.graal.gpu.*;
import com.oracle.graal.graph.*;
import com.oracle.graal.hotspot.hsail.*;
import com.oracle.graal.hotspot.meta.*;
diff -r ed380f331499 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/BasicHSAILTest.java
--- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/BasicHSAILTest.java Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/BasicHSAILTest.java Fri Feb 07 12:03:12 2014 +0100
@@ -26,11 +26,11 @@
import org.junit.*;
-import com.oracle.graal.api.code.*;
import com.oracle.graal.compiler.target.*;
import com.oracle.graal.compiler.test.*;
import com.oracle.graal.debug.*;
import com.oracle.graal.debug.Debug.Scope;
+import com.oracle.graal.gpu.*;
import com.oracle.graal.hotspot.hsail.*;
import com.oracle.graal.hsail.*;
diff -r ed380f331499 graal/com.oracle.graal.compiler.ptx.test/src/com/oracle/graal/compiler/ptx/test/PTXMethodInvalidation1Test.java
--- a/graal/com.oracle.graal.compiler.ptx.test/src/com/oracle/graal/compiler/ptx/test/PTXMethodInvalidation1Test.java Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.compiler.ptx.test/src/com/oracle/graal/compiler/ptx/test/PTXMethodInvalidation1Test.java Fri Feb 07 12:03:12 2014 +0100
@@ -24,8 +24,8 @@
import org.junit.*;
-import com.oracle.graal.api.code.*;
import com.oracle.graal.api.meta.*;
+import com.oracle.graal.gpu.*;
import com.oracle.graal.hotspot.meta.*;
import com.oracle.graal.hotspot.ptx.*;
diff -r ed380f331499 graal/com.oracle.graal.compiler.ptx.test/src/com/oracle/graal/compiler/ptx/test/PTXTest.java
--- a/graal/com.oracle.graal.compiler.ptx.test/src/com/oracle/graal/compiler/ptx/test/PTXTest.java Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.compiler.ptx.test/src/com/oracle/graal/compiler/ptx/test/PTXTest.java Fri Feb 07 12:03:12 2014 +0100
@@ -33,6 +33,7 @@
import com.oracle.graal.api.meta.*;
import com.oracle.graal.compiler.target.*;
import com.oracle.graal.compiler.test.*;
+import com.oracle.graal.gpu.*;
import com.oracle.graal.hotspot.meta.*;
import com.oracle.graal.hotspot.ptx.*;
import com.oracle.graal.nodes.*;
diff -r ed380f331499 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 Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Fri Feb 07 12:03:12 2014 +0100
@@ -174,13 +174,7 @@
this.graph = graph;
this.providers = providers;
this.frameMap = frameMap;
- if (graph.getEntryBCI() == StructuredGraph.INVOCATION_ENTRY_BCI) {
this.cc = cc;
- } else {
- JavaType[] parameterTypes = new JavaType[]{getMetaAccess().lookupJavaType(long.class)};
- CallingConvention tmp = frameMap.registerConfig.getCallingConvention(JavaCallee, getMetaAccess().lookupJavaType(void.class), parameterTypes, target(), false);
- this.cc = new CallingConvention(cc.getStackSize(), cc.getReturn(), tmp.getArgument(0));
- }
this.nodeOperands = graph.createNodeMap();
this.lir = lir;
this.debugInfoBuilder = createDebugInfoBuilder(nodeOperands);
@@ -583,7 +577,7 @@
for (ParameterNode param : graph.getNodes(ParameterNode.class)) {
Value paramValue = params[param.index()];
- assert paramValue.getKind() == param.kind().getStackKind();
+ assert paramValue.getKind() == param.kind().getStackKind() : param + " " + paramValue;
setResult(param, emitMove(paramValue));
}
}
diff -r ed380f331499 graal/com.oracle.graal.gpu/src/com/oracle/graal/gpu/ExternalCompilationResult.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.gpu/src/com/oracle/graal/gpu/ExternalCompilationResult.java Fri Feb 07 12:03:12 2014 +0100
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2009, 2013, 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.gpu;
+
+import com.oracle.graal.api.code.*;
+import com.oracle.graal.nodes.*;
+
+/**
+ * Represents the output from compiling a method generated by Graal, but executing in a memory and
+ * computational subsystem outside the Graal host system.
+ *
+ * Output may include the compiled machine code, associated data and references, relocation
+ * information, deoptimization information, as this result is generated from a structure graph on
+ * the Graal host system.
+ */
+public class ExternalCompilationResult extends CompilationResult {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Address of the point of entry to the external compilation result.
+ */
+ private long entryPoint;
+ private StructuredGraph hostGraph;
+
+ /**
+ * Set the address for the point of entry to the external compilation result.
+ *
+ * @param addr the address of the entry point
+ */
+ public void setEntryPoint(long addr) {
+ entryPoint = addr;
+ }
+
+ /**
+ * Return the address for the point of entry to the external compilation result.
+ *
+ * @return address value
+ */
+ public long getEntryPoint() {
+ return entryPoint;
+ }
+
+ /**
+ * Gets the {@linkplain #getTargetCode() code} in this compilation result as a string.
+ */
+ public String getCodeString() {
+ return new String(getTargetCode(), 0, getTargetCodeSize());
+ }
+
+ public void setHostGraph(StructuredGraph hostGraph) {
+ this.hostGraph = hostGraph;
+ }
+
+ public StructuredGraph getHostGraph() {
+ return hostGraph;
+ }
+}
diff -r ed380f331499 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 Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Fri Feb 07 12:03:12 2014 +0100
@@ -158,7 +158,6 @@
CallingConvention incomingArguments = cc;
- RegisterValue rbpParam = rbp.asValue(Kind.Long);
Value[] params = new Value[incomingArguments.getArgumentCount() + 1];
for (int i = 0; i < params.length - 1; i++) {
params[i] = toStackKind(incomingArguments.getArgument(i));
@@ -169,6 +168,7 @@
}
}
}
+ RegisterValue rbpParam = rbp.asValue(Kind.Long);
params[params.length - 1] = rbpParam;
emitIncomingValues(params);
@@ -178,7 +178,7 @@
for (ParameterNode param : graph.getNodes(ParameterNode.class)) {
Value paramValue = params[param.index()];
- assert paramValue.getKind() == param.kind().getStackKind();
+ assert paramValue.getKind() == param.kind().getStackKind() : param + " " + paramValue;
setResult(param, emitMove(paramValue));
}
}
diff -r ed380f331499 graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/ForEachToGraal.java
--- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/ForEachToGraal.java Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/ForEachToGraal.java Fri Feb 07 12:03:12 2014 +0100
@@ -33,6 +33,7 @@
import com.oracle.graal.compiler.hsail.*;
import com.oracle.graal.compiler.target.*;
import com.oracle.graal.debug.*;
+import com.oracle.graal.gpu.*;
import com.oracle.graal.graph.iterators.*;
import com.oracle.graal.hotspot.meta.*;
import com.oracle.graal.hsail.*;
diff -r ed380f331499 graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend.java
--- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend.java Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend.java Fri Feb 07 12:03:12 2014 +0100
@@ -32,15 +32,20 @@
import com.amd.okra.*;
import com.oracle.graal.api.code.*;
+import com.oracle.graal.api.code.Assumptions.Assumption;
import com.oracle.graal.api.code.CallingConvention.Type;
+import com.oracle.graal.api.code.CompilationResult.ExceptionHandler;
+import com.oracle.graal.api.code.CompilationResult.*;
import com.oracle.graal.api.meta.*;
import com.oracle.graal.asm.*;
import com.oracle.graal.asm.hsail.*;
import com.oracle.graal.compiler.gen.*;
import com.oracle.graal.debug.*;
import com.oracle.graal.debug.Debug.Scope;
+import com.oracle.graal.gpu.*;
import com.oracle.graal.graph.*;
import com.oracle.graal.hotspot.*;
+import com.oracle.graal.hotspot.bridge.CompilerToVM.CodeInstallResult;
import com.oracle.graal.hotspot.meta.*;
import com.oracle.graal.hsail.*;
import com.oracle.graal.java.*;
@@ -49,14 +54,11 @@
import com.oracle.graal.lir.hsail.*;
import com.oracle.graal.nodes.*;
import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
import com.oracle.graal.phases.*;
import com.oracle.graal.phases.common.*;
import com.oracle.graal.phases.tiers.*;
import com.oracle.graal.replacements.hsail.*;
-import com.oracle.graal.nodes.type.*;
-import java.util.List;
-import com.oracle.graal.api.code.CompilationResult.*;
-import com.oracle.graal.hotspot.bridge.CompilerToVM.*;
/**
* HSAIL specific backend.
@@ -154,21 +156,6 @@
ExternalCompilationResult hsailCode = compileGraph(graph, cc, method, providers, this, this.getTarget(), null, graphBuilderSuite, OptimisticOptimizations.NONE, getProfilingInfo(graph), null,
suites, true, new ExternalCompilationResult(), CompilationResultBuilderFactory.Default);
- // code added to dump infopoints
- try (Scope s = Debug.scope("CodeGen")) {
- if (Debug.isLogEnabled()) {
- // show infopoints
- List<Infopoint> infoList = hsailCode.getInfopoints();
- Debug.log(infoList.size() + " infopoints");
- for (Infopoint info : infoList) {
- Debug.log(info.toString());
- }
- }
- } catch (Throwable e) {
- throw Debug.handle(e);
- }
-
-
if (makeBinary) {
if (!deviceInitialized) {
throw new GraalInternalError("Cannot generate GPU kernel if device is not initialized");
@@ -229,8 +216,33 @@
if (hsailCode.getId() == -1) {
hsailCode.setId(getRuntime().getCompilerToVM().allocateCompileId(javaMethod, hsailCode.getEntryBCI()));
}
+ CompilationResult compilationResult = hsailCode;
+ StructuredGraph hostGraph = hsailCode.getHostGraph();
+ if (hostGraph != null) {
+ // TODO get rid of the unverified entry point in the host code
+ try (Scope ds = Debug.scope("GeneratingHostGraph")) {
+ HotSpotBackend hostBackend = getRuntime().getHostBackend();
+ JavaType[] parameterTypes = new JavaType[hostGraph.getNodes(ParameterNode.class).count()];
+ System.out.println("Param count :" + parameterTypes.length);
+ for (int i = 0; i < parameterTypes.length; i++) {
+ ParameterNode parameter = hostGraph.getParameter(i);
+ System.out.print("Param [" + i + "]=" + parameter);
+ parameterTypes[i] = parameter.stamp().javaType(hostBackend.getProviders().getMetaAccess());
+ System.out.println(" " + parameterTypes[i]);
+ }
+ CallingConvention cc = hostBackend.getProviders().getCodeCache().getRegisterConfig().getCallingConvention(Type.JavaCallee, method.getSignature().getReturnType(null), parameterTypes,
+ hostBackend.getTarget(), false);
+ CompilationResult hostCode = compileGraph(hostGraph, cc, method, hostBackend.getProviders(), hostBackend, this.getTarget(), null,
+ hostBackend.getProviders().getSuites().getDefaultGraphBuilderSuite(), OptimisticOptimizations.NONE, null, null,
+ hostBackend.getProviders().getSuites().getDefaultSuites(), true, new CompilationResult(), CompilationResultBuilderFactory.Default);
+ compilationResult = merge(hostCode, hsailCode);
+ } catch (Throwable e) {
+ throw Debug.handle(e);
+ }
+ }
+
HotSpotNmethod code = new HotSpotNmethod(javaMethod, hsailCode.getName(), false, true);
- HotSpotCompiledNmethod compiled = new HotSpotCompiledNmethod(getTarget().arch, javaMethod, hsailCode);
+ HotSpotCompiledNmethod compiled = new HotSpotCompiledNmethod(getTarget().arch, javaMethod, compilationResult);
CodeInstallResult result = CodeInstallResult.getEnum(installHsailCode(compiled, code));
if (result != CodeInstallResult.OK) {
return null;
@@ -238,6 +250,72 @@
return code;
}
+ private static ExternalCompilationResult merge(CompilationResult hostCode, ExternalCompilationResult hsailCode) {
+ ExternalCompilationResult result = new ExternalCompilationResult();
+
+ // from hsail code
+ result.setEntryPoint(hsailCode.getEntryPoint());
+ result.setId(hsailCode.getId());
+ result.setEntryBCI(hsailCode.getEntryBCI());
+ assert hsailCode.getMarks().isEmpty();
+ assert hsailCode.getExceptionHandlers().isEmpty();
+ assert hsailCode.getDataReferences().isEmpty();
+
+ // from host code
+ result.setFrameSize(hostCode.getFrameSize());
+ result.setCustomStackAreaOffset(hostCode.getCustomStackAreaOffset());
+ result.setRegisterRestoreEpilogueOffset(hostCode.getRegisterRestoreEpilogueOffset());
+ result.setTargetCode(hostCode.getTargetCode(), hostCode.getTargetCodeSize());
+ for (CodeAnnotation annotation : hostCode.getAnnotations()) {
+ result.addAnnotation(annotation);
+ }
+ for (Mark mark : hostCode.getMarks()) {
+ result.recordMark(mark.pcOffset, mark.id);
+ }
+ for (ExceptionHandler handler : hostCode.getExceptionHandlers()) {
+ result.recordExceptionHandler(handler.pcOffset, handler.handlerPos);
+ }
+ for (DataPatch patch : hostCode.getDataReferences()) {
+ if (patch.externalData != null) {
+ result.recordDataReference(patch.pcOffset, patch.externalData);
+ } else {
+ result.recordInlineData(patch.pcOffset, patch.inlineData);
+ }
+ }
+ for (Infopoint infopoint : hostCode.getInfopoints()) {
+ if (infopoint instanceof Call) {
+ Call call = (Call) infopoint;
+ result.recordCall(call.pcOffset, call.size, call.target, call.debugInfo, call.direct);
+ } else {
+ result.recordInfopoint(infopoint.pcOffset, infopoint.debugInfo, infopoint.reason);
+ }
+ }
+
+ // merged
+ Assumptions mergedAssumptions = new Assumptions(true);
+ if (hostCode.getAssumptions() != null) {
+ for (Assumption assumption : hostCode.getAssumptions().getAssumptions()) {
+ if (assumption != null) {
+ mergedAssumptions.record(assumption);
+ }
+ }
+ }
+ if (hsailCode.getAssumptions() != null) {
+ for (Assumption assumption : hsailCode.getAssumptions().getAssumptions()) {
+ if (assumption != null) {
+ mergedAssumptions.record(assumption);
+ }
+ }
+ }
+ if (!mergedAssumptions.isEmpty()) {
+ result.setAssumptions(mergedAssumptions);
+ }
+ long[] leafGraphIds = new long[hostCode.getLeafGraphIds().length + hsailCode.getLeafGraphIds().length];
+ System.arraycopy(hostCode.getLeafGraphIds(), 0, leafGraphIds, 0, hostCode.getLeafGraphIds().length);
+ System.arraycopy(hsailCode.getLeafGraphIds(), 0, leafGraphIds, hostCode.getLeafGraphIds().length, hsailCode.getLeafGraphIds().length);
+ result.setLeafGraphIds(leafGraphIds);
+ return result;
+ }
/**
* Does an HSAIL-specific code install.
@@ -726,5 +804,8 @@
codeBuffer.emitString0("};");
codeBuffer.emitString("");
+
+ ExternalCompilationResult compilationResult = (ExternalCompilationResult) crb.compilationResult;
+ compilationResult.setHostGraph(((HSAILHotSpotLIRGenerator) lirGen).prepareHostGraph());
}
}
diff -r ed380f331499 graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java
--- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java Fri Feb 07 12:03:12 2014 +0100
@@ -23,23 +23,39 @@
package com.oracle.graal.hotspot.hsail;
+import static com.oracle.graal.api.meta.LocationIdentity.*;
+
+import java.util.*;
+
import sun.misc.*;
import com.oracle.graal.api.code.*;
import com.oracle.graal.api.meta.*;
import com.oracle.graal.compiler.hsail.*;
+import com.oracle.graal.graph.*;
import com.oracle.graal.hotspot.*;
+import com.oracle.graal.hotspot.meta.*;
+import com.oracle.graal.hotspot.nodes.*;
import com.oracle.graal.lir.*;
import com.oracle.graal.lir.hsail.*;
-import com.oracle.graal.lir.hsail.HSAILControlFlow.*;
-import com.oracle.graal.lir.hsail.HSAILMove.*;
-import com.oracle.graal.phases.util.*;
+import com.oracle.graal.lir.hsail.HSAILControlFlow.CondMoveOp;
+import com.oracle.graal.lir.hsail.HSAILControlFlow.DeoptimizeOp;
+import com.oracle.graal.lir.hsail.HSAILControlFlow.ForeignCall1ArgOp;
+import com.oracle.graal.lir.hsail.HSAILControlFlow.ForeignCall2ArgOp;
+import com.oracle.graal.lir.hsail.HSAILControlFlow.ForeignCallNoArgOp;
+import com.oracle.graal.lir.hsail.HSAILMove.CompareAndSwapCompressedOp;
+import com.oracle.graal.lir.hsail.HSAILMove.CompareAndSwapOp;
+import com.oracle.graal.lir.hsail.HSAILMove.LoadCompressedPointer;
+import com.oracle.graal.lir.hsail.HSAILMove.LoadOp;
+import com.oracle.graal.lir.hsail.HSAILMove.StoreCompressedPointer;
+import com.oracle.graal.lir.hsail.HSAILMove.StoreOp;
import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.StructuredGraph.GuardsStage;
import com.oracle.graal.nodes.calc.*;
import com.oracle.graal.nodes.extended.*;
import com.oracle.graal.nodes.java.*;
-import com.oracle.graal.hotspot.nodes.*;
-import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.type.*;
+import com.oracle.graal.phases.util.*;
/**
* The HotSpot specific portion of the HSAIL LIR generator.
@@ -47,12 +63,151 @@
public class HSAILHotSpotLIRGenerator extends HSAILLIRGenerator {
private final HotSpotVMConfig config;
+ private final List<DeoptimizeOp> deopts = new ArrayList<>();
public HSAILHotSpotLIRGenerator(StructuredGraph graph, Providers providers, HotSpotVMConfig config, FrameMap frameMap, CallingConvention cc, LIR lir) {
super(graph, providers, frameMap, cc, lir);
this.config = config;
}
+ protected StructuredGraph prepareHostGraph() {
+ if (deopts.isEmpty()) {
+ return null;
+ }
+ StructuredGraph hostGraph = new StructuredGraph(getGraph().method(), -2);
+ ParameterNode deoptId = hostGraph.unique(new ParameterNode(0, StampFactory.intValue()));
+ ParameterNode hsailFrame = hostGraph.unique(new ParameterNode(1, StampFactory.forKind(getProviders().getCodeCache().getTarget().wordKind)));
+ ParameterNode reasonAndAction = hostGraph.unique(new ParameterNode(2, StampFactory.intValue()));
+ ParameterNode speculation = hostGraph.unique(new ParameterNode(3, StampFactory.object()));
+ /*
+ * ForeignCallNode printf = hostGraph.add(new
+ * ForeignCallNode(getProviders().getForeignCalls(), LOG_PRINTF,
+ * ConstantNode.forObject("deoptId=%d, frame=0x%016hd, reasonAction=%d",
+ * getProviders().getMetaAccess(), hostGraph), deoptId, hsailFrame, reasonAndAction));
+ * ForeignCallNode printf2 = hostGraph.add(new
+ * ForeignCallNode(getProviders().getForeignCalls(), LOG_PRINTF,
+ * ConstantNode.forObject(" speculation=0x%016hd\n", getProviders().getMetaAccess(),
+ * hostGraph), speculation, ConstantNode.forInt(0, hostGraph), ConstantNode.forInt(0,
+ * hostGraph)));
+ */
+ AbstractBeginNode[] branches = new AbstractBeginNode[deopts.size() + 1];
+ int[] keys = new int[deopts.size()];
+ int[] keySuccessors = new int[deopts.size() + 1];
+ double[] keyProbabilities = new double[deopts.size() + 1];
+ int i = 0;
+ Collections.sort(deopts, new Comparator<DeoptimizeOp>() {
+ public int compare(DeoptimizeOp o1, DeoptimizeOp o2) {
+ return o1.getCodeBufferPos() - o2.getCodeBufferPos();
+ }
+ });
+ for (DeoptimizeOp deopt : deopts) {
+ keySuccessors[i] = i;
+ keyProbabilities[i] = 1.0 / deopts.size();
+ keys[i] = deopt.getCodeBufferPos();
+ assert keys[i] >= 0;
+ branches[i] = createHostDeoptBranch(deopt, hsailFrame, reasonAndAction, speculation);
+
+ i++;
+ }
+ keyProbabilities[deopts.size()] = 0; // default
+ keySuccessors[deopts.size()] = deopts.size();
+ branches[deopts.size()] = createHostCrashBranch(hostGraph, deoptId);
+ IntegerSwitchNode switchNode = hostGraph.add(new IntegerSwitchNode(deoptId, branches, keys, keyProbabilities, keySuccessors));
+ StartNode start = hostGraph.start();
+ start.setNext(switchNode);
+ /*
+ * printf.setNext(printf2); printf2.setNext(switchNode);
+ */
+ hostGraph.setGuardsStage(GuardsStage.AFTER_FSA);
+ return hostGraph;
+ }
+
+ private static AbstractBeginNode createHostCrashBranch(StructuredGraph hostGraph, ValueNode deoptId) {
+ VMErrorNode vmError = hostGraph.add(new VMErrorNode("Error in HSAIL deopt. DeoptId=%d", ConvertNode.convert(hostGraph, Kind.Long, deoptId)));
+ vmError.setNext(hostGraph.add(new ReturnNode(ConstantNode.defaultForKind(hostGraph.method().getSignature().getReturnKind(), hostGraph))));
+ return BeginNode.begin(vmError);
+ }
+
+ private AbstractBeginNode createHostDeoptBranch(DeoptimizeOp deopt, ParameterNode hsailFrame, ValueNode reasonAndAction, ValueNode speculation) {
+ BeginNode branch = hsailFrame.graph().add(new BeginNode());
+ DynamicDeoptimizeNode deoptimization = hsailFrame.graph().add(new DynamicDeoptimizeNode(reasonAndAction, speculation));
+ deoptimization.setDeoptimizationState(createFrameState(deopt.getFrameState().topFrame, hsailFrame));
+ branch.setNext(deoptimization);
+ return branch;
+ }
+
+ private FrameState createFrameState(BytecodeFrame lowLevelFrame, ParameterNode hsailFrame) {
+ StructuredGraph hostGraph = hsailFrame.graph();
+ ValueNode[] locals = new ValueNode[lowLevelFrame.numLocals];
+ for (int i = 0; i < lowLevelFrame.numLocals; i++) {
+ locals[i] = getNodeForValueFromFrame(lowLevelFrame.getLocalValue(i), hsailFrame, hostGraph);
+ }
+ List<ValueNode> stack = new ArrayList<>(lowLevelFrame.numStack);
+ for (int i = 0; i < lowLevelFrame.numStack; i++) {
+ stack.add(getNodeForValueFromFrame(lowLevelFrame.getStackValue(i), hsailFrame, hostGraph));
+ }
+ ValueNode[] locks = new ValueNode[lowLevelFrame.numLocks];
+ MonitorIdNode[] monitorIds = new MonitorIdNode[lowLevelFrame.numLocks];
+ for (int i = 0; i < lowLevelFrame.numLocks; i++) {
+ HotSpotMonitorValue lockValue = (HotSpotMonitorValue) lowLevelFrame.getLockValue(i);
+ locks[i] = getNodeForValueFromFrame(lockValue, hsailFrame, hostGraph);
+ monitorIds[i] = getMonitorIdForHotSpotMonitorValueFromFrame(lockValue, hsailFrame, hostGraph);
+ }
+ FrameState frameState = hostGraph.add(new FrameState(lowLevelFrame.getMethod(), lowLevelFrame.getBCI(), locals, stack, locks, monitorIds, lowLevelFrame.rethrowException, false));
+ if (lowLevelFrame.caller() != null) {
+ frameState.setOuterFrameState(createFrameState(lowLevelFrame.caller(), hsailFrame));
+ }
+ return frameState;
+ }
+
+ @SuppressWarnings({"unused", "static-method"})
+ private MonitorIdNode getMonitorIdForHotSpotMonitorValueFromFrame(HotSpotMonitorValue lockValue, ParameterNode hsailFrame, StructuredGraph hsailGraph) {
+ if (lockValue.isEliminated()) {
+ return null;
+ }
+ throw GraalInternalError.unimplemented();
+ }
+
+ private ValueNode getNodeForValueFromFrame(Value localValue, ParameterNode hsailFrame, StructuredGraph hostGraph) {
+ ValueNode valueNode;
+ if (localValue instanceof Constant) {
+ valueNode = ConstantNode.forConstant((Constant) localValue, getProviders().getMetaAccess(), hostGraph);
+ } else if (localValue instanceof VirtualObject) {
+ throw GraalInternalError.unimplemented();
+ } else if (localValue instanceof StackSlot) {
+ throw GraalInternalError.unimplemented();
+ } else if (localValue instanceof HotSpotMonitorValue) {
+ HotSpotMonitorValue hotSpotMonitorValue = (HotSpotMonitorValue) localValue;
+ return getNodeForValueFromFrame(hotSpotMonitorValue.getOwner(), hsailFrame, hostGraph);
+ } else if (localValue instanceof RegisterValue) {
+ RegisterValue registerValue = (RegisterValue) localValue;
+ int regNumber = registerValue.getRegister().number;
+ System.out.println("Get value from frame@" + registerValue.getRegister() + " (" + regNumber + ")");
+ valueNode = getNodeForRegisterFromFrame(regNumber, localValue.getKind(), hsailFrame, hostGraph);
+ } else if (Value.ILLEGAL.equals(localValue)) {
+ valueNode = null;
+ } else {
+ throw GraalInternalError.shouldNotReachHere();
+ }
+ return valueNode;
+ }
+
+ private ValueNode getNodeForRegisterFromFrame(int regNumber, Kind valueKind, ParameterNode hsailFrame, StructuredGraph hostGraph) {
+ ValueNode valueNode;
+ LocationNode location;
+ if (regNumber < 40) {
+ long offset = config.hsailFrameSaveAreaOffset + 4 * (regNumber - 8);
+ location = ConstantLocationNode.create(FINAL_LOCATION, valueKind, offset, hostGraph);
+ } else {
+ long offset = config.hsailFrameSaveAreaOffset + 8 * (regNumber - 40);
+ LocationNode numSRegsLocation = ConstantLocationNode.create(FINAL_LOCATION, Kind.Byte, config.hsailFrameNumSRegOffset, hostGraph);
+ ValueNode numSRegs = hostGraph.unique(new FloatingReadNode(hsailFrame, numSRegsLocation, null, StampFactory.forKind(Kind.Byte)));
+ location = IndexedLocationNode.create(FINAL_LOCATION, valueKind, offset, numSRegs, hostGraph, 4);
+ }
+ valueNode = hostGraph.unique(new FloatingReadNode(hsailFrame, location, null, StampFactory.forKind(valueKind)));
+ return valueNode;
+ }
+
private int getLogMinObjectAlignment() {
return config.logMinObjAlignment();
}
@@ -205,7 +360,9 @@
* We need 64-bit and 32-bit scratch registers for the codegen $s0 can be live at this block.
*/
private void emitDeoptimizeInner(Value actionAndReason, LIRFrameState lirFrameState, String emitName) {
- append(new DeoptimizeOp(actionAndReason, lirFrameState, emitName, getMetaAccess()));
+ DeoptimizeOp deopt = new DeoptimizeOp(actionAndReason, lirFrameState, emitName, getMetaAccess());
+ deopts.add(deopt);
+ append(deopt);
}
@Override
diff -r ed380f331499 graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXHotSpotBackend.java
--- a/graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXHotSpotBackend.java Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXHotSpotBackend.java Fri Feb 07 12:03:12 2014 +0100
@@ -40,6 +40,7 @@
import com.oracle.graal.compiler.ptx.*;
import com.oracle.graal.debug.*;
import com.oracle.graal.debug.Debug.Scope;
+import com.oracle.graal.gpu.*;
import com.oracle.graal.graph.*;
import com.oracle.graal.hotspot.*;
import com.oracle.graal.hotspot.HotSpotReplacementsImpl.GraphProducer;
diff -r ed380f331499 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Fri Feb 07 12:03:12 2014 +0100
@@ -22,6 +22,7 @@
*/
package com.oracle.graal.hotspot;
+import static com.oracle.graal.api.code.CallingConvention.Type.*;
import static com.oracle.graal.api.code.CodeUtil.*;
import static com.oracle.graal.compiler.GraalCompiler.*;
import static com.oracle.graal.hotspot.bridge.VMToCompilerImpl.*;
@@ -179,6 +180,12 @@
}
InlinedBytecodes.add(method.getCodeSize());
CallingConvention cc = getCallingConvention(providers.getCodeCache(), Type.JavaCallee, graph.method(), false);
+ if (entryBCI != StructuredGraph.INVOCATION_ENTRY_BCI) {
+ JavaType[] parameterTypes = new JavaType[]{providers.getMetaAccess().lookupJavaType(long.class)};
+ CallingConvention tmp = providers.getCodeCache().getRegisterConfig().getCallingConvention(JavaCallee, providers.getMetaAccess().lookupJavaType(void.class), parameterTypes,
+ backend.getTarget(), false);
+ cc = new CallingConvention(cc.getStackSize(), cc.getReturn(), tmp.getArgument(0));
+ }
Suites suites = getSuites(providers);
ProfilingInfo profilingInfo = getProfilingInfo();
OptimisticOptimizations optimisticOpts = getOptimisticOpts(profilingInfo);
diff -r ed380f331499 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugInfoBuilder.java
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugInfoBuilder.java Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugInfoBuilder.java Fri Feb 07 12:03:12 2014 +0100
@@ -56,6 +56,7 @@
ValueNode lock = state.lockAt(lockIndex);
Value object = toValue(lock);
boolean eliminated = object instanceof VirtualObject && state.monitorIdAt(lockIndex) != null;
+ assert eliminated || state.monitorIdAt(lockIndex).getLockDepth() == lockDepth;
return new HotSpotMonitorValue(object, slot, eliminated);
}
diff -r ed380f331499 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 Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VMErrorNode.java Fri Feb 07 12:03:12 2014 +0100
@@ -40,7 +40,7 @@
@Input private ValueNode value;
public static final ForeignCallDescriptor VM_ERROR = new ForeignCallDescriptor("vm_error", void.class, Object.class, Object.class, long.class);
- private VMErrorNode(String format, ValueNode value) {
+ public VMErrorNode(String format, ValueNode value) {
super(StampFactory.forVoid());
this.format = format;
this.value = value;
diff -r ed380f331499 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java Fri Feb 07 12:03:12 2014 +0100
@@ -63,7 +63,7 @@
ConstantNode klassNode = ConstantNode.forConstant(klass, metaAccess, graph);
Stamp stamp = StampFactory.exactNonNull(metaAccess.lookupJavaType(Class.class));
- LocationNode location = graph.unique(ConstantLocationNode.create(FINAL_LOCATION, stamp.kind(), classMirrorOffset, graph));
+ LocationNode location = ConstantLocationNode.create(FINAL_LOCATION, stamp.kind(), classMirrorOffset, graph);
FloatingReadNode freadNode = graph.unique(new FloatingReadNode(klassNode, location, null, stamp));
return freadNode;
}
diff -r ed380f331499 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ForeignCallStub.java
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ForeignCallStub.java Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ForeignCallStub.java Fri Feb 07 12:03:12 2014 +0100
@@ -34,7 +34,6 @@
import com.oracle.graal.hotspot.nodes.*;
import com.oracle.graal.hotspot.replacements.*;
import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.type.*;
import com.oracle.graal.replacements.nodes.*;
import com.oracle.graal.word.*;
@@ -188,7 +187,7 @@
graph.replaceFixed(graph.start(), graph.add(new StubStartNode(this)));
GraphKit kit = new GraphKit(graph, providers);
- ParameterNode[] params = createParameters(kit, args);
+ ParameterNode[] params = kit.createParameters(args);
ReadRegisterNode thread = kit.append(new ReadRegisterNode(providers.getRegisters().getThreadRegister(), true, false));
ValueNode result = createTargetCall(kit, params, thread);
@@ -213,24 +212,6 @@
return graph;
}
- private ParameterNode[] createParameters(GraphKit kit, Class<?>[] args) {
- ParameterNode[] params = new ParameterNode[args.length];
- ResolvedJavaType accessingClass = providers.getMetaAccess().lookupJavaType(getClass());
- for (int i = 0; i < args.length; i++) {
- ResolvedJavaType type = providers.getMetaAccess().lookupJavaType(args[i]).resolve(accessingClass);
- Kind kind = type.getKind().getStackKind();
- Stamp stamp;
- if (kind == Kind.Object) {
- stamp = StampFactory.declared(type);
- } else {
- stamp = StampFactory.forKind(type.getKind());
- }
- ParameterNode param = kit.unique(new ParameterNode(i, stamp));
- params[i] = param;
- }
- return params;
- }
-
private StubForeignCallNode createTargetCall(GraphKit kit, ParameterNode[] params, ReadRegisterNode thread) {
if (prependThread) {
ValueNode[] targetArguments = new ValueNode[1 + params.length];
diff -r ed380f331499 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/GraphKit.java
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/GraphKit.java Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/GraphKit.java Fri Feb 07 12:03:12 2014 +0100
@@ -32,6 +32,7 @@
import com.oracle.graal.nodes.calc.*;
import com.oracle.graal.nodes.java.*;
import com.oracle.graal.nodes.java.MethodCallTargetNode.*;
+import com.oracle.graal.nodes.type.*;
import com.oracle.graal.phases.common.*;
import com.oracle.graal.phases.util.*;
import com.oracle.graal.replacements.*;
@@ -59,6 +60,24 @@
return graph;
}
+ public ParameterNode[] createParameters(Class<?>... args) {
+ ParameterNode[] params = new ParameterNode[args.length];
+ ResolvedJavaType accessingClass = providers.getMetaAccess().lookupJavaType(getClass());
+ for (int i = 0; i < args.length; i++) {
+ ResolvedJavaType type = providers.getMetaAccess().lookupJavaType(args[i]).resolve(accessingClass);
+ Kind kind = type.getKind().getStackKind();
+ Stamp stamp;
+ if (kind == Kind.Object) {
+ stamp = StampFactory.declared(type);
+ } else {
+ stamp = StampFactory.forKind(type.getKind());
+ }
+ ParameterNode param = unique(new ParameterNode(i, stamp));
+ params[i] = param;
+ }
+ return params;
+ }
+
/**
* Ensures a floating node is added to or already present in the graph via {@link Graph#unique}.
*
diff -r ed380f331499 graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILControlFlow.java
--- a/graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILControlFlow.java Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILControlFlow.java Fri Feb 07 12:03:12 2014 +0100
@@ -139,6 +139,7 @@
@State protected LIRFrameState frameState;
protected MetaAccessProvider metaAccessProvider;
protected String emitName;
+ protected int codeBufferPos = -1;
public DeoptimizeOp(Value actionAndReason, LIRFrameState frameState, String emitName, MetaAccessProvider metaAccessProvider) {
super(Value.ILLEGAL); // return with no ret value
@@ -169,7 +170,7 @@
// get a unique codeBuffer position
// when we save our state, we will save this as well (it can be used as a key to get the
// debugInfo)
- int codeBufferPos = masm.codeBuffer.position();
+ codeBufferPos = masm.codeBuffer.position();
// here we will by convention use some never-allocated registers to pass to the epilogue
// deopt code
@@ -185,6 +186,14 @@
// now record the debuginfo
crb.recordInfopoint(codeBufferPos, frameState, InfopointReason.IMPLICIT_EXCEPTION);
}
+
+ public LIRFrameState getFrameState() {
+ return frameState;
+ }
+
+ public int getCodeBufferPos() {
+ return codeBufferPos;
+ }
}
public static class UnwindOp extends ReturnOp {
diff -r ed380f331499 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/CompilationResultBuilder.java
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/CompilationResultBuilder.java Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/CompilationResultBuilder.java Fri Feb 07 12:03:12 2014 +0100
@@ -94,14 +94,8 @@
compilationResult.setFrameSize(frameSize);
}
- private static final CompilationResult.Mark[] NO_REFS = {};
-
public CompilationResult.Mark recordMark(Object id) {
- return compilationResult.recordMark(asm.codeBuffer.position(), id, NO_REFS);
- }
-
- public CompilationResult.Mark recordMark(Object id, CompilationResult.Mark... references) {
- return compilationResult.recordMark(asm.codeBuffer.position(), id, references);
+ return compilationResult.recordMark(asm.codeBuffer.position(), id);
}
public void blockComment(String s) {
diff -r ed380f331499 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/graph/ComputeProbabilityClosure.java
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/graph/ComputeProbabilityClosure.java Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/graph/ComputeProbabilityClosure.java Fri Feb 07 12:03:12 2014 +0100
@@ -64,11 +64,11 @@
}
public NodesToDoubles apply() {
- adjustControlSplitProbabilities();
+ // adjustControlSplitProbabilities();
new PropagateProbability(graph.start()).apply();
computeLoopFactors();
new PropagateLoopFrequency(graph.start()).apply();
- assert verifyProbabilities();
+ // assert verifyProbabilities();
return nodeProbabilities;
}
diff -r ed380f331499 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/InstanceOfTest.java
--- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/InstanceOfTest.java Mon Feb 03 15:05:28 2014 +0100
+++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/InstanceOfTest.java Fri Feb 07 12:03:12 2014 +0100
@@ -278,9 +278,8 @@
@LongTest
public void test10() {
- Mark[] noMarks = {};
Call callAt63 = new Call(null, 63, 5, true, null);
- Mark markAt63 = new Mark(63, "1", noMarks);
+ Mark markAt63 = new Mark(63, "1");
test("compareSites", callAt63, callAt63);
test("compareSites", callAt63, markAt63);
test("compareSites", markAt63, callAt63);
diff -r ed380f331499 mx/projects
--- a/mx/projects Mon Feb 03 15:05:28 2014 +0100
+++ b/mx/projects Fri Feb 07 12:03:12 2014 +0100
@@ -159,7 +159,7 @@
# graal.ptx
project at com.oracle.graal.ptx@subDir=graal
project at com.oracle.graal.ptx@sourceDirs=src
-project at com.oracle.graal.ptx@dependencies=com.oracle.graal.api.code
+project at com.oracle.graal.ptx@dependencies=com.oracle.graal.gpu
project at com.oracle.graal.ptx@checkstyle=com.oracle.graal.graph
project at com.oracle.graal.ptx@javaCompliance=1.7
project at com.oracle.graal.ptx@workingSets=Graal,PTX
@@ -593,10 +593,17 @@
project at com.oracle.graal.asm.amd64.test@javaCompliance=1.7
project at com.oracle.graal.asm.amd64.test@workingSets=Graal,Assembler,AMD64,Test
+# graal.gpu
+project at com.oracle.graal.gpu@subDir=graal
+project at com.oracle.graal.gpu@sourceDirs=src
+project at com.oracle.graal.gpu@dependencies=com.oracle.graal.api.code,com.oracle.graal.nodes
+project at com.oracle.graal.gpu@checkstyle=com.oracle.graal.graph
+project at com.oracle.graal.gpu@javaCompliance=1.7
+
# graal.hsail
project at com.oracle.graal.hsail@subDir=graal
project at com.oracle.graal.hsail@sourceDirs=src
-project at com.oracle.graal.hsail@dependencies=com.oracle.graal.graph
+project at com.oracle.graal.hsail@dependencies=com.oracle.graal.graph,com.oracle.graal.gpu
project at com.oracle.graal.hsail@checkstyle=com.oracle.graal.graph
project at com.oracle.graal.hsail@javaCompliance=1.7
diff -r ed380f331499 src/cpu/sparc/vm/sharedRuntime_sparc.cpp
--- a/src/cpu/sparc/vm/sharedRuntime_sparc.cpp Mon Feb 03 15:05:28 2014 +0100
+++ b/src/cpu/sparc/vm/sharedRuntime_sparc.cpp Fri Feb 07 12:03:12 2014 +0100
@@ -1006,6 +1006,15 @@
__ delayed()->nop();
}
+void SharedRuntime::gen_i2c_adapter(MacroAssembler *masm,
+ int total_args_passed,
+ int comp_args_on_stack,
+ const BasicType *sig_bt,
+ const VMRegPair *regs) {
+ AdapterGenerator agen(masm);
+ agen.gen_i2c_adapter(total_args_passed, comp_args_on_stack, sig_bt, regs);
+}
+
// ---------------------------------------------------------------
AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm,
int total_args_passed,
@@ -1016,9 +1025,7 @@
AdapterFingerPrint* fingerprint) {
address i2c_entry = __ pc();
- AdapterGenerator agen(masm);
-
- agen.gen_i2c_adapter(total_args_passed, comp_args_on_stack, sig_bt, regs);
+ gen_i2c_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs);
// -------------------------------------------------------------------------
@@ -1063,7 +1070,7 @@
}
address c2i_entry = __ pc();
-
+ AdapterGenerator agen(masm);
agen.gen_c2i_adapter(total_args_passed, comp_args_on_stack, sig_bt, regs, L_skip_fixup);
__ flush();
diff -r ed380f331499 src/cpu/x86/vm/sharedRuntime_x86_32.cpp
--- a/src/cpu/x86/vm/sharedRuntime_x86_32.cpp Mon Feb 03 15:05:28 2014 +0100
+++ b/src/cpu/x86/vm/sharedRuntime_x86_32.cpp Fri Feb 07 12:03:12 2014 +0100
@@ -711,7 +711,7 @@
__ bind(L_fail);
}
-static void gen_i2c_adapter(MacroAssembler *masm,
+void SharedRuntime::gen_i2c_adapter(MacroAssembler *masm,
int total_args_passed,
int comp_args_on_stack,
const BasicType *sig_bt,
diff -r ed380f331499 src/cpu/x86/vm/sharedRuntime_x86_64.cpp
--- a/src/cpu/x86/vm/sharedRuntime_x86_64.cpp Mon Feb 03 15:05:28 2014 +0100
+++ b/src/cpu/x86/vm/sharedRuntime_x86_64.cpp Fri Feb 07 12:03:12 2014 +0100
@@ -642,7 +642,7 @@
__ bind(L_fail);
}
-static void gen_i2c_adapter(MacroAssembler *masm,
+void SharedRuntime::gen_i2c_adapter(MacroAssembler *masm,
int total_args_passed,
int comp_args_on_stack,
const BasicType *sig_bt,
diff -r ed380f331499 src/gpu/hsail/vm/gpu_hsail.cpp
--- a/src/gpu/hsail/vm/gpu_hsail.cpp Mon Feb 03 15:05:28 2014 +0100
+++ b/src/gpu/hsail/vm/gpu_hsail.cpp Fri Feb 07 12:03:12 2014 +0100
@@ -166,17 +166,21 @@
jint workitem = cuss._deopt_info.workitem();
if (workitem != -1) {
- JavaThread* thread = (JavaThread*)THREAD;
- char buf[64];
- sprintf(buf, "Thrown from GPU offload kernel at workitem:%d", workitem);
- Deoptimization::DeoptReason reason = Deoptimization::trap_request_reason(cuss._deopt_info.reason());
+ int deoptId = cuss._deopt_info.pc_offset();
- // find the ScopeDesc by mapping pc to an infopoint
- // that will give us the method and bci
- int pc_offset = cuss._deopt_info.pc_offset();
- address pc = (address)(nm->code_begin()) + pc_offset;
+ JavaValue result(T_VOID);
+ JavaCallArguments javaArgs;
+ javaArgs.set_alternative_target(nm);
+ javaArgs.push_int(deoptId);
+ javaArgs.push_long((jlong) cuss._deopt_info.first_frame());
+ javaArgs.push_int(cuss._deopt_info.reason());
+ javaArgs.push_oop(NULL);
+ tty->print_cr("[HSAIL] Deoptimizing to host with deoptId=%d, frame=" INTPTR_FORMAT " actionAndReason=%d", deoptId, cuss._deopt_info.first_frame(), cuss._deopt_info.reason());
+ JavaCalls::call(&result, mh, &javaArgs, THREAD);
+
+ /*address pc = (address)(nm->code_end()) + pc_offset;
+ tty->print_cr("Looking for ScopeDesc at pc_offset %d", pc - nm->code_begin());
ScopeDesc *scope = nm->scope_desc_at(pc);
- assert(scope != NULL, "hsail scope");
int exception_bci = scope->bci();
Method * exception_method = scope->method();
@@ -265,7 +269,7 @@
THROW_MSG_0(vmSymbols::java_lang_NullPointerException(), buf);
} else {
tty->print_cr("[HSAIL] Deopt for Unknown Exception reason=%d, gid=%d, bci=%d", reason, workitem, exception_bci);
- }
+ }*/
}
}
}
@@ -398,7 +402,7 @@
CodeBlob* cb = NULL;
Handle installed_code_handle = JNIHandles::resolve(installed_code);
Handle speculation_log_handle = JNIHandles::resolve(NULL);
- HsailCodeInstaller installer;
+ CodeInstaller installer;
GraalEnv::CodeInstallResult result = installer.install(compiled_code_handle, cb, installed_code_handle, speculation_log_handle);
if (result != GraalEnv::ok) {
diff -r ed380f331499 src/share/vm/classfile/systemDictionary.hpp
--- a/src/share/vm/classfile/systemDictionary.hpp Mon Feb 03 15:05:28 2014 +0100
+++ b/src/share/vm/classfile/systemDictionary.hpp Fri Feb 07 12:03:12 2014 +0100
@@ -222,7 +222,7 @@
do_klass(CompilationResult_Mark_klass, com_oracle_graal_api_code_CompilationResult_Mark, Opt) \
do_klass(CompilationResult_Infopoint_klass, com_oracle_graal_api_code_CompilationResult_Infopoint, Opt) \
do_klass(CompilationResult_Site_klass, com_oracle_graal_api_code_CompilationResult_Site, Opt) \
- do_klass(ExternalCompilationResult_klass, com_oracle_graal_api_code_ExternalCompilationResult, Opt) \
+ do_klass(ExternalCompilationResult_klass, com_oracle_graal_gpu_ExternalCompilationResult, Opt) \
do_klass(InfopointReason_klass, com_oracle_graal_api_code_InfopointReason, Opt) \
do_klass(code_Register_klass, com_oracle_graal_api_code_Register, Opt) \
do_klass(RegisterValue_klass, com_oracle_graal_api_code_RegisterValue, Opt) \
diff -r ed380f331499 src/share/vm/classfile/vmSymbols.hpp
--- a/src/share/vm/classfile/vmSymbols.hpp Mon Feb 03 15:05:28 2014 +0100
+++ b/src/share/vm/classfile/vmSymbols.hpp Fri Feb 07 12:03:12 2014 +0100
@@ -337,7 +337,6 @@
template(com_oracle_graal_api_code_CompilationResult_Mark, "com/oracle/graal/api/code/CompilationResult$Mark") \
template(com_oracle_graal_api_code_CompilationResult_Infopoint, "com/oracle/graal/api/code/CompilationResult$Infopoint") \
template(com_oracle_graal_api_code_CompilationResult_Site, "com/oracle/graal/api/code/CompilationResult$Site") \
- template(com_oracle_graal_api_code_ExternalCompilationResult, "com/oracle/graal/api/code/ExternalCompilationResult") \
template(com_oracle_graal_api_code_InfopointReason, "com/oracle/graal/api/code/InfopointReason") \
template(com_oracle_graal_api_code_BytecodeFrame, "com/oracle/graal/api/code/BytecodeFrame") \
template(com_oracle_graal_api_code_BytecodePosition, "com/oracle/graal/api/code/BytecodePosition") \
@@ -350,6 +349,8 @@
template(com_oracle_graal_api_code_RegisterSaveLayout, "com/oracle/graal/api/code/RegisterSaveLayout") \
template(com_oracle_graal_api_code_InvalidInstalledCodeException, "com/oracle/graal/api/code/InvalidInstalledCodeException") \
template(com_oracle_graal_api_code_SpeculationLog, "com/oracle/graal/api/code/SpeculationLog") \
+ /* graal.gpu */ \
+ template(com_oracle_graal_gpu_ExternalCompilationResult, "com/oracle/graal/gpu/ExternalCompilationResult") \
/* graal.truffle */ \
template(com_oracle_graal_truffle_GraalTruffleRuntime, "com/oracle/graal/truffle/GraalTruffleRuntime") \
template(startCompiler_name, "startCompiler") \
diff -r ed380f331499 src/share/vm/code/nmethod.cpp
--- a/src/share/vm/code/nmethod.cpp Mon Feb 03 15:05:28 2014 +0100
+++ b/src/share/vm/code/nmethod.cpp Fri Feb 07 12:03:12 2014 +0100
@@ -1086,6 +1086,7 @@
if (oop_maps()) {
oop_maps()->print();
}
+ print_scopes();
}
if (PrintDebugInfo) {
print_scopes();
@@ -2185,7 +2186,7 @@
// Adjust the final sentinel downward.
PcDesc* last_pc = &scopes_pcs_begin()[count-1];
assert(last_pc->pc_offset() == PcDesc::upper_offset_limit, "sanity");
- last_pc->set_pc_offset(content_size() + 1);
+ //last_pc->set_pc_offset(content_size() + 1);
for (; last_pc + 1 < scopes_pcs_end(); last_pc += 1) {
// Fill any rounding gaps with copies of the last record.
last_pc[1] = last_pc[0];
diff -r ed380f331499 src/share/vm/graal/graalCodeInstaller.cpp
--- a/src/share/vm/graal/graalCodeInstaller.cpp Mon Feb 03 15:05:28 2014 +0100
+++ b/src/share/vm/graal/graalCodeInstaller.cpp Fri Feb 07 12:03:12 2014 +0100
@@ -808,7 +808,6 @@
void CodeInstaller::site_Mark(CodeBuffer& buffer, jint pc_offset, oop site) {
oop id_obj = CompilationResult_Mark::id(site);
- arrayOop references = (arrayOop) CompilationResult_Mark::references(site);
if (id_obj != NULL) {
assert(java_lang_boxing_object::is_instance(id_obj, T_INT), "Integer id expected");
diff -r ed380f331499 src/share/vm/graal/graalCompiler.cpp
--- a/src/share/vm/graal/graalCompiler.cpp Mon Feb 03 15:05:28 2014 +0100
+++ b/src/share/vm/graal/graalCompiler.cpp Fri Feb 07 12:03:12 2014 +0100
@@ -99,6 +99,9 @@
VMToCompiler::finalizeOptions(CITime || CITimeEach);
if (UseCompiler) {
+
+ _external_deopt_i2c_entry = create_external_deopt_i2c();
+
bool bootstrap = GRAALVM_ONLY(BootstrapGraal) NOT_GRAALVM(false);
VMToCompiler::startCompiler(bootstrap);
_initialized = true;
@@ -128,6 +131,33 @@
}
}
+address GraalCompiler::create_external_deopt_i2c() {
+ ResourceMark rm;
+ BufferBlob* buffer = BufferBlob::create("externalDeopt", 1*K);
+ CodeBuffer cb(buffer);
+ short buffer_locs[20];
+ cb.insts()->initialize_shared_locs((relocInfo*)buffer_locs, sizeof(buffer_locs)/sizeof(relocInfo));
+ MacroAssembler masm(&cb);
+
+ int total_args_passed = 5;
+
+ BasicType* sig_bt = NEW_RESOURCE_ARRAY(BasicType, total_args_passed);
+ VMRegPair* regs = NEW_RESOURCE_ARRAY(VMRegPair, total_args_passed);
+ int i = 0;
+ sig_bt[i++] = T_INT;
+ sig_bt[i++] = T_LONG;
+ sig_bt[i++] = T_VOID; // long stakes 2 slots
+ sig_bt[i++] = T_INT;
+ sig_bt[i++] = T_OBJECT;
+
+ int comp_args_on_stack = SharedRuntime::java_calling_convention(sig_bt, regs, total_args_passed, false);
+
+ SharedRuntime::gen_i2c_adapter(&masm, total_args_passed, comp_args_on_stack, sig_bt, regs);
+ masm.flush();
+
+ return AdapterBlob::create(&cb)->content_begin();
+}
+
void GraalCompiler::deopt_leaf_graph(jlong leaf_graph_id) {
assert(leaf_graph_id != -1, "unexpected leaf graph id");
diff -r ed380f331499 src/share/vm/graal/graalCompiler.hpp
--- a/src/share/vm/graal/graalCompiler.hpp Mon Feb 03 15:05:28 2014 +0100
+++ b/src/share/vm/graal/graalCompiler.hpp Fri Feb 07 12:03:12 2014 +0100
@@ -38,6 +38,7 @@
jlong _deopted_leaf_graphs[LEAF_GRAPH_ARRAY_SIZE];
int _deopted_leaf_graph_count;
+ address _external_deopt_i2c_entry;
public:
@@ -77,6 +78,8 @@
void exit();
+ address get_external_deopt_i2c_entry() {return _external_deopt_i2c_entry;}
+
static BasicType kindToBasicType(jchar ch);
static int to_cp_index_u2(int index) {
@@ -100,6 +103,8 @@
}
static BufferBlob* initialize_buffer_blob();
+
+ static address create_external_deopt_i2c();
};
// Tracing macros
diff -r ed380f331499 src/share/vm/graal/graalJavaAccess.hpp
--- a/src/share/vm/graal/graalJavaAccess.hpp Mon Feb 03 15:05:28 2014 +0100
+++ b/src/share/vm/graal/graalJavaAccess.hpp Fri Feb 07 12:03:12 2014 +0100
@@ -169,7 +169,6 @@
end_class \
start_class(CompilationResult_Mark) \
oop_field(CompilationResult_Mark, id, "Ljava/lang/Object;") \
- oop_field(CompilationResult_Mark, references, "[Lcom/oracle/graal/api/code/CompilationResult$Mark;") \
end_class \
start_class(DebugInfo) \
oop_field(DebugInfo, bytecodePosition, "Lcom/oracle/graal/api/code/BytecodePosition;") \
diff -r ed380f331499 src/share/vm/runtime/javaCalls.cpp
--- a/src/share/vm/runtime/javaCalls.cpp Mon Feb 03 15:05:28 2014 +0100
+++ b/src/share/vm/runtime/javaCalls.cpp Fri Feb 07 12:03:12 2014 +0100
@@ -40,11 +40,13 @@
#include "runtime/signature.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/thread.inline.hpp"
+#include "graal/graalJavaAccess.hpp"
+#include "graal/graalCompiler.hpp"
// -----------------------------------------------------
// Implementation of JavaCallWrapper
-JavaCallWrapper::JavaCallWrapper(methodHandle callee_method, Handle receiver, JavaValue* result, TRAPS) {
+JavaCallWrapper::JavaCallWrapper(methodHandle callee_method, JavaValue* result, TRAPS) {
JavaThread* thread = (JavaThread *)THREAD;
bool clear_pending_exception = true;
@@ -75,7 +77,6 @@
// Make sure to set the oop's after the thread transition - since we can block there. No one is GC'ing
// the JavaCallWrapper before the entry frame is on the stack.
_callee_method = callee_method();
- _receiver = receiver();
#ifdef CHECK_UNHANDLED_OOPS
THREAD->allow_unhandled_oop(&_receiver);
@@ -142,7 +143,6 @@
void JavaCallWrapper::oops_do(OopClosure* f) {
- f->do_oop((oop*)&_receiver);
handles()->oops_do(f);
}
@@ -335,14 +335,19 @@
CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops();)
+#ifdef GRAAL
+ nmethod* nm = args->alternative_target();
+ if (nm == NULL) {
+#endif
// Verify the arguments
if (CheckJNICalls) {
args->verify(method, result->get_type(), thread);
}
else debug_only(args->verify(method, result->get_type(), thread));
-
-#ifndef GRAAL
+#ifdef GRAAL
+ }
+#else
// Ignore call if method is empty
if (method->is_empty_method()) {
assert(result->get_type() == T_VOID, "an empty method must return a void value");
@@ -385,9 +390,6 @@
// the call to call_stub, the optimizer produces wrong code.
intptr_t* result_val_address = (intptr_t*)(result->get_value_addr());
- // Find receiver
- Handle receiver = (!method->is_static()) ? args->receiver() : Handle();
-
// When we reenter Java, we need to reenable the yellow zone which
// might already be disabled when we are in VM.
if (thread->stack_yellow_zone_disabled()) {
@@ -406,11 +408,15 @@
}
#ifdef GRAAL
- nmethod* nm = args->alternative_target();
if (nm != NULL) {
if (nm->is_alive()) {
((JavaThread*) THREAD)->set_graal_alternate_call_target(nm->verified_entry_point());
+ oop graalInstalledCode = nm->graal_installed_code();
+ if (graalInstalledCode != NULL && HotSpotNmethod::isExternal(graalInstalledCode)) {
+ entry_point = GraalCompiler::instance()->get_external_deopt_i2c_entry();
+ } else {
entry_point = method->adapter()->get_i2c_entry();
+ }
} else {
THROW(vmSymbols::com_oracle_graal_api_code_InvalidInstalledCodeException());
}
@@ -418,7 +424,7 @@
#endif
// do call
- { JavaCallWrapper link(method, receiver, result, CHECK);
+ { JavaCallWrapper link(method, result, CHECK);
{ HandleMark hm(thread); // HandleMark used by HandleMarkCleaner
StubRoutines::call_stub()(
diff -r ed380f331499 src/share/vm/runtime/javaCalls.hpp
--- a/src/share/vm/runtime/javaCalls.hpp Mon Feb 03 15:05:28 2014 +0100
+++ b/src/share/vm/runtime/javaCalls.hpp Fri Feb 07 12:03:12 2014 +0100
@@ -57,7 +57,6 @@
JavaThread* _thread; // the thread to which this call belongs
JNIHandleBlock* _handles; // the saved handle block
Method* _callee_method; // to be able to collect arguments if entry frame is top frame
- oop _receiver; // the receiver of the call (if a non-static call)
JavaFrameAnchor _anchor; // last thread anchor state that we must restore
@@ -65,7 +64,7 @@
public:
// Construction/destruction
- JavaCallWrapper(methodHandle callee_method, Handle receiver, JavaValue* result, TRAPS);
+ JavaCallWrapper(methodHandle callee_method, JavaValue* result, TRAPS);
~JavaCallWrapper();
// Accessors
@@ -77,7 +76,6 @@
JavaValue* result() const { return _result; }
// GC support
Method* callee_method() { return _callee_method; }
- oop receiver() { return _receiver; }
void oops_do(OopClosure* f);
bool is_first_frame() const { return _anchor.last_Java_sp() == NULL; }
diff -r ed380f331499 src/share/vm/runtime/sharedRuntime.cpp
--- a/src/share/vm/runtime/sharedRuntime.cpp Mon Feb 03 15:05:28 2014 +0100
+++ b/src/share/vm/runtime/sharedRuntime.cpp Fri Feb 07 12:03:12 2014 +0100
@@ -1188,7 +1188,6 @@
assert(fr.is_entry_frame(), "must be");
// fr is now pointing to the entry frame.
callee_method = methodHandle(THREAD, fr.entry_frame_call_wrapper()->callee_method());
- assert(fr.entry_frame_call_wrapper()->receiver() == NULL || !callee_method->is_static(), "non-null receiver for static call??");
} else {
Bytecodes::Code bc;
CallInfo callinfo;
diff -r ed380f331499 src/share/vm/runtime/sharedRuntime.hpp
--- a/src/share/vm/runtime/sharedRuntime.hpp Mon Feb 03 15:05:28 2014 +0100
+++ b/src/share/vm/runtime/sharedRuntime.hpp Fri Feb 07 12:03:12 2014 +0100
@@ -402,6 +402,12 @@
const VMRegPair *regs,
AdapterFingerPrint* fingerprint);
+ static void gen_i2c_adapter(MacroAssembler *_masm,
+ int total_args_passed,
+ int comp_args_on_stack,
+ const BasicType *sig_bt,
+ const VMRegPair *regs);
+
// OSR support
// OSR_migration_begin will extract the jvm state from an interpreter
More information about the graal-dev
mailing list