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

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, 11 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/native_handler.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/native_handler.dart (revision 17700)
+++ sdk/lib/_internal/compiler/implementation/native_handler.dart (working copy)
@@ -539,13 +539,22 @@
return behavior;
}
var behavior = new NativeBehavior();
+ LinkBuilder<Element> types = new LinkBuilder<Element>();
ahe 2013/01/28 15:14:31 This looks like a list of "elements", not "types".
for (final typeString in specString.split('|')) {
var type = _parseType(typeString, compiler,
(name) => resolver.resolveTypeFromString(name),
jsCall);
behavior.typesInstantiated.add(type);
behavior.typesReturned.add(type);
+ if (type == SpecialType.JsObject) {
+ types.addLast(compiler.objectClass);
+ } else if (type == SpecialType.JsArray) {
+ types.addLast(compiler.backend.listImplementation);
+ } else {
+ types.addLast(type.element);
+ }
}
+ compiler.typesTask.typedNodes[jsCall] = types.toLink();
ahe 2013/01/28 15:14:31 Please abstract this operation.
sra1 2013/01/28 20:12:20 Move the assignment out to the call site of ofJsCa
return behavior;
}
@@ -880,8 +889,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) {

Powered by Google App Engine
This is Rietveld 408576698