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

Unified Diff: runtime/vm/stub_code_x64.cc

Issue 385563004: Uses a conditional move for usage counter increment instead of a branch (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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
« runtime/vm/stub_code_ia32.cc ('K') | « runtime/vm/stub_code_mips.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64.cc
===================================================================
--- runtime/vm/stub_code_x64.cc (revision 38122)
+++ runtime/vm/stub_code_x64.cc (working copy)
@@ -1370,11 +1370,14 @@
const intptr_t target_offset = ICData::TargetIndexFor(num_args) * kWordSize;
const intptr_t count_offset = ICData::CountIndexFor(num_args) * kWordSize;
__ movq(RAX, Address(R12, target_offset));
- __ addq(Address(R12, count_offset), Immediate(Smi::RawValue(1)));
- __ j(NO_OVERFLOW, &call_target_function, Assembler::kNearJump);
- __ movq(Address(R12, count_offset),
- Immediate(Smi::RawValue(Smi::kMaxValue)));
+ // Update counter.
+ __ movq(R8, Address(R12, count_offset));
+ __ addq(R8, Immediate(Smi::RawValue(1)));
+ __ movq(R9, Immediate(Smi::RawValue(Smi::kMaxValue)));
+ __ cmovnoq(R9, R8);
+ __ movq(Address(R12, count_offset), R9);
srdjan 2014/07/10 17:07:36 ditto
zra 2014/07/10 17:15:40 See link.
+
__ Bind(&call_target_function);
// RAX: Target function.
Label is_compiled;
« runtime/vm/stub_code_ia32.cc ('K') | « runtime/vm/stub_code_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698