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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 735543003: Range feedback for binary integer operations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index a4d70faf9b5a513af6b9a315108e3234a4cefd57..afc5391dee3a08ef196808d8a90885897c4ba859 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -31,6 +31,9 @@ DEFINE_FLAG(bool, propagate_ic_data, true,
"Propagate IC data from unoptimized to optimized IC calls.");
DEFINE_FLAG(bool, two_args_smi_icd, true,
"Generate special IC stubs for two args Smi operations");
+DEFINE_FLAG(bool, ic_range_profiling, true,
+ "Generate special IC stubs collecting range information "
+ "for binary and unary arithmetic operations");
DEFINE_FLAG(bool, unbox_numeric_fields, true,
"Support unboxed double and float32x4 fields.");
DECLARE_FLAG(bool, enable_type_checks);
@@ -2886,12 +2889,25 @@ void InstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ExternalLabel target_label(label_address);
compiler->EmitInstanceCall(&target_label, *call_ic_data, ArgumentCount(),
deopt_id(), token_pos(), locs());
+ } else if (FLAG_ic_range_profiling &&
+ (Token::IsBinaryArithmeticOperator(token_kind()) ||
+ Token::IsUnaryArithmeticOperator(token_kind()))) {
+ ASSERT(Token::IsUnaryArithmeticOperator(token_kind()) ==
+ (ArgumentCount() == 1));
+ ASSERT(Token::IsBinaryArithmeticOperator(token_kind()) ==
+ (ArgumentCount() == 2));
+ StubCode* stub_code = isolate->stub_code();
+ ExternalLabel target_label((ArgumentCount() == 1) ?
+ stub_code->UnaryRangeCollectingInlineCacheEntryPoint() :
+ stub_code->BinaryRangeCollectingInlineCacheEntryPoint());
+ compiler->EmitInstanceCall(&target_label, *call_ic_data, ArgumentCount(),
+ deopt_id(), token_pos(), locs());
} else {
- compiler->GenerateInstanceCall(deopt_id(),
- token_pos(),
- ArgumentCount(),
- locs(),
- *call_ic_data);
+ compiler->GenerateInstanceCall(deopt_id(),
zra 2014/12/15 16:01:40 indentation
Vyacheslav Egorov (Google) 2014/12/15 17:20:05 Done.
+ token_pos(),
+ ArgumentCount(),
+ locs(),
+ *call_ic_data);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698