Chromium Code Reviews| 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 |