Mercurial > hg > truffle
annotate graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/PhaseContext.java @ 18479:16e61bb57e90
Introduce StampProvider to support different stamps for metadata on different VMs.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Thu, 20 Nov 2014 14:13:38 +0100 |
parents | 438ed35bed29 |
children | 8ab925a6f724 |
rev | line source |
---|---|
9001 | 1 /* |
18479
16e61bb57e90
Introduce StampProvider to support different stamps for metadata on different VMs.
Roland Schatz <roland.schatz@oracle.com>
parents:
13137
diff
changeset
|
2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. |
9001 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
20 * or visit www.oracle.com if you need additional information or have any | |
21 * questions. | |
22 */ | |
23 package com.oracle.graal.phases.tiers; | |
24 | |
25 import com.oracle.graal.api.code.*; | |
26 import com.oracle.graal.api.meta.*; | |
9265
bff0abdbc8b6
Restructure phase context hierarchy.
Roland Schatz <roland.schatz@oracle.com>
parents:
9048
diff
changeset
|
27 import com.oracle.graal.nodes.spi.*; |
12054
bba234a1670e
grouped provider values/parameters into a Providers object (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
12052
diff
changeset
|
28 import com.oracle.graal.phases.util.*; |
9001 | 29 |
13137
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
30 public class PhaseContext { |
12054
bba234a1670e
grouped provider values/parameters into a Providers object (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
12052
diff
changeset
|
31 |
13137
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
32 private final MetaAccessProvider metaAccess; |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
33 private final ConstantReflectionProvider constantReflection; |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
34 private final LoweringProvider lowerer; |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
35 private final Replacements replacements; |
9001 | 36 private final Assumptions assumptions; |
18479
16e61bb57e90
Introduce StampProvider to support different stamps for metadata on different VMs.
Roland Schatz <roland.schatz@oracle.com>
parents:
13137
diff
changeset
|
37 private final StampProvider stampProvider; |
9001 | 38 |
18479
16e61bb57e90
Introduce StampProvider to support different stamps for metadata on different VMs.
Roland Schatz <roland.schatz@oracle.com>
parents:
13137
diff
changeset
|
39 public PhaseContext(MetaAccessProvider metaAccess, ConstantReflectionProvider constantReflection, LoweringProvider lowerer, Replacements replacements, Assumptions assumptions, |
16e61bb57e90
Introduce StampProvider to support different stamps for metadata on different VMs.
Roland Schatz <roland.schatz@oracle.com>
parents:
13137
diff
changeset
|
40 StampProvider stampProvider) { |
13137
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
41 this.metaAccess = metaAccess; |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
42 this.constantReflection = constantReflection; |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
43 this.lowerer = lowerer; |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
44 this.replacements = replacements; |
9001 | 45 this.assumptions = assumptions; |
18479
16e61bb57e90
Introduce StampProvider to support different stamps for metadata on different VMs.
Roland Schatz <roland.schatz@oracle.com>
parents:
13137
diff
changeset
|
46 this.stampProvider = stampProvider; |
9001 | 47 } |
48 | |
13137
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
49 public PhaseContext(Providers providers, Assumptions assumptions) { |
18479
16e61bb57e90
Introduce StampProvider to support different stamps for metadata on different VMs.
Roland Schatz <roland.schatz@oracle.com>
parents:
13137
diff
changeset
|
50 this(providers.getMetaAccess(), providers.getConstantReflection(), providers.getLowerer(), providers.getReplacements(), assumptions, providers.getStampProvider()); |
13137
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
51 } |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
52 |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
53 public MetaAccessProvider getMetaAccess() { |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
54 return metaAccess; |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
55 } |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
56 |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
57 public ConstantReflectionProvider getConstantReflection() { |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
58 return constantReflection; |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
59 } |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
60 |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
61 public LoweringProvider getLowerer() { |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
62 return lowerer; |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
63 } |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
64 |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
65 public Replacements getReplacements() { |
438ed35bed29
Change PhaseContext so that it does not subclass Providers, to avoid leaking low-level provider objects such as the CodeCacheProvdier to high-level optimization phases
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12362
diff
changeset
|
66 return replacements; |
12045
0fc653a9e019
made GraalCodeCacheProvider independent of CodeCacheProvider and renamed the former to LoweringProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
11959
diff
changeset
|
67 } |
0fc653a9e019
made GraalCodeCacheProvider independent of CodeCacheProvider and renamed the former to LoweringProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
11959
diff
changeset
|
68 |
9001 | 69 public Assumptions getAssumptions() { |
70 return assumptions; | |
71 } | |
18479
16e61bb57e90
Introduce StampProvider to support different stamps for metadata on different VMs.
Roland Schatz <roland.schatz@oracle.com>
parents:
13137
diff
changeset
|
72 |
16e61bb57e90
Introduce StampProvider to support different stamps for metadata on different VMs.
Roland Schatz <roland.schatz@oracle.com>
parents:
13137
diff
changeset
|
73 public StampProvider getStampProvider() { |
16e61bb57e90
Introduce StampProvider to support different stamps for metadata on different VMs.
Roland Schatz <roland.schatz@oracle.com>
parents:
13137
diff
changeset
|
74 return stampProvider; |
16e61bb57e90
Introduce StampProvider to support different stamps for metadata on different VMs.
Roland Schatz <roland.schatz@oracle.com>
parents:
13137
diff
changeset
|
75 } |
9001 | 76 } |