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

Unified Diff: runtime/vm/object.cc

Issue 12263017: Add flag to block optimizations of large implicit getters. Implicit getters have a 0 size in tokens… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « runtime/vm/compiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 18461)
+++ runtime/vm/object.cc (working copy)
@@ -42,8 +42,10 @@
"instead of showing the corresponding interface names (e.g. \"String\")");
DEFINE_FLAG(bool, trace_disabling_optimized_code, false,
"Trace disabling optimized code.");
-DEFINE_FLAG(int, huge_method_cutoff, 20000,
- "Huge method cutoff: Disables optimizations for huge methods.");
+DEFINE_FLAG(int, huge_method_cutoff_in_tokens, 20000,
+ "Huge method cutoff in tokens: Disables optimizations for huge methods.");
+DEFINE_FLAG(int, huge_method_cutoff_in_code_size, 200000,
+ "Huge method cutoff in unoptimized code size: disables optimization.");
siva 2013/02/13 21:31:17 I think the code cut of size should be in words so
srdjan 2013/02/13 21:37:10 Done.
DECLARE_FLAG(bool, trace_compiler);
DECLARE_FLAG(bool, eliminate_type_checks);
DECLARE_FLAG(bool, enable_type_checks);
@@ -3664,10 +3666,20 @@
bool Function::is_optimizable() const {
- return OptimizableBit::decode(raw_ptr()->kind_tag_) &&
- (script() != Script::null()) &&
- !is_native() &&
- ((end_token_pos() - token_pos()) < FLAG_huge_method_cutoff);
+ if (OptimizableBit::decode(raw_ptr()->kind_tag_) &&
+ (script() != Script::null()) &&
+ !is_native() &&
+ ((end_token_pos() - token_pos()) < FLAG_huge_method_cutoff_in_tokens)) {
+ // Additional check needed for implicit getters.
+ if (HasCode() &&
+ (Code::Handle(unoptimized_code()).Size() >=
+ FLAG_huge_method_cutoff_in_code_size)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ return false;
}
« no previous file with comments | « runtime/vm/compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698