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

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

Issue 24282005: Move compile-time constant registrations to the backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status Created 7 years, 3 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/codegen.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
index d070e6e5190c33b80a89616a3484b06b4668c014..cd8459bf4ee60f081d7f593247af762788b92185 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
@@ -1710,7 +1710,10 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
// constant value instead.
Element element = compiler.findRequiredElement(
compiler.typedDataLibrary, const SourceString('fetchLength'));
- Constant constant = compiler.constantHandler.compileConstant(element);
+ Constant constant =
+ compiler.constantHandler.getConstantForVariable(element);
+ assert(invariant(element, constant != null,
+ message: 'No constant computed for $element'));
var jsConstant = backend.emitter.constantReference(constant);
push(new js.Call(jsConstant, [pop()]), node);
} else {
@@ -1818,15 +1821,9 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
visitConstant(HConstant node) {
assert(isGenerateAtUseSite(node));
generateConstant(node.constant);
- DartType type = node.constant.computeType(compiler);
- if (node.constant is ConstructedConstant ||
- node.constant is InterceptorConstant) {
- ConstantHandler handler = compiler.constantHandler;
- handler.registerCompileTimeConstant(node.constant, work.resolutionTree);
- }
- if (node.constant is! InterceptorConstant) {
- world.registerInstantiatedClass(type.element, work.resolutionTree);
- }
+
+ backend.registerCompileTimeConstant(node.constant, work.resolutionTree);
+ compiler.constantHandler.addCompileTimeConstantForEmission(node.constant);
}
visitNot(HNot node) {

Powered by Google App Engine
This is Rietveld 408576698