annotate graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java @ 19521:9c4168877444

Create CompilerAsserts tests. Add graph builder context on bailout. Consolidate CompilerAsserts Truffle API class.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 20 Feb 2015 13:58:56 +0100
parents a5c9756f9649
children 711f46f691cf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
18208
abe9758da9d9 Truffle: add headers for new compilation listener files.
Christian Humer <christian.humer@gmail.com>
parents: 18205
diff changeset
2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * accompanied this code).
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 * questions.
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
22 */
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
23 package com.oracle.graal.truffle;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
25 import static com.oracle.graal.api.code.CodeUtil.*;
13239
Doug Simon <doug.simon@oracle.com>
parents: 13233
diff changeset
26 import static com.oracle.graal.compiler.GraalCompiler.*;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
27
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
28 import java.util.*;
15217
ec7d8b646b9f Truffle: Fixed display of installed code size.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 15210
diff changeset
29
19306
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19276
diff changeset
30 import com.oracle.graal.api.code.Assumptions.Assumption;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
31 import com.oracle.graal.api.code.*;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
32 import com.oracle.graal.api.code.CallingConvention.Type;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
33 import com.oracle.graal.api.meta.*;
18963
892e466d28f3 Allow PartialEvaluator to use a custom SnippetReflectionProvider
Paul Woegerer <paul.woegerer@oracle.com>
parents: 18816
diff changeset
34 import com.oracle.graal.api.replacements.*;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
35 import com.oracle.graal.api.runtime.*;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
36 import com.oracle.graal.compiler.target.*;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
37 import com.oracle.graal.debug.*;
13197
8569b9e047cd change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents: 12690
diff changeset
38 import com.oracle.graal.debug.Debug.Scope;
15963
a62590637801 track memory usage in TruffleCompilerImpl
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15415
diff changeset
39 import com.oracle.graal.debug.DebugMemUseTracker.Closeable;
11515
65d2f38c0aa5 added timers for Truffle compilation pipeline
Doug Simon <doug.simon@oracle.com>
parents: 11207
diff changeset
40 import com.oracle.graal.debug.internal.*;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
41 import com.oracle.graal.java.*;
13229
325b4e4efb60 added CompilationResultBuilderFactory to support peep-hole instrumentation of methods as their code is emitted
Doug Simon <doug.simon@oracle.com>
parents: 13228
diff changeset
42 import com.oracle.graal.lir.asm.*;
19232
66c60942c06c GraalCompiler.emitLowLevel: use LowLevelSuites instead of LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents: 19125
diff changeset
43 import com.oracle.graal.lir.phases.*;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
44 import com.oracle.graal.nodes.*;
19306
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19276
diff changeset
45 import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions;
18816
972009398b30 Disable inlining across Truffle boundary by default.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 18473
diff changeset
46 import com.oracle.graal.nodes.java.*;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
47 import com.oracle.graal.nodes.spi.*;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
48 import com.oracle.graal.phases.*;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
49 import com.oracle.graal.phases.tiers.*;
12054
bba234a1670e grouped provider values/parameters into a Providers object (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents: 12052
diff changeset
50 import com.oracle.graal.phases.util.*;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
51 import com.oracle.graal.printer.*;
12488
1a4dc163cd0a abstracted HotSpotGraalRuntime as a RuntimeProvider which removes the recent selector addition to the Graal capabilities API and also makes Truffle independent of the graal.hotspot project (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
52 import com.oracle.graal.runtime.*;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
53 import com.oracle.graal.truffle.nodes.*;
10529
254fab64b343 Separate replacements for Truffle compilation
Andreas Woess <andreas.woess@jku.at>
parents: 10488
diff changeset
54 import com.oracle.truffle.api.*;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
55 import com.oracle.truffle.api.nodes.*;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
56
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
57 /**
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
58 * Implementation of the Truffle compiler using Graal.
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
59 */
15210
201f6858a4f3 Restructure the interaction between OptimizedCallTarget and GraalTruffleRuntime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 15189
diff changeset
60 public class TruffleCompilerImpl {
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
61
12054
bba234a1670e grouped provider values/parameters into a Providers object (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents: 12052
diff changeset
62 private final Providers providers;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
63 private final Suites suites;
19270
292442bed972 Rename LowLevelSuites to LIRSuites.
Josef Eisl <josef.eisl@jku.at>
parents: 19232
diff changeset
64 private final LIRSuites lirSuites;
10529
254fab64b343 Separate replacements for Truffle compilation
Andreas Woess <andreas.woess@jku.at>
parents: 10488
diff changeset
65 private final PartialEvaluator partialEvaluator;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
66 private final Backend backend;
13789
a98d5959a813 PartialEvaluationTest should use the same GraphBuilderConfiguration as the TruffleCompiler; code cleanup
Andreas Woess <andreas.woess@jku.at>
parents: 13774
diff changeset
67 private final GraphBuilderConfiguration config;
12488
1a4dc163cd0a abstracted HotSpotGraalRuntime as a RuntimeProvider which removes the recent selector addition to the Graal capabilities API and also makes Truffle independent of the graal.hotspot project (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
68 private final RuntimeProvider runtime;
10611
1546866ebb8d First draft of Truffle graph caching.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10577
diff changeset
69 private final TruffleCache truffleCache;
18199
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
70 private final GraalTruffleCompilationListener compilationNotify;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
71
19239
637ca4d37bca Extensions and fixes to inline and canonicalize during parsing.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19125
diff changeset
72 private static final Class<?>[] SKIPPED_EXCEPTION_CLASSES = new Class[]{UnexpectedResultException.class, SlowPathException.class, ArithmeticException.class, IllegalArgumentException.class,
637ca4d37bca Extensions and fixes to inline and canonicalize during parsing.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19125
diff changeset
73 VirtualMachineError.class, ClassCastException.class};
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
74
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
75 public static final OptimisticOptimizations Optimizations = OptimisticOptimizations.ALL.remove(OptimisticOptimizations.Optimization.UseExceptionProbability,
10535
ddc756cd065d Disable type check hints and type checked inlining for Truffle compiler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10488
diff changeset
76 OptimisticOptimizations.Optimization.RemoveNeverExecutedCode, OptimisticOptimizations.Optimization.UseTypeCheckedInlining, OptimisticOptimizations.Optimization.UseTypeCheckHints);
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
77
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
78 public TruffleCompilerImpl() {
18199
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
79 GraalTruffleRuntime graalTruffleRuntime = ((GraalTruffleRuntime) Truffle.getRuntime());
12488
1a4dc163cd0a abstracted HotSpotGraalRuntime as a RuntimeProvider which removes the recent selector addition to the Graal capabilities API and also makes Truffle independent of the graal.hotspot project (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
80 this.runtime = Graal.getRequiredCapability(RuntimeProvider.class);
18199
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
81 this.compilationNotify = graalTruffleRuntime.getCompilationNotify();
12488
1a4dc163cd0a abstracted HotSpotGraalRuntime as a RuntimeProvider which removes the recent selector addition to the Graal capabilities API and also makes Truffle independent of the graal.hotspot project (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
82 this.backend = runtime.getHostBackend();
18199
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
83 Replacements truffleReplacements = graalTruffleRuntime.getReplacements();
19440
d59f813786f6 Merge and merge fixes.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19436 19420
diff changeset
84 Providers backendProviders = backend.getProviders();
d59f813786f6 Merge and merge fixes.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19436 19420
diff changeset
85 ConstantReflectionProvider constantReflection = new TruffleConstantReflectionProvider(backendProviders.getConstantReflection(), backendProviders.getMetaAccess());
d59f813786f6 Merge and merge fixes.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19436 19420
diff changeset
86 if (!TruffleCompilerOptions.FastPE.getValue()) {
d59f813786f6 Merge and merge fixes.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19436 19420
diff changeset
87 backendProviders = backendProviders.copyWith(truffleReplacements);
d59f813786f6 Merge and merge fixes.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19436 19420
diff changeset
88 }
d59f813786f6 Merge and merge fixes.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19436 19420
diff changeset
89 this.providers = backendProviders.copyWith(constantReflection);
13585
f4f0a8a01ce0 remove PhasePlan
Lukas Stadler <lukas.stadler@jku.at>
parents: 13584
diff changeset
90 this.suites = backend.getSuites().getDefaultSuites();
19270
292442bed972 Rename LowLevelSuites to LIRSuites.
Josef Eisl <josef.eisl@jku.at>
parents: 19232
diff changeset
91 this.lirSuites = backend.getSuites().getDefaultLIRSuites();
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
92
13789
a98d5959a813 PartialEvaluationTest should use the same GraphBuilderConfiguration as the TruffleCompiler; code cleanup
Andreas Woess <andreas.woess@jku.at>
parents: 13774
diff changeset
93 ResolvedJavaType[] skippedExceptionTypes = getSkippedExceptionTypes(providers.getMetaAccess());
16573
a2ec1ac769e4 Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 16546
diff changeset
94 GraphBuilderConfiguration eagerConfig = GraphBuilderConfiguration.getEagerDefault().withSkippedExceptionTypes(skippedExceptionTypes);
19436
fa20f31fead0 Install correct graph builder plugins for FastPE.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19403
diff changeset
95
16573
a2ec1ac769e4 Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 16546
diff changeset
96 this.config = GraphBuilderConfiguration.getDefault().withSkippedExceptionTypes(skippedExceptionTypes);
19436
fa20f31fead0 Install correct graph builder plugins for FastPE.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19403
diff changeset
97 if (TruffleCompilerOptions.FastPE.getValue()) {
fa20f31fead0 Install correct graph builder plugins for FastPE.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19403
diff changeset
98 GraphBuilderPhase phase = (GraphBuilderPhase) backend.getSuites().getDefaultGraphBuilderSuite().findPhase(GraphBuilderPhase.class).previous();
fa20f31fead0 Install correct graph builder plugins for FastPE.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19403
diff changeset
99 this.config.getInvocationPlugins().setDefaults(phase.getGraphBuilderConfig().getInvocationPlugins());
fa20f31fead0 Install correct graph builder plugins for FastPE.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19403
diff changeset
100 }
fa20f31fead0 Install correct graph builder plugins for FastPE.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19403
diff changeset
101
19107
46544f51cde4 Move some logic from TruffleCache to PartialEvaluator.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19047
diff changeset
102 this.truffleCache = new TruffleCacheImpl(providers, eagerConfig, TruffleCompilerImpl.Optimizations);
14866
a0185cd77565 Truffle: refactor ompilation related classes for SubstrateVM
Erik Eckstein <erik.eckstein@oracle.com>
parents: 14172
diff changeset
103
19107
46544f51cde4 Move some logic from TruffleCache to PartialEvaluator.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19047
diff changeset
104 this.partialEvaluator = new PartialEvaluator(providers, config, truffleCache, Graal.getRequiredCapability(SnippetReflectionProvider.class));
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
105
11561
e1309fc4d17f ensure Debug.enable() is called before any DebugTimer or DebugMetric objects are requested
Doug Simon <doug.simon@oracle.com>
parents: 11515
diff changeset
106 if (Debug.isEnabled()) {
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
107 DebugEnvironment.initialize(System.out);
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
108 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
109 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
110
14866
a0185cd77565 Truffle: refactor ompilation related classes for SubstrateVM
Erik Eckstein <erik.eckstein@oracle.com>
parents: 14172
diff changeset
111 public static ResolvedJavaType[] getSkippedExceptionTypes(MetaAccessProvider metaAccess) {
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
112 ResolvedJavaType[] skippedExceptionTypes = new ResolvedJavaType[SKIPPED_EXCEPTION_CLASSES.length];
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
113 for (int i = 0; i < SKIPPED_EXCEPTION_CLASSES.length; i++) {
12049
3cd7b1a27645 rename: metaAccessProvider -> metaAccess
Doug Simon <doug.simon@oracle.com>
parents: 12045
diff changeset
114 skippedExceptionTypes[i] = metaAccess.lookupJavaType(SKIPPED_EXCEPTION_CLASSES[i]);
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
115 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
116 return skippedExceptionTypes;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
117 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
118
11515
65d2f38c0aa5 added timers for Truffle compilation pipeline
Doug Simon <doug.simon@oracle.com>
parents: 11207
diff changeset
119 public static final DebugTimer PartialEvaluationTime = Debug.timer("PartialEvaluationTime");
65d2f38c0aa5 added timers for Truffle compilation pipeline
Doug Simon <doug.simon@oracle.com>
parents: 11207
diff changeset
120 public static final DebugTimer CompilationTime = Debug.timer("CompilationTime");
65d2f38c0aa5 added timers for Truffle compilation pipeline
Doug Simon <doug.simon@oracle.com>
parents: 11207
diff changeset
121 public static final DebugTimer CodeInstallationTime = Debug.timer("CodeInstallation");
65d2f38c0aa5 added timers for Truffle compilation pipeline
Doug Simon <doug.simon@oracle.com>
parents: 11207
diff changeset
122
15963
a62590637801 track memory usage in TruffleCompilerImpl
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15415
diff changeset
123 public static final DebugMemUseTracker PartialEvaluationMemUse = Debug.memUseTracker("TrufflePartialEvaluationMemUse");
a62590637801 track memory usage in TruffleCompilerImpl
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15415
diff changeset
124 public static final DebugMemUseTracker CompilationMemUse = Debug.memUseTracker("TruffleCompilationMemUse");
a62590637801 track memory usage in TruffleCompilerImpl
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15415
diff changeset
125 public static final DebugMemUseTracker CodeInstallationMemUse = Debug.memUseTracker("TruffleCodeInstallationMemUse");
a62590637801 track memory usage in TruffleCompilerImpl
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15415
diff changeset
126
18199
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
127 public void compileMethod(final OptimizedCallTarget compilable) {
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
128 StructuredGraph graph = null;
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
129
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
130 compilationNotify.notifyCompilationStarted(compilable);
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
131
18199
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
132 try {
19390
7f4201b633e7 renamed GraphBuilderPlugins to InvocationPlugins and consolidated it into GraphBuilderConfiguration; moved declaration of GraphBuilderPlugin sub-interfaces into GraphBuilderPlugin
Doug Simon <doug.simon@oracle.com>
parents: 19363
diff changeset
133 PhaseSuite<HighTierContext> graphBuilderSuite = createGraphBuilderSuite();
18199
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
134
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
135 try (TimerCloseable a = PartialEvaluationTime.start(); Closeable c = PartialEvaluationMemUse.start()) {
19390
7f4201b633e7 renamed GraphBuilderPlugins to InvocationPlugins and consolidated it into GraphBuilderConfiguration; moved declaration of GraphBuilderPlugin sub-interfaces into GraphBuilderPlugin
Doug Simon <doug.simon@oracle.com>
parents: 19363
diff changeset
136 graph = partialEvaluator.createGraph(compilable, AllowAssumptions.YES);
18199
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
137 }
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
138
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
139 if (Thread.currentThread().isInterrupted()) {
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
140 return;
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
141 }
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
142
18816
972009398b30 Disable inlining across Truffle boundary by default.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 18473
diff changeset
143 if (!TruffleCompilerOptions.TruffleInlineAcrossTruffleBoundary.getValue()) {
972009398b30 Disable inlining across Truffle boundary by default.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 18473
diff changeset
144 // Do not inline across Truffle boundaries.
19403
61d3cb8e1280 Add generic parameter to NodeClass. Change Graph#getNodes(Class) to Graph#getNodes(NodeClass).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19390
diff changeset
145 for (MethodCallTargetNode mct : graph.getNodes(MethodCallTargetNode.TYPE)) {
18816
972009398b30 Disable inlining across Truffle boundary by default.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 18473
diff changeset
146 mct.invoke().setUseForInlining(false);
972009398b30 Disable inlining across Truffle boundary by default.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 18473
diff changeset
147 }
972009398b30 Disable inlining across Truffle boundary by default.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 18473
diff changeset
148 }
972009398b30 Disable inlining across Truffle boundary by default.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 18473
diff changeset
149
18199
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
150 compilationNotify.notifyCompilationTruffleTierFinished(compilable, graph);
19390
7f4201b633e7 renamed GraphBuilderPlugins to InvocationPlugins and consolidated it into GraphBuilderConfiguration; moved declaration of GraphBuilderPlugin sub-interfaces into GraphBuilderPlugin
Doug Simon <doug.simon@oracle.com>
parents: 19363
diff changeset
151 CompilationResult compilationResult = compileMethodHelper(graph, compilable.toString(), graphBuilderSuite, compilable.getSpeculationLog(), compilable);
18199
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
152 compilationNotify.notifyCompilationSuccess(compilable, graph, compilationResult);
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
153 } catch (Throwable t) {
19521
9c4168877444 Create CompilerAsserts tests. Add graph builder context on bailout. Consolidate CompilerAsserts Truffle API class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19442
diff changeset
154 System.out.println("compilation failed!?");
18199
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
155 compilationNotify.notifyCompilationFailed(compilable, graph, t);
c5c80abc3fc6 Truffle: add support for a CompilationListener in GraalTruffleRuntime.
Christian Humer <christian.humer@gmail.com>
parents: 17400
diff changeset
156 throw t;
16546
d5e6c3793309 extract method in TruffleCompilerImpl
Christian Wirth <christian.wirth@oracle.com>
parents: 16407
diff changeset
157 }
d5e6c3793309 extract method in TruffleCompilerImpl
Christian Wirth <christian.wirth@oracle.com>
parents: 16407
diff changeset
158 }
13984
1c9dbfc5b510 Truffle: New more reliable inlining strategy for the Truffle runtime.
Christian Humer <christian.humer@gmail.com>
parents: 13915
diff changeset
159
19253
2caf12d746a3 merge fixes
Doug Simon <doug.simon@oracle.com>
parents: 19251
diff changeset
160 public CompilationResult compileMethodHelper(StructuredGraph graph, String name, PhaseSuite<HighTierContext> graphBuilderSuite, SpeculationLog speculationLog, InstalledCode predefinedInstalledCode) {
13197
8569b9e047cd change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents: 12690
diff changeset
161 try (Scope s = Debug.scope("TruffleFinal")) {
17383
ec56aea5c32d dump "After TruffleTier" at log level 1
Lukas Stadler <lukas.stadler@oracle.com>
parents: 17256
diff changeset
162 Debug.dump(1, graph, "After TruffleTier");
13197
8569b9e047cd change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents: 12690
diff changeset
163 } catch (Throwable e) {
8569b9e047cd change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents: 12690
diff changeset
164 throw Debug.handle(e);
8569b9e047cd change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents: 12690
diff changeset
165 }
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
166
13197
8569b9e047cd change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents: 12690
diff changeset
167 CompilationResult result = null;
15963
a62590637801 track memory usage in TruffleCompilerImpl
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15415
diff changeset
168 try (TimerCloseable a = CompilationTime.start(); Scope s = Debug.scope("TruffleGraal.GraalCompiler", graph, providers.getCodeCache()); Closeable c = CompilationMemUse.start()) {
13197
8569b9e047cd change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents: 12690
diff changeset
169 CodeCacheProvider codeCache = providers.getCodeCache();
8569b9e047cd change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents: 12690
diff changeset
170 CallingConvention cc = getCallingConvention(codeCache, Type.JavaCallee, graph.method(), false);
13681
927349daa531 Use a more meaningfull Compilationresult/HotSpotNMethod name in the TruffleCompilerImpl
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13669
diff changeset
171 CompilationResult compilationResult = new CompilationResult(name);
19390
7f4201b633e7 renamed GraphBuilderPlugins to InvocationPlugins and consolidated it into GraphBuilderConfiguration; moved declaration of GraphBuilderPlugin sub-interfaces into GraphBuilderPlugin
Doug Simon <doug.simon@oracle.com>
parents: 19363
diff changeset
172 result = compileGraph(graph, cc, graph.method(), providers, backend, codeCache.getTarget(), null, graphBuilderSuite, Optimizations, getProfilingInfo(graph), speculationLog, suites,
7f4201b633e7 renamed GraphBuilderPlugins to InvocationPlugins and consolidated it into GraphBuilderConfiguration; moved declaration of GraphBuilderPlugin sub-interfaces into GraphBuilderPlugin
Doug Simon <doug.simon@oracle.com>
parents: 19363
diff changeset
173 lirSuites, compilationResult, CompilationResultBuilderFactory.Default);
13197
8569b9e047cd change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents: 12690
diff changeset
174 } catch (Throwable e) {
8569b9e047cd change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents: 12690
diff changeset
175 throw Debug.handle(e);
8569b9e047cd change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents: 12690
diff changeset
176 }
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
177
18209
dc6b023513b8 Truffle: added compilation graal tier finished event to compilation listener.
Christian Humer <christian.humer@gmail.com>
parents: 18208
diff changeset
178 compilationNotify.notifyCompilationGraalTierFinished((OptimizedCallTarget) predefinedInstalledCode, graph);
dc6b023513b8 Truffle: added compilation graal tier finished event to compilation listener.
Christian Humer <christian.humer@gmail.com>
parents: 18208
diff changeset
179
19346
2b392a92e27b made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents: 19306
diff changeset
180 if (graph.isInlinedMethodRecordingEnabled()) {
2b392a92e27b made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents: 19306
diff changeset
181 result.setMethods(graph.method(), graph.getInlinedMethods());
19306
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19276
diff changeset
182 } else {
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19276
diff changeset
183 assert result.getMethods() == null;
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19276
diff changeset
184 }
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19276
diff changeset
185
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
186 List<AssumptionValidAssumption> validAssumptions = new ArrayList<>();
19255
131fb3dd493b removed unnecessary use of an Assumptions object
Doug Simon <doug.simon@oracle.com>
parents: 19253
diff changeset
187 Set<Assumption> newAssumptions = new HashSet<>();
19251
063e8873bd14 changed type of assumptions field in CompilationResult from Assumptions to Assumption[]
Doug Simon <doug.simon@oracle.com>
parents: 19250
diff changeset
188 for (Assumption assumption : graph.getAssumptions()) {
19250
8ab925a6f724 made Assumptions be part of a StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19243
diff changeset
189 processAssumption(newAssumptions, assumption, validAssumptions);
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
190 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
191
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
192 if (result.getAssumptions() != null) {
19251
063e8873bd14 changed type of assumptions field in CompilationResult from Assumptions to Assumption[]
Doug Simon <doug.simon@oracle.com>
parents: 19250
diff changeset
193 for (Assumption assumption : result.getAssumptions()) {
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
194 processAssumption(newAssumptions, assumption, validAssumptions);
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
195 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
196 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
197
19255
131fb3dd493b removed unnecessary use of an Assumptions object
Doug Simon <doug.simon@oracle.com>
parents: 19253
diff changeset
198 result.setAssumptions(newAssumptions.toArray(new Assumption[newAssumptions.size()]));
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
199
14983
a31d807757ee Truffle: made inlining fully context sensitive.
Christian Humer <christian.humer@gmail.com>
parents: 14866
diff changeset
200 InstalledCode installedCode;
15963
a62590637801 track memory usage in TruffleCompilerImpl
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15415
diff changeset
201 try (Scope s = Debug.scope("CodeInstall", providers.getCodeCache()); TimerCloseable a = CodeInstallationTime.start(); Closeable c = CodeInstallationMemUse.start()) {
15162
dbb1fe8348e6 Allow to supply predefined installed code object when adding a method to the code cache.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 15090
diff changeset
202 installedCode = providers.getCodeCache().addMethod(graph.method(), result, speculationLog, predefinedInstalledCode);
13197
8569b9e047cd change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents: 12690
diff changeset
203 } catch (Throwable e) {
8569b9e047cd change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents: 12690
diff changeset
204 throw Debug.handle(e);
8569b9e047cd change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents: 12690
diff changeset
205 }
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
206
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
207 for (AssumptionValidAssumption a : validAssumptions) {
13233
8ea51438445c consolidated logging and dumping of InstalledCode to HotSpotCodeCacheProvider
Doug Simon <doug.simon@oracle.com>
parents: 13229
diff changeset
208 a.getAssumption().registerInstalledCode(installedCode);
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
209 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
210
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
211 if (Debug.isLogEnabled()) {
13233
8ea51438445c consolidated logging and dumping of InstalledCode to HotSpotCodeCacheProvider
Doug Simon <doug.simon@oracle.com>
parents: 13229
diff changeset
212 Debug.log(providers.getCodeCache().disassemble(result, installedCode));
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
213 }
15217
ec7d8b646b9f Truffle: Fixed display of installed code size.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 15210
diff changeset
214 return result;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
215 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
216
19390
7f4201b633e7 renamed GraphBuilderPlugins to InvocationPlugins and consolidated it into GraphBuilderConfiguration; moved declaration of GraphBuilderPlugin sub-interfaces into GraphBuilderPlugin
Doug Simon <doug.simon@oracle.com>
parents: 19363
diff changeset
217 private PhaseSuite<HighTierContext> createGraphBuilderSuite() {
13585
f4f0a8a01ce0 remove PhasePlan
Lukas Stadler <lukas.stadler@jku.at>
parents: 13584
diff changeset
218 PhaseSuite<HighTierContext> suite = backend.getSuites().getDefaultGraphBuilderSuite().copy();
f4f0a8a01ce0 remove PhasePlan
Lukas Stadler <lukas.stadler@jku.at>
parents: 13584
diff changeset
219 ListIterator<BasePhase<? super HighTierContext>> iterator = suite.findPhase(GraphBuilderPhase.class);
f4f0a8a01ce0 remove PhasePlan
Lukas Stadler <lukas.stadler@jku.at>
parents: 13584
diff changeset
220 iterator.remove();
19390
7f4201b633e7 renamed GraphBuilderPlugins to InvocationPlugins and consolidated it into GraphBuilderConfiguration; moved declaration of GraphBuilderPlugin sub-interfaces into GraphBuilderPlugin
Doug Simon <doug.simon@oracle.com>
parents: 19363
diff changeset
221 iterator.add(new GraphBuilderPhase(config));
7f4201b633e7 renamed GraphBuilderPlugins to InvocationPlugins and consolidated it into GraphBuilderConfiguration; moved declaration of GraphBuilderPlugin sub-interfaces into GraphBuilderPlugin
Doug Simon <doug.simon@oracle.com>
parents: 19363
diff changeset
222 return suite;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
223 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
224
19255
131fb3dd493b removed unnecessary use of an Assumptions object
Doug Simon <doug.simon@oracle.com>
parents: 19253
diff changeset
225 public void processAssumption(Set<Assumption> newAssumptions, Assumption assumption, List<AssumptionValidAssumption> manual) {
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
226 if (assumption != null) {
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
227 if (assumption instanceof AssumptionValidAssumption) {
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
228 AssumptionValidAssumption assumptionValidAssumption = (AssumptionValidAssumption) assumption;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
229 manual.add(assumptionValidAssumption);
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
230 } else {
19255
131fb3dd493b removed unnecessary use of an Assumptions object
Doug Simon <doug.simon@oracle.com>
parents: 19253
diff changeset
231 newAssumptions.add(assumption);
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
232 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
233 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
234 }
13789
a98d5959a813 PartialEvaluationTest should use the same GraphBuilderConfiguration as the TruffleCompiler; code cleanup
Andreas Woess <andreas.woess@jku.at>
parents: 13774
diff changeset
235
a98d5959a813 PartialEvaluationTest should use the same GraphBuilderConfiguration as the TruffleCompiler; code cleanup
Andreas Woess <andreas.woess@jku.at>
parents: 13774
diff changeset
236 public PartialEvaluator getPartialEvaluator() {
a98d5959a813 PartialEvaluationTest should use the same GraphBuilderConfiguration as the TruffleCompiler; code cleanup
Andreas Woess <andreas.woess@jku.at>
parents: 13774
diff changeset
237 return partialEvaluator;
a98d5959a813 PartialEvaluationTest should use the same GraphBuilderConfiguration as the TruffleCompiler; code cleanup
Andreas Woess <andreas.woess@jku.at>
parents: 13774
diff changeset
238 }
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
239 }