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

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

Issue 12299006: Start tracking all registered elements in one big full function set (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Register fields. Created 7 years, 10 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/optimize.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
index 1b2ae0535c5a472d0a36a866bc13b7bf0da1ee50..2053bb2875b24bbfa5ddc252ae4b416428e6211b 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
@@ -389,7 +389,8 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase {
HInstruction visitInvokeDynamicMethod(HInvokeDynamicMethod node) {
if (node.isInterceptorCall) return handleInterceptorCall(node);
HType receiverType = types[node.receiver];
- Element element = receiverType.lookupSingleTarget(node.selector, compiler);
+ Selector selector = receiverType.refine(node.selector, compiler);
+ Element element = compiler.world.locateSingleElement(selector);
// TODO(ngeoffray): Also fold if it's a getter or variable.
if (element != null && element.isFunction()) {
FunctionElement method = element;
@@ -599,11 +600,8 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase {
Element findConcreteFieldForDynamicAccess(HInstruction receiver,
Selector selector) {
HType receiverType = types[receiver];
- if (!receiverType.isUseful()) return null;
- DartType type = receiverType.computeType(compiler);
- if (type == null) return null;
- if (Elements.isErroneousElement(type.element)) return null;
- return compiler.world.locateSingleField(type, selector);
+ return compiler.world.locateSingleField(
+ receiverType.refine(selector, compiler));
}
HInstruction visitFieldGet(HFieldGet node) {
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/codegen.dart ('k') | sdk/lib/_internal/compiler/implementation/ssa/types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698