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

Unified Diff: sdk/lib/_internal/compiler/implementation/native_handler.dart

Issue 12095011: Properly register types on the JS foreign instruction. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/native_handler.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/native_handler.dart (revision 18037)
+++ sdk/lib/_internal/compiler/implementation/native_handler.dart (working copy)
@@ -91,6 +91,9 @@
final queue = new Queue();
bool flushing = false;
+ /// Maps JS foreign calls to their computed native behavior.
+ final Map<Node, NativeBehavior> nativeBehaviors =
+ new Map<Node, NativeBehavior>();
final Enqueuer world;
final Compiler compiler;
@@ -302,12 +305,14 @@
}
void registerJsCall(Send node, ResolverVisitor resolver) {
- processNativeBehavior(
- NativeBehavior.ofJsCall(node, compiler, resolver),
- node);
+ NativeBehavior behavior = NativeBehavior.ofJsCall(node, compiler, resolver);
+ processNativeBehavior(behavior, node);
+ nativeBehaviors[node] = behavior;
flushQueue();
}
+ NativeBehavior getNativeBehaviorOf(Send node) => nativeBehaviors[node];
+
processNativeBehavior(NativeBehavior behavior, cause) {
bool allUsedBefore = unusedClasses.isEmpty;
for (var type in behavior.typesInstantiated) {
@@ -881,8 +886,7 @@
}
DartString jsCode = new DartString.literal(nativeMethodCall);
- builder.push(
- new HForeign(jsCode, const LiteralDartString('Object'), inputs));
+ builder.push(new HForeign(jsCode, HType.UNKNOWN, inputs));
builder.close(new HReturn(builder.pop())).addSuccessor(builder.graph.exit);
} else {
if (parameters.parameterCount != 0) {
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698