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

Unified Diff: sdk/lib/_internal/js_runtime/lib/js_rti.dart

Issue 1345413002: dart2js ssa: Inlining heuristics ignore assert() statement size. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 | « pkg/compiler/lib/src/ssa/builder.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/js_runtime/lib/js_rti.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/js_rti.dart b/sdk/lib/_internal/js_runtime/lib/js_rti.dart
index e5669e2a6babfca6dfcb3b2d8269714294549f74..c8a8308373a96795725dc4e865590ffbf6b95611 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_rti.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_rti.dart
@@ -85,9 +85,17 @@ getMangledTypeName(TypeImpl type) => type._typeName;
* representation of type 4 or 5, that is, either a JavaScript array or
* `null`.
*/
+// Don't inline. Let the JS engine inline this. The call expression is much
+// more compact that the inlined expansion.
+// TODO(sra): For most objects it would be better to initialize the type info as
+// a field in the constructor: http://dartbug.com/22676 .
+@NoInline()
Object setRuntimeTypeInfo(Object target, var rti) {
assert(rti == null || isJsArray(rti));
// We have to check for null because factories may return null.
+ // TODO(sra): How is this true? The factory should be executing some code that
+ // creates an object that already has the correct info. There should not be a
+ // second setRuntimeTypeInfo on the possibly null value.
if (target != null) JS('var', r'#.$builtinTypeInfo = #', target, rti);
return target;
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698