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

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: 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
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..5f794badff9926c46c33968b94244aee3f05625c 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -48,7 +48,16 @@ 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
floitsch 2015/03/10 17:42:27 missing ".".
herhut 2015/03/11 14:01:56 Done.
+ if (element is ConstructorBodyElement) {
+ ConstructorBodyElement body = element;
+ decision = _cachedDecisions[body.constructor];
+ print("checked for $element as $decision via ${body.constructor}");
floitsch 2015/03/10 17:42:27 remove print.
herhut 2015/03/11 14:01:56 Done.
+ }
+ if (decision == null) {
+ decision = _unknown;
+ }
}
if (insideLoop) {
@@ -2433,7 +2442,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);
}

Powered by Google App Engine
This is Rietveld 408576698