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

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: Address comments 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
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index a4d70faf9b5a513af6b9a315108e3234a4cefd57..7f54b49b44c705d0766f1e67d971d01a93d9a8fb 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,6 +2889,19 @@ 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(),
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698