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

Unified Diff: lib/src/compiler/code_generator.dart

Issue 2032903003: Switch how we track whether trackDdcProfile is set to reduce the performance impact. sra was seeing… (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 7 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 | « lib/runtime/dart_sdk.js ('k') | tool/input_sdk/private/ddc_runtime/operations.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/compiler/code_generator.dart
diff --git a/lib/src/compiler/code_generator.dart b/lib/src/compiler/code_generator.dart
index faa263a9bde4897cb9ed56a2189a24c93d7697d1..d9c127178cbf837ce80dbeb56ab95f998d8c178a 100644
--- a/lib/src/compiler/code_generator.dart
+++ b/lib/src/compiler/code_generator.dart
@@ -2709,7 +2709,7 @@ class CodeGenerator extends GeneralizingAstVisitor
return js.call('dart.dgcall(#, #, #)',
[fn, new JS.ArrayInitializer(typeArgs), args]);
} else {
- if (_inWhitelistCode(node)) {
+ if (_inWhitelistCode(node, isCall: true)) {
return new JS.Call(fn, args);
}
return js.call('dart.dcall(#, #)', [fn, args]);
@@ -4639,9 +4639,22 @@ class CodeGenerator extends GeneralizingAstVisitor
/// within the file.
///
/// If the value is null, the entire file is whitelisted.
- static Map<String, List<String>> _uncheckedWhitelist = {};
-
- bool _inWhitelistCode(AstNode node) {
+ static Map<String, List<String>> _uncheckedWhitelist = {
+ 'dom_renderer.dart': ['moveNodesAfterSibling',],
+ 'template_ref.dart': ['createEmbeddedView'],
+ 'ng_class.dart': ['_applyIterableChanges'],
+ 'ng_for.dart': ['_bulkRemove', '_bulkInsert'],
+ 'view_container_ref.dart': ['createEmbeddedView'],
+ 'default_iterable_differ.dart': null,
+ };
+
+ static Set<String> _uncheckedWhitelistCalls = new Set()
+ ..add('ng_zone_impl.dart')
+ ..add('stack_zone_specification.dart')
+ ..add('view_manager.dart')
+ ..add('view.dart');
+
+ bool _inWhitelistCode(AstNode node, {isCall: false}) {
if (!options.useAngular2Whitelist) return false;
var path = _loader.currentElement.source.fullName;
var filename = path.split("/").last;
@@ -4658,6 +4671,11 @@ class CodeGenerator extends GeneralizingAstVisitor
return whitelisted.contains(name);
}
}
+
+ // Dynamic calls are less risky so there is no need to whitelist at the
+ // method level.
+ if (isCall && _uncheckedWhitelistCalls.contains(filename)) return true;
+
return path.endsWith(".template.dart");
}
}
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | tool/input_sdk/private/ddc_runtime/operations.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698