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

Unified Diff: lib/compiler/implementation/lib/js_helper.dart

Issue 10888003: Change how runtime type information is being set in the backend. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/lib/js_helper.dart
===================================================================
--- lib/compiler/implementation/lib/js_helper.dart (revision 11430)
+++ lib/compiler/implementation/lib/js_helper.dart (working copy)
@@ -960,7 +960,12 @@
getRuntimeTypeInfo(target) {
if (target === null) return null;
- return JS('var', @'#.builtin$typeInfo', target);
+ var res = JS('var', @'#.builtin$typeInfo', target);
+ // If the object does not have runtime type information, return an
+ // empty literal, to avoid null checks.
+ // TODO(ngeoffray): Make the object a top-level field to avoid
+ // allocating a new object every single time.
+ return (res == null) ? JS('var', '{}') : res;
}
/**
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698