43 public class Providers extends CoreProvidersImpl implements CodeGenProviders { |
44 public class Providers extends CoreProvidersImpl implements CodeGenProviders { |
44 |
45 |
45 private final CodeCacheProvider codeCache; |
46 private final CodeCacheProvider codeCache; |
46 |
47 |
47 public Providers(MetaAccessProvider metaAccess, CodeCacheProvider codeCache, ConstantReflectionProvider constantReflection, ConstantFieldProvider constantFieldProvider, |
48 public Providers(MetaAccessProvider metaAccess, CodeCacheProvider codeCache, ConstantReflectionProvider constantReflection, ConstantFieldProvider constantFieldProvider, |
48 ForeignCallsProvider foreignCalls, LoweringProvider lowerer, Replacements replacements, StampProvider stampProvider) { |
49 ForeignCallsProvider foreignCalls, LoweringProvider lowerer, Replacements replacements, StampProvider stampProvider, GCProvider gc) { |
49 super(metaAccess, constantReflection, constantFieldProvider, lowerer, replacements, stampProvider, foreignCalls); |
50 super(metaAccess, constantReflection, constantFieldProvider, lowerer, replacements, stampProvider, foreignCalls, gc); |
50 this.codeCache = codeCache; |
51 this.codeCache = codeCache; |
51 } |
52 } |
52 |
53 |
53 public Providers(Providers copyFrom) { |
54 public Providers(Providers copyFrom) { |
54 this(copyFrom.getMetaAccess(), copyFrom.getCodeCache(), copyFrom.getConstantReflection(), copyFrom.getConstantFieldProvider(), copyFrom.getForeignCalls(), copyFrom.getLowerer(), |
55 this(copyFrom.getMetaAccess(), copyFrom.getCodeCache(), copyFrom.getConstantReflection(), copyFrom.getConstantFieldProvider(), copyFrom.getForeignCalls(), copyFrom.getLowerer(), |
55 copyFrom.getReplacements(), copyFrom.getStampProvider()); |
56 copyFrom.getReplacements(), copyFrom.getStampProvider(), copyFrom.getGC()); |
56 } |
57 } |
57 |
58 |
58 public Providers(PhaseContext copyFrom) { |
59 public Providers(CoreProviders copyFrom) { |
59 this(copyFrom.getMetaAccess(), null, copyFrom.getConstantReflection(), copyFrom.getConstantFieldProvider(), null, copyFrom.getLowerer(), copyFrom.getReplacements(), |
60 this(copyFrom.getMetaAccess(), null, copyFrom.getConstantReflection(), copyFrom.getConstantFieldProvider(), null, copyFrom.getLowerer(), copyFrom.getReplacements(), |
60 copyFrom.getStampProvider()); |
61 copyFrom.getStampProvider(), copyFrom.getGC()); |
61 } |
62 } |
62 |
63 |
63 @Override |
64 @Override |
64 public CodeCacheProvider getCodeCache() { |
65 public CodeCacheProvider getCodeCache() { |
65 return codeCache; |
66 return codeCache; |
66 } |
67 } |
67 |
68 |
68 public Providers copyWith(MetaAccessProvider substitution) { |
69 public Providers copyWith(MetaAccessProvider substitution) { |
69 assert this.getClass() == Providers.class : "must override"; |
70 assert this.getClass() == Providers.class : "must override"; |
70 return new Providers(substitution, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, stampProvider); |
71 return new Providers(substitution, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, stampProvider, gc); |
71 } |
72 } |
72 |
73 |
73 public Providers copyWith(CodeCacheProvider substitution) { |
74 public Providers copyWith(CodeCacheProvider substitution) { |
74 assert this.getClass() == Providers.class : "must override"; |
75 assert this.getClass() == Providers.class : "must override"; |
75 return new Providers(metaAccess, substitution, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, stampProvider); |
76 return new Providers(metaAccess, substitution, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, stampProvider, gc); |
76 } |
77 } |
77 |
78 |
78 public Providers copyWith(ConstantReflectionProvider substitution) { |
79 public Providers copyWith(ConstantReflectionProvider substitution) { |
79 assert this.getClass() == Providers.class : "must override"; |
80 assert this.getClass() == Providers.class : "must override"; |
80 return new Providers(metaAccess, codeCache, substitution, constantFieldProvider, foreignCalls, lowerer, replacements, stampProvider); |
81 return new Providers(metaAccess, codeCache, substitution, constantFieldProvider, foreignCalls, lowerer, replacements, stampProvider, gc); |
81 } |
82 } |
82 |
83 |
83 public Providers copyWith(ConstantFieldProvider substitution) { |
84 public Providers copyWith(ConstantFieldProvider substitution) { |
84 assert this.getClass() == Providers.class : "must override"; |
85 assert this.getClass() == Providers.class : "must override"; |
85 return new Providers(metaAccess, codeCache, constantReflection, substitution, foreignCalls, lowerer, replacements, stampProvider); |
86 return new Providers(metaAccess, codeCache, constantReflection, substitution, foreignCalls, lowerer, replacements, stampProvider, gc); |
86 } |
87 } |
87 |
88 |
88 public Providers copyWith(ForeignCallsProvider substitution) { |
89 public Providers copyWith(ForeignCallsProvider substitution) { |
89 assert this.getClass() == Providers.class : "must override"; |
90 assert this.getClass() == Providers.class : "must override"; |
90 return new Providers(metaAccess, codeCache, constantReflection, constantFieldProvider, substitution, lowerer, replacements, stampProvider); |
91 return new Providers(metaAccess, codeCache, constantReflection, constantFieldProvider, substitution, lowerer, replacements, stampProvider, gc); |
91 } |
92 } |
92 |
93 |
93 public Providers copyWith(LoweringProvider substitution) { |
94 public Providers copyWith(LoweringProvider substitution) { |
94 assert this.getClass() == Providers.class : "must override"; |
95 assert this.getClass() == Providers.class : "must override"; |
95 return new Providers(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, substitution, replacements, stampProvider); |
96 return new Providers(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, substitution, replacements, stampProvider, gc); |
96 } |
97 } |
97 |
98 |
98 public Providers copyWith(Replacements substitution) { |
99 public Providers copyWith(Replacements substitution) { |
99 assert this.getClass() == Providers.class : "must override in " + getClass(); |
100 assert this.getClass() == Providers.class : "must override in " + getClass(); |
100 return new Providers(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, substitution, stampProvider); |
101 return new Providers(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, substitution, stampProvider, gc); |
101 } |
102 } |
102 |
103 |
103 public Providers copyWith(StampProvider substitution) { |
104 public Providers copyWith(StampProvider substitution) { |
104 assert this.getClass() == Providers.class : "must override"; |
105 assert this.getClass() == Providers.class : "must override"; |
105 return new Providers(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, substitution); |
106 return new Providers(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, substitution, gc); |
|
107 } |
|
108 |
|
109 public Providers copyWith(GCProvider substitution) { |
|
110 assert this.getClass() == Providers.class : "must override"; |
|
111 return new Providers(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, stampProvider, substitution); |
106 } |
112 } |
107 } |
113 } |