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

Unified Diff: runtime/vm/stub_code_ia32.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
Index: runtime/vm/stub_code_ia32.cc
===================================================================
--- runtime/vm/stub_code_ia32.cc (revision 38122)
+++ runtime/vm/stub_code_ia32.cc (working copy)
@@ -1402,12 +1402,15 @@
// EBX: Pointer to an IC data check group.
const intptr_t target_offset = ICData::TargetIndexFor(num_args) * kWordSize;
const intptr_t count_offset = ICData::CountIndexFor(num_args) * kWordSize;
+
+ // Update counter.
+ __ movl(EAX, Address(EBX, count_offset));
+ __ addl(EAX, Immediate(Smi::RawValue(1)));
+ __ movl(EDI, Immediate(Smi::RawValue(Smi::kMaxValue)));
+ __ cmovno(EDI, EAX);
+ __ movl(Address(EBX, count_offset), EDI);
srdjan 2014/07/10 17:07:36 Are you certain this is better in ia32? The new co
zra 2014/07/10 17:15:39 I've sent you a link.
+
__ movl(EAX, Address(EBX, target_offset));
- __ addl(Address(EBX, count_offset), Immediate(Smi::RawValue(1)));
- __ j(NO_OVERFLOW, &call_target_function, Assembler::kNearJump);
- __ movl(Address(EBX, count_offset),
- Immediate(Smi::RawValue(Smi::kMaxValue)));
-
__ Bind(&call_target_function);
// EAX: Target function.
__ movl(EBX, FieldAddress(EAX, Function::instructions_offset()));

Powered by Google App Engine
This is Rietveld 408576698