Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(868)

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/builder.dart

Issue 221873002: Compute frontend/backend specific constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/ssa/builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index 7ee27ee56b56183a0e46fb890bbb59897ebe116f..3f5f3455a7b38c0f44400ad30211650fa7fcf2b8 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -63,10 +63,9 @@ class SsaBuilderTask extends CompilerTask {
signature.forEachOptionalParameter((Element parameter) {
// This ensures the default value will be computed.
Constant constant =
- compiler.constantHandler.getConstantForVariable(parameter);
+ backend.constants.getConstantForVariable(parameter);
backend.registerCompileTimeConstant(constant, work.resolutionTree);
- compiler.constantHandler.addCompileTimeConstantForEmission(
- constant);
+ backend.constants.addCompileTimeConstantForEmission(constant);
});
}
if (compiler.tracer.enabled) {
@@ -1310,7 +1309,7 @@ class SsaBuilder extends ResolvedVisitor {
HInstruction handleConstantForOptionalParameter(Element parameter) {
Constant constant =
- compiler.constantHandler.getConstantForVariable(parameter);
+ backend.constants.getConstantForVariable(parameter);
assert(invariant(parameter, constant != null,
message: 'No constant computed for $parameter'));
return graph.addConstant(constant, compiler);
@@ -1349,7 +1348,8 @@ class SsaBuilder extends ResolvedVisitor {
bool inTryStatement = false;
Constant getConstantForNode(ast.Node node) {
- Constant constant = elements.getConstant(node);
+ Constant constant =
+ backend.constants.getConstantForNode(node, elements);
assert(invariant(node, constant != null,
message: 'No constant computed for $node'));
return constant;
@@ -1361,7 +1361,7 @@ class SsaBuilder extends ResolvedVisitor {
bool isLazilyInitialized(VariableElement element) {
Constant initialValue =
- compiler.constantHandler.getConstantForVariable(element);
+ backend.constants.getConstantForVariable(element);
return initialValue == null;
}
@@ -2937,7 +2937,7 @@ class SsaBuilder extends ResolvedVisitor {
if (element.isField() && !element.isAssignable()) {
// A static final or const. Get its constant value and inline it if
// the value can be compiled eagerly.
- value = compiler.constantHandler.getConstantForVariable(element);
+ value = backend.constants.getConstantForVariable(element);
}
if (value != null) {
HConstant instruction = graph.addConstant(value, compiler);
@@ -4341,7 +4341,7 @@ class SsaBuilder extends ResolvedVisitor {
} else if (node.isConst()) {
stack.add(addConstant(node));
if (isSymbolConstructor) {
- ConstructedConstant symbol = elements.getConstant(node);
+ ConstructedConstant symbol = getConstantForNode(node);
StringConstant stringConstant = symbol.fields.single;
String nameString = stringConstant.toDartString().slowToString();
compiler.enqueuer.codegen.registerConstSymbol(nameString, elements);

Powered by Google App Engine
This is Rietveld 408576698