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

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

Issue 912223003: Support @NoInlining in the ssa-builder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: move TODO Created 5 years, 10 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 e39689912d640397e5d405738780373d805b89af..86782d896dae95857ba0f9f49901d7351ca70d14 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -2305,6 +2305,10 @@ class JavaScriptBackend extends Backend {
}
void onElementResolved(Element element, TreeElements elements) {
+ if (element.isFunction && annotations.noInline(element)) {
+ inlineCache.markAsNonInlinable(element);
+ }
+
LibraryElement library = element.library;
if (!library.isPlatformLibrary && !library.canUseNative) return;
bool hasNoInline = false;
@@ -2430,20 +2434,20 @@ class Annotations {
static final Uri PACKAGE_EXPECT =
new Uri(scheme: 'package', path: 'expect/expect.dart');
- ClassElement expectNoInliningClass;
+ ClassElement expectNoInlineClass;
ClassElement expectTrustTypeAnnotationsClass;
ClassElement expectAssumeDynamicClass;
void onLibraryScanned(LibraryElement library) {
if (library.canonicalUri == PACKAGE_EXPECT) {
- expectNoInliningClass = library.find('NoInlining');
+ expectNoInlineClass = library.find('NoInline');
expectTrustTypeAnnotationsClass = library.find('TrustTypeAnnotations');
expectAssumeDynamicClass = library.find('AssumeDynamic');
- if (expectNoInliningClass == null ||
+ if (expectNoInlineClass == null ||
expectTrustTypeAnnotationsClass == null ||
expectAssumeDynamicClass == null) {
// This is not the package you're looking for.
- expectNoInliningClass = null;
+ expectNoInlineClass = null;
expectTrustTypeAnnotationsClass = null;
expectAssumeDynamicClass = null;
}
@@ -2451,8 +2455,9 @@ class Annotations {
}
/// Returns `true` if inlining is disabled for [element].
- bool noInlining(Element element) {
- return _hasAnnotation(element, expectNoInliningClass);
+ bool noInline(Element element) {
+ // TODO(floitsch): restrict to test directory.
+ return _hasAnnotation(element, expectNoInlineClass);
}
/// Returns `true` if parameter and returns types should be trusted for
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/builder.dart » ('j') | tests/compiler/dart2js/expect_annotations2_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698