# HG changeset patch # User Thomas Wuerthinger # Date 1426017732 -3600 # Node ID 287f7c223d586fbb7e3fcc42c0297fcb519cda20 # Parent 223e1d7b15b75b3a619841ac3741e30db64843ee Add compiler configuration "economy". diff -r 223e1d7b15b7 -r 287f7c223d58 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/EconomyCompilerConfiguration.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/EconomyCompilerConfiguration.java Tue Mar 10 21:02:12 2015 +0100 @@ -0,0 +1,60 @@ +/* + * 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.phases; + +import com.oracle.graal.api.runtime.*; +import com.oracle.graal.lir.phases.*; +import com.oracle.graal.lir.phases.PreAllocationOptimizationPhase.*; +import com.oracle.graal.lir.phases.PostAllocationOptimizationPhase.*; +import com.oracle.graal.lir.phases.AllocationPhase.*; +import com.oracle.graal.phases.*; +import com.oracle.graal.phases.tiers.*; + +@ServiceProvider(CompilerConfiguration.class) +public class EconomyCompilerConfiguration implements CompilerConfiguration { + + public PhaseSuite createHighTier() { + return new EconomyHighTier(); + } + + public PhaseSuite createMidTier() { + return new EconomyMidTier(); + } + + public PhaseSuite createLowTier() { + return new EconomyLowTier(); + } + + public LIRPhaseSuite createPreAllocationOptimizationStage() { + return new EconomyPreAllocationOptimizationStage(); + } + + public LIRPhaseSuite createAllocationStage() { + return new EconomyAllocationStage(); + } + + public LIRPhaseSuite createPostAllocationOptimizationStage() { + return new EconomyPostAllocationOptimizationStage(); + } + +} diff -r 223e1d7b15b7 -r 287f7c223d58 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/EconomyHighTier.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/EconomyHighTier.java Tue Mar 10 21:02:12 2015 +0100 @@ -0,0 +1,42 @@ +/* + * 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.phases; + +import static com.oracle.graal.compiler.common.GraalOptions.*; + +import com.oracle.graal.nodes.spi.*; +import com.oracle.graal.phases.*; +import com.oracle.graal.phases.common.*; +import com.oracle.graal.phases.tiers.*; + +public class EconomyHighTier extends PhaseSuite { + + public EconomyHighTier() { + CanonicalizerPhase canonicalizer = new CanonicalizerPhase(); + if (ImmutableCode.getValue()) { + canonicalizer.disableReadCanonicalization(); + } + appendPhase(new CleanTypeProfileProxyPhase(canonicalizer)); + appendPhase(new LoweringPhase(canonicalizer, LoweringTool.StandardLoweringStage.HIGH_TIER)); + } +} diff -r 223e1d7b15b7 -r 287f7c223d58 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/EconomyLowTier.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/EconomyLowTier.java Tue Mar 10 21:02:12 2015 +0100 @@ -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.phases; + +import static com.oracle.graal.compiler.common.GraalOptions.*; + +import com.oracle.graal.nodes.spi.*; +import com.oracle.graal.phases.*; +import com.oracle.graal.phases.common.*; +import com.oracle.graal.phases.tiers.*; + +public class EconomyLowTier extends PhaseSuite { + + public EconomyLowTier() { + CanonicalizerPhase canonicalizer = new CanonicalizerPhase(); + if (ImmutableCode.getValue()) { + canonicalizer.disableReadCanonicalization(); + } + + appendPhase(new LoweringPhase(canonicalizer, LoweringTool.StandardLoweringStage.LOW_TIER)); + + appendPhase(new ExpandLogicPhase()); + appendPhase(new RemoveValueProxyPhase()); + } +} diff -r 223e1d7b15b7 -r 287f7c223d58 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/EconomyMidTier.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/EconomyMidTier.java Tue Mar 10 21:02:12 2015 +0100 @@ -0,0 +1,48 @@ +/* + * 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.phases; + +import static com.oracle.graal.compiler.common.GraalOptions.*; + +import com.oracle.graal.nodes.spi.*; +import com.oracle.graal.phases.*; +import com.oracle.graal.phases.common.*; +import com.oracle.graal.phases.tiers.*; + +public class EconomyMidTier extends PhaseSuite { + + public EconomyMidTier() { + CanonicalizerPhase canonicalizer = new CanonicalizerPhase(); + if (ImmutableCode.getValue()) { + canonicalizer.disableReadCanonicalization(); + } + + appendPhase(new LoopSafepointInsertionPhase()); + + appendPhase(new GuardLoweringPhase()); + + appendPhase(new LoweringPhase(canonicalizer, LoweringTool.StandardLoweringStage.MID_TIER)); + + appendPhase(new FrameStateAssignmentPhase()); + } +} diff -r 223e1d7b15b7 -r 287f7c223d58 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/EconomyAllocationStage.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/EconomyAllocationStage.java Tue Mar 10 21:02:12 2015 +0100 @@ -0,0 +1,39 @@ +/* + * 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.lir.phases; + +import com.oracle.graal.lir.alloc.lsra.*; +import com.oracle.graal.lir.phases.AllocationPhase.*; +import com.oracle.graal.lir.stackslotalloc.*; + +public class EconomyAllocationStage extends LIRPhaseSuite { + public EconomyAllocationStage() { + appendPhase(new LinearScanPhase()); + + // build frame map + appendPhase(new SimpleStackSlotAllocator()); + + // currently we mark locations only if we do register allocation + appendPhase(new LocationMarker()); + } +} diff -r 223e1d7b15b7 -r 287f7c223d58 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/EconomyPostAllocationOptimizationStage.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/EconomyPostAllocationOptimizationStage.java Tue Mar 10 21:02:12 2015 +0100 @@ -0,0 +1,30 @@ +/* + * 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.lir.phases; + +import com.oracle.graal.lir.phases.PostAllocationOptimizationPhase.*; + +public class EconomyPostAllocationOptimizationStage extends LIRPhaseSuite { + public EconomyPostAllocationOptimizationStage() { + } +} diff -r 223e1d7b15b7 -r 287f7c223d58 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/EconomyPreAllocationOptimizationStage.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/EconomyPreAllocationOptimizationStage.java Tue Mar 10 21:02:12 2015 +0100 @@ -0,0 +1,30 @@ +/* + * 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.lir.phases; + +import com.oracle.graal.lir.phases.PreAllocationOptimizationPhase.*; + +public class EconomyPreAllocationOptimizationStage extends LIRPhaseSuite { + public EconomyPreAllocationOptimizationStage() { + } +} diff -r 223e1d7b15b7 -r 287f7c223d58 mx/mx_graal.py --- a/mx/mx_graal.py Tue Mar 10 19:19:33 2015 +0100 +++ b/mx/mx_graal.py Tue Mar 10 21:02:12 2015 +0100 @@ -1498,6 +1498,10 @@ vm(['-esa', '-XX:-TieredCompilation', '-version']) with VM('graal', 'fastdebug'): + with Task('BootstrapEconomyWithSystemAssertions:fastdebug', tasks): + vm(['-esa', '-XX:-TieredCompilation -G:CompilerConfiguration=economy', '-version']) + + with VM('graal', 'fastdebug'): with Task('BootstrapWithSystemAssertionsNoCoop:fastdebug', tasks): vm(['-esa', '-XX:-TieredCompilation', '-XX:-UseCompressedOops', '-version'])