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

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: Update old test with new name. 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/builder.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 e39689912d640397e5d405738780373d805b89af..47226b2402536c47eacfa762b2a4005675d63a70 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -2305,6 +2305,11 @@ class JavaScriptBackend extends Backend {
}
void onElementResolved(Element element, TreeElements elements) {
+ if (element.isFunction && annotations.noInline(element)) {
+ // TODO(floitsch): restrict to test directory?
Johnni Winther 2015/02/16 11:18:05 Move this TODO to the [noInline] method. I think w
floitsch 2015/02/16 11:50:02 Done.
+ inlineCache.markAsNonInlinable(element);
+ }
+
LibraryElement library = element.library;
if (!library.isPlatformLibrary && !library.canUseNative) return;
bool hasNoInline = false;
@@ -2430,20 +2435,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 +2456,8 @@ class Annotations {
}
/// Returns `true` if inlining is disabled for [element].
- bool noInlining(Element element) {
- return _hasAnnotation(element, expectNoInliningClass);
+ bool noInline(Element element) {
+ 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698