# HG changeset patch # User Josef Eisl # Date 1434720760 -7200 # Node ID a566bda0fb86cfed6904f99ec52d1f974a5577dd # Parent 0c03d2fbd25a4d5d13cac0e220e85763086d6563 AMD64: add custom AMD64SuitesProvider. diff -r 0c03d2fbd25a -r a566bda0fb86 graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64SuitesProvider.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64SuitesProvider.java Fri Jun 19 15:32:40 2015 +0200 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2015, 2015, 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.compiler.amd64; + +import com.oracle.graal.compiler.common.*; +import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; +import com.oracle.graal.java.*; +import com.oracle.graal.lir.amd64.phases.*; +import com.oracle.graal.lir.phases.*; + +public class AMD64SuitesProvider extends DefaultSuitesProvider { + + public AMD64SuitesProvider(Plugins plugins) { + super(plugins); + } + + @Override + public LIRSuites createLIRSuites() { + LIRSuites lirSuites = super.createLIRSuites(); + if (StackMoveOptimizationPhase.Options.LIROptStackMoveOptimizer.getValue() && GraalOptions.SSA_LIR.getValue()) { + lirSuites.getPostAllocationOptimizationStage().prependPhase(new StackMoveOptimizationPhase()); + } + return lirSuites; + } +} diff -r 0c03d2fbd25a -r a566bda0fb86 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java Fri Jun 19 15:19:04 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java Fri Jun 19 15:32:40 2015 +0200 @@ -27,11 +27,11 @@ import java.util.*; import com.oracle.graal.api.replacements.*; +import com.oracle.graal.compiler.amd64.*; import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.word.*; -import com.oracle.graal.java.*; import com.oracle.graal.phases.util.*; import com.oracle.graal.replacements.amd64.*; import com.oracle.jvmci.amd64.*; @@ -127,7 +127,7 @@ } protected HotSpotSuitesProvider createSuites(HotSpotGraalRuntimeProvider runtime, Plugins plugins, CodeCacheProvider codeCache, HotSpotRegistersProvider registers) { - return new HotSpotSuitesProvider(new DefaultSuitesProvider(plugins), runtime, new AMD64HotSpotAddressLowering(codeCache, runtime.getConfig().getOopEncoding().base, + return new HotSpotSuitesProvider(new AMD64SuitesProvider(plugins), runtime, new AMD64HotSpotAddressLowering(codeCache, runtime.getConfig().getOopEncoding().base, registers.getHeapBaseRegister())); } @@ -166,15 +166,15 @@ } else { /* * System V Application Binary Interface, AMD64 Architecture Processor Supplement - * + * * Draft Version 0.96 - * + * * http://www.uclibc.org/docs/psABI-x86_64.pdf - * + * * 3.2.1 - * + * * ... - * + * * This subsection discusses usage of each register. Registers %rbp, %rbx and %r12 * through %r15 "belong" to the calling function and the called function is required to * preserve their values. In other words, a called function must preserve these diff -r 0c03d2fbd25a -r a566bda0fb86 mx.graal/suite.py --- a/mx.graal/suite.py Fri Jun 19 15:19:04 2015 +0200 +++ b/mx.graal/suite.py Fri Jun 19 15:32:40 2015 +0200 @@ -947,6 +947,7 @@ "dependencies" : [ "com.oracle.graal.compiler", "com.oracle.graal.lir.amd64", + "com.oracle.graal.java", ], "checkstyle" : "com.oracle.graal.graph", "annotationProcessors" : ["com.oracle.graal.compiler.match.processor"],