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

Side by Side Diff: lib/compiler/implementation/dart_backend/placeholder_collector.dart

Issue 10947024: Made dart2js constructor lookup logic "private"-aware, fixed 4740 bug. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Another try in implementing constructor lookup, without SelectorName this time. Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class LocalPlaceholder implements Hashable { 5 class LocalPlaceholder implements Hashable {
6 final String identifier; 6 final String identifier;
7 final Set<Node> nodes; 7 final Set<Node> nodes;
8 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); 8 LocalPlaceholder(this.identifier) : nodes = new Set<Node>();
9 int hashCode() => identifier.hashCode(); 9 int hashCode() => identifier.hashCode();
10 String toString() => 10 String toString() =>
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 if (node.typeName is Send) { 439 if (node.typeName is Send) {
440 final element = treeElements[node]; 440 final element = treeElements[node];
441 if (element !== null) { 441 if (element !== null) {
442 final send = node.typeName.asSend(); 442 final send = node.typeName.asSend();
443 Identifier receiver = send.receiver; 443 Identifier receiver = send.receiver;
444 Identifier selector = send.selector; 444 Identifier selector = send.selector;
445 hasPrefix() { 445 hasPrefix() {
446 if (element is TypedefElement) return true; 446 if (element is TypedefElement) return true;
447 ClassElement classElement = element; 447 ClassElement classElement = element;
448 final constructor = classElement.lookupConstructor( 448 final constructor = classElement.lookupConstructor(
449 receiver.source, selector.source); 449 new Selector.callConstructor(receiver.source, // class name
kasperl 2012/09/24 05:52:38 Maybe add two local variables (className and const
ahe 2012/09/24 06:43:31 This code does not belong in the dart_backend to b
aam-me 2012/09/25 04:15:18 Okay, I removed this file from the changelist.
450 selector.source, // constructor name
451 currentElement.getLibrary()));
450 return constructor === null; 452 return constructor === null;
451 } 453 }
452 if (!hasPrefix()) target = send.receiver; 454 if (!hasPrefix()) target = send.receiver;
453 } 455 }
454 } 456 }
455 // TODO(antonm): is there a better way to detect unresolved types? 457 // TODO(antonm): is there a better way to detect unresolved types?
456 if (type.element !== compiler.types.dynamicType.element) { 458 if (type.element !== compiler.types.dynamicType.element) {
457 makeTypePlaceholder(target, type); 459 makeTypePlaceholder(target, type);
458 } else { 460 } else {
459 if (!isDynamicType(node)) makeUnresolvedPlaceholder(target); 461 if (!isDynamicType(node)) makeUnresolvedPlaceholder(target);
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 596
595 visitBlock(Block node) { 597 visitBlock(Block node) {
596 for (Node statement in node.statements.nodes) { 598 for (Node statement in node.statements.nodes) {
597 if (statement is VariableDefinitions) { 599 if (statement is VariableDefinitions) {
598 makeVarDeclarationTypePlaceholder(statement); 600 makeVarDeclarationTypePlaceholder(statement);
599 } 601 }
600 } 602 }
601 node.visitChildren(this); 603 node.visitChildren(this);
602 } 604 }
603 } 605 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698