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

Unified Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 987393002: Support @NoInline for constructor bodies. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comments Created 5 years, 9 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/elements/modelx.dart ('k') | tests/compiler/dart2js/expect_annotations2_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/backend.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index 1ed077da32f754dbdefa76b2a66c7b3bbd76fb52..08fa0a74db29be482239a6f7e62b6111c4bfc36d 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -48,7 +48,15 @@ class FunctionInlineCache {
int decision = _cachedDecisions[element];
if (decision == null) {
- decision = _unknown;
+ // These synthetic elements are not yet present when we initially compute
+ // this cache from metadata annotations, so look for their parent.
+ if (element is ConstructorBodyElement) {
+ ConstructorBodyElement body = element;
+ decision = _cachedDecisions[body.constructor];
+ }
+ if (decision == null) {
+ decision = _unknown;
+ }
}
if (insideLoop) {
@@ -2433,7 +2441,8 @@ class JavaScriptBackend extends Backend {
}
void onElementResolved(Element element, TreeElements elements) {
- if (element.isFunction && annotations.noInline(element)) {
+ if ((element.isFunction || element.isGenerativeConstructor) &&
+ annotations.noInline(element)) {
inlineCache.markAsNonInlinable(element);
}
« no previous file with comments | « pkg/compiler/lib/src/elements/modelx.dart ('k') | tests/compiler/dart2js/expect_annotations2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698