changeset 4409:9f8e4aeec1a9

Merge
author Andreas Woess <andreas.woess@jku.at>
date Sun, 29 Jan 2012 11:40:04 +0100
parents b197bbb58d2f (diff) 3b776fb6ffd9 (current diff)
children 646a6bfecf73 c8de52cc672a
files graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiResult.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalContext.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalMetrics.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalTimers.java graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/IdealGraphPrinterObserver.java mx.bat src/share/tools/IdealGraphVisualizer/ControlFlow/build.xml src/share/tools/IdealGraphVisualizer/ControlFlow/manifest.mf src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/build-impl.xml src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/genfiles.properties src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/platform.properties src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/project.properties src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/project.xml src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/suite.properties src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/BlockConnectionWidget.java src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/BlockWidget.java src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/Bundle.properties src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowAction.java src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowScene.java src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowTopComponent.form src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowTopComponent.java src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowTopComponentSettings.xml src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowTopComponentWstcref.xml src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/DoubleClickSelectAction.java src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/HierarchicalGraphLayout.java src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/layer.xml src/share/tools/IdealGraphVisualizer/Coordinator/src/META-INF/services/com.sun.hotspot.igv.data.services.GroupOrganizer src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/GraphCountGroupOrganizer.java src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/StandardGroupOrganizer.java src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/StructuredViewAction.java src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/GroupOrganizer.java src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/GroupReceiver.java src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/NullScriptEngine.java src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/ScriptEngineAbstraction.java src/share/tools/IdealGraphVisualizer/Graal/src/META-INF/services/com.sun.hotspot.igv.graphtotext.services.GraphToTextConverter src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/GraalGraphToTextConverter.java src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Block.java src/share/tools/IdealGraphVisualizer/GraphTextEditor/build.xml src/share/tools/IdealGraphVisualizer/GraphTextEditor/manifest.mf src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/build-impl.xml src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/genfiles.properties src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/project.properties src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/project.xml src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/suite.properties src/share/tools/IdealGraphVisualizer/GraphTextEditor/src/com/sun/hotspot/igv/graphtexteditor/Bundle.properties src/share/tools/IdealGraphVisualizer/GraphTextEditor/src/com/sun/hotspot/igv/graphtexteditor/TextAction.java src/share/tools/IdealGraphVisualizer/GraphTextEditor/src/com/sun/hotspot/igv/graphtexteditor/TextTopComponent.form src/share/tools/IdealGraphVisualizer/GraphTextEditor/src/com/sun/hotspot/igv/graphtexteditor/TextTopComponent.java src/share/tools/IdealGraphVisualizer/GraphTextEditor/src/com/sun/hotspot/igv/graphtexteditor/TextTopComponentSettings.xml src/share/tools/IdealGraphVisualizer/GraphTextEditor/src/com/sun/hotspot/igv/graphtexteditor/TextTopComponentWstcref.xml src/share/tools/IdealGraphVisualizer/GraphTextEditor/src/com/sun/hotspot/igv/graphtexteditor/layer.xml src/share/tools/IdealGraphVisualizer/GraphToText/build.xml src/share/tools/IdealGraphVisualizer/GraphToText/manifest.mf src/share/tools/IdealGraphVisualizer/GraphToText/nbproject/build-impl.xml src/share/tools/IdealGraphVisualizer/GraphToText/nbproject/genfiles.properties src/share/tools/IdealGraphVisualizer/GraphToText/nbproject/platform.properties src/share/tools/IdealGraphVisualizer/GraphToText/nbproject/project.properties src/share/tools/IdealGraphVisualizer/GraphToText/nbproject/project.xml src/share/tools/IdealGraphVisualizer/GraphToText/nbproject/suite.properties src/share/tools/IdealGraphVisualizer/GraphToText/src/com/sun/hotspot/igv/graphtotext/BFSGraphToTextConverter.java src/share/tools/IdealGraphVisualizer/GraphToText/src/com/sun/hotspot/igv/graphtotext/Bundle.properties src/share/tools/IdealGraphVisualizer/GraphToText/src/com/sun/hotspot/igv/graphtotext/services/AbstractGraphToTextVisitor.java src/share/tools/IdealGraphVisualizer/GraphToText/src/com/sun/hotspot/igv/graphtotext/services/GraphToTextConverter.java src/share/tools/IdealGraphVisualizer/GraphToText/src/com/sun/hotspot/igv/graphtotext/services/GraphToTextVisitor.java src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterEdge.java src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterIngoingConnection.java src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterInputSlotNode.java src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterNode.java src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterOutgoingConnection.java src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterOutputSlotNode.java src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/HierarchicalClusterLayoutManager.java src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/InterClusterConnection.java src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/OldHierarchicalLayoutManager.java src/share/tools/IdealGraphVisualizer/Java6ScriptingProxy/build.xml src/share/tools/IdealGraphVisualizer/Java6ScriptingProxy/manifest.mf src/share/tools/IdealGraphVisualizer/Java6ScriptingProxy/nbproject/build-impl.xml src/share/tools/IdealGraphVisualizer/Java6ScriptingProxy/nbproject/genfiles.properties src/share/tools/IdealGraphVisualizer/Java6ScriptingProxy/nbproject/project.properties src/share/tools/IdealGraphVisualizer/Java6ScriptingProxy/nbproject/project.xml src/share/tools/IdealGraphVisualizer/Java6ScriptingProxy/nbproject/suite.properties src/share/tools/IdealGraphVisualizer/Java6ScriptingProxy/src/META-INF/services/com.sun.hotspot.igv.filter.ScriptEngineAbstraction src/share/tools/IdealGraphVisualizer/Java6ScriptingProxy/src/com/sun/hotspot/igv/java6scriptingproxy/Bundle.properties src/share/tools/IdealGraphVisualizer/Java6ScriptingProxy/src/com/sun/hotspot/igv/java6scriptingproxy/JavaSE6ScriptEngine.java src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/Cluster.java src/share/tools/IdealGraphVisualizer/NetworkConnection/src/META-INF/services/com.sun.hotspot.igv.data.services.GroupReceiver src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/build.xml src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/manifest.mf src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/build-impl.xml src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/genfiles.properties src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/project.properties src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/project.xml src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/suite.properties src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/src/META-INF/services/com.sun.hotspot.igv.filter.ScriptEngineAbstraction src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/src/com/sun/hotspot/igv/rhino/Bundle.properties src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/src/com/sun/hotspot/igv/rhino/RhinoScriptEngine.java src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/src/com/sun/hotspot/igv/rhino/layer.xml src/share/tools/IdealGraphVisualizer/ServerCompiler/src/META-INF/services/com.sun.hotspot.igv.data.services.GroupOrganizer src/share/tools/IdealGraphVisualizer/ServerCompiler/src/META-INF/services/com.sun.hotspot.igv.graphtotext.services.GraphToTextConverter src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/JavaGroupOrganizer.java src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/ServerCompilerGraphToTextConverter.java src/share/tools/IdealGraphVisualizer/StructuredText/build.xml src/share/tools/IdealGraphVisualizer/StructuredText/manifest.mf src/share/tools/IdealGraphVisualizer/StructuredText/nbproject/build-impl.xml src/share/tools/IdealGraphVisualizer/StructuredText/nbproject/genfiles.properties src/share/tools/IdealGraphVisualizer/StructuredText/nbproject/platform.properties src/share/tools/IdealGraphVisualizer/StructuredText/nbproject/project.properties src/share/tools/IdealGraphVisualizer/StructuredText/nbproject/project.xml src/share/tools/IdealGraphVisualizer/StructuredText/nbproject/suite.properties src/share/tools/IdealGraphVisualizer/StructuredText/src/com/sun/hotspot/igv/structuredtext/Bundle.properties src/share/tools/IdealGraphVisualizer/StructuredText/src/com/sun/hotspot/igv/structuredtext/Element.java src/share/tools/IdealGraphVisualizer/StructuredText/src/com/sun/hotspot/igv/structuredtext/MultiElement.java src/share/tools/IdealGraphVisualizer/StructuredText/src/com/sun/hotspot/igv/structuredtext/Range.java src/share/tools/IdealGraphVisualizer/StructuredText/src/com/sun/hotspot/igv/structuredtext/SimpleElement.java src/share/tools/IdealGraphVisualizer/StructuredText/src/com/sun/hotspot/igv/structuredtext/StructuredText.java src/share/tools/IdealGraphVisualizer/StructuredText/src/com/sun/hotspot/igv/structuredtext/ToolTipProvider.java src/share/tools/IdealGraphVisualizer/StructuredText/src/com/sun/hotspot/igv/structuredtext/services/ElementVisitor.java src/share/tools/IdealGraphVisualizer/TextEditor/build.xml src/share/tools/IdealGraphVisualizer/TextEditor/manifest.mf src/share/tools/IdealGraphVisualizer/TextEditor/nbproject/build-impl.xml src/share/tools/IdealGraphVisualizer/TextEditor/nbproject/genfiles.properties src/share/tools/IdealGraphVisualizer/TextEditor/nbproject/platform.properties src/share/tools/IdealGraphVisualizer/TextEditor/nbproject/project.properties src/share/tools/IdealGraphVisualizer/TextEditor/nbproject/project.xml src/share/tools/IdealGraphVisualizer/TextEditor/nbproject/suite.properties src/share/tools/IdealGraphVisualizer/TextEditor/src/com/sun/hotspot/igv/texteditor/Bundle.properties src/share/tools/IdealGraphVisualizer/TextEditor/src/com/sun/hotspot/igv/texteditor/SyntaxLayer.java src/share/tools/IdealGraphVisualizer/TextEditor/src/com/sun/hotspot/igv/texteditor/TextEditor.java src/share/tools/IdealGraphVisualizer/TextEditor/src/com/sun/hotspot/igv/texteditor/TextEditorKit.java src/share/tools/IdealGraphVisualizer/TextEditor/src/com/sun/hotspot/igv/texteditor/TextFoldManager.java src/share/tools/IdealGraphVisualizer/TextEditor/src/com/sun/hotspot/igv/texteditor/TextFoldManagerFactory.java src/share/tools/IdealGraphVisualizer/TextEditor/src/com/sun/hotspot/igv/texteditor/TextHighlightsLayerFactory.java src/share/tools/IdealGraphVisualizer/TextEditor/src/com/sun/hotspot/igv/texteditor/TextSideBarFactory.java src/share/tools/IdealGraphVisualizer/TextEditor/src/com/sun/hotspot/igv/texteditor/layer.xml src/share/tools/IdealGraphVisualizer/TextEditor/src/com/sun/hotspot/igv/texteditor/org-netbeans-modules-editor-preferences.xml src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/EnableBlockLayoutAction.java src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/BlockWidget.java src/share/vm/graal/graal_paths.hpp
diffstat 2 files changed, 14 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/nodes/TailcallNode.java	Sun Jan 29 02:13:31 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/nodes/TailcallNode.java	Sun Jan 29 11:40:04 2012 +0100
@@ -30,6 +30,7 @@
 import com.oracle.max.graal.compiler.gen.*;
 import com.oracle.max.graal.hotspot.*;
 import com.oracle.max.graal.hotspot.target.amd64.*;
+import com.oracle.max.graal.java.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
@@ -62,10 +63,10 @@
 
         CiKind[] signature = CiUtil.signatureToKinds(method.signature(), isStatic ? null : method.holder().kind(true));
         CiCallingConvention cc = gen.frameMap().registerConfig.getCallingConvention(CiCallingConvention.Type.JavaCall, signature, gen.target(), false);
-        gen.frameMap().callsMethod(cc, CiCallingConvention.Type.JavaCall);
+        gen.frameMap().callsMethod(cc, CiCallingConvention.Type.JavaCall); // TODO (aw): I think this is unnecessary for a tail call.
         List<ValueNode> parameters = new ArrayList<>();
-        for (int i = 0; i < cc.locations.length; i++) {
-            parameters.add(frameState.localAt(i));
+        for (int i = 0, slot = 0; i < cc.locations.length; i++, slot += FrameStateBuilder.stackSlots(frameState.localAt(slot).kind())) {
+            parameters.add(frameState.localAt(slot));
         }
         List<CiValue> argList = gen.visitInvokeArguments(cc, parameters, null);
 
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/target/amd64/AMD64TailcallOp.java	Sun Jan 29 02:13:31 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/target/amd64/AMD64TailcallOp.java	Sun Jan 29 11:40:04 2012 +0100
@@ -37,9 +37,15 @@
  * Performs a hard-coded tail call to the specified target, which normally should be an RiCompiledCode instance.
  */
 public class AMD64TailcallOp extends AMD64LIRInstruction {
+
     public AMD64TailcallOp(List<CiValue> parameters, CiValue target, CiValue[] callingConvention) {
         super("TAILCALL", LIRInstruction.NO_OPERANDS, null, toArray(parameters, target), LIRInstruction.NO_OPERANDS, callingConvention.clone());
         assert inputs.length == temps.length + 1;
+
+        for (int i = 0; i < temps.length; i++) {
+            assert isRegister(temps[i]) : "too many parameters for tail call";
+            assert sameRegister(temps[i], inputs[i]) : "inputs do not match calling convention";
+        }
     }
 
     private static CiValue[] toArray(List<CiValue> parameters, CiValue target) {
@@ -51,19 +57,6 @@
 
     @Override
     public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-        // move all parameters to the correct positions, according to the calling convention
-        // TODO: These moves should not be part of the TAILCALL opcode, but emitted as separate MOVE instructions before.
-        for (int i = 0; i < inputs.length - 1; i++) {
-            assert inputs[i].kind == CiKind.Object || inputs[i].kind == CiKind.Int || inputs[i].kind == CiKind.Long : "only Object, int and long supported for now";
-            assert isRegister(temps[i]) : "too many parameters";
-            if (isRegister(inputs[i])) {
-                if (inputs[i] != temps[i]) {
-                    masm.movq(asRegister(temps[i]), asRegister(inputs[i]));
-                }
-            } else {
-                masm.movq(asRegister(temps[i]), tasm.asAddress(inputs[i]));
-            }
-        }
         // destroy the current frame (now the return address is the top of stack)
         masm.leave();
 
@@ -74,10 +67,10 @@
 
     @Override
     protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-        if (mode == OperandMode.Input && index == 0) {
-            return EnumSet.of(OperandFlag.Register, OperandFlag.Constant, OperandFlag.Stack);
-        } else if (mode == OperandMode.Temp && index == 0) {
-            return EnumSet.of(OperandFlag.Register, OperandFlag.Stack);
+        if (mode == OperandMode.Input) {
+            return EnumSet.of(OperandFlag.Register);
+        } else if (mode == OperandMode.Temp) {
+            return EnumSet.of(OperandFlag.Register);
         }
         throw Util.shouldNotReachHere();
     }