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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/types.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/types.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/types.dart b/sdk/lib/_internal/compiler/implementation/ssa/types.dart
index 8b55c23c2bb209d0c75d6c55ca09d3bb9f415f02..2e273299690f822725d26bff6d852e2108fc7cdb 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/types.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/types.dart
@@ -29,7 +29,7 @@ abstract class HType {
JavaScriptBackend backend = compiler.backend;
if (element == compiler.intClass || element == backend.jsIntClass) {
return canBeNull ? HType.INTEGER_OR_NULL : HType.INTEGER;
- } else if (element == compiler.numClass
+ } else if (element == compiler.numClass
|| element == backend.jsNumberClass) {
return canBeNull ? HType.NUMBER_OR_NULL : HType.NUMBER;
} else if (element == compiler.doubleClass
@@ -169,27 +169,23 @@ abstract class HType {
/** Alias for isReadableArray. */
bool isArray() => isReadableArray();
- Element lookupSingleTarget(Selector selector, Compiler compiler) {
- if (isInterfaceType()) return null;
- DartType type = computeType(compiler);
- if (type == null) return null;
- ClassElement cls = type.element;
- Element member = cls.lookupSelector(selector);
- if (member == null) return null;
- // [:ClassElement.lookupSelector:] may return an abstract field,
- // and selctors don't work well with them.
- // TODO(ngeoffray): Clean up lookupSelector and selectors to know
- // if it's a getter or a setter that we're interested in.
- if (!member.isFunction()) return null;
- if (!selector.applies(member, compiler)) return null;
- if (!isExact() && !compiler.world.hasNoOverridingMember(member)) {
- return null;
+ DartType computeType(Compiler compiler);
+
+ Selector refine(Selector selector, Compiler compiler) {
+ DartType receiverType = computeType(compiler);
+ if (receiverType != null && !receiverType.isMalformed) {
+ if (isExact()) {
+ return new TypedSelector.exact(receiverType, selector);
+ } else if (isInterfaceType()) {
+ return new TypedSelector.subtype(receiverType, selector);
+ } else {
+ return new TypedSelector.subclass(receiverType, selector);
+ }
+ } else {
+ return selector;
}
- return member;
}
- DartType computeType(Compiler compiler);
-
/**
* The intersection of two types is the intersection of its values. For
* example:
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/optimize.dart ('k') | sdk/lib/_internal/compiler/implementation/world.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698