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

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 f68611b6480cfe952ffb9a04a2307b31e60cede1..5bdae808e9809731f0b98511782967c4a0bc0232 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
@@ -1715,7 +1715,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 {
@@ -1823,15 +1826,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) {
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/builder.dart ('k') | sdk/lib/_internal/compiler/implementation/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698