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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 388863002: Better sequences for class id loading on ia32. (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
« no previous file with comments | « runtime/vm/assembler_ia32_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 38158)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -945,17 +945,15 @@
void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const Register object = locs()->in(0).reg();
const Register result = locs()->out(0).reg();
- Label not_smi, done;
+ Label done;
// We don't use Assembler::LoadTaggedClassIdMayBeSmi() here---which uses
// a conditional move instead, and requires an additional register---because
// it is slower, probably due to branch prediction usually working just fine
// in this case.
+ __ movl(result, Immediate(kSmiCid << 1));
srdjan 2014/07/11 18:23:30 ASSERT result != object
zra 2014/07/11 18:28:41 Done.
__ testl(object, Immediate(kSmiTagMask));
- __ j(NOT_ZERO, &not_smi, Assembler::kNearJump);
- __ movl(result, Immediate(Smi::RawValue(kSmiCid)));
- __ jmp(&done, Assembler::kNearJump);
- __ Bind(&not_smi);
+ __ j(EQUAL, &done, Assembler::kNearJump);
__ LoadClassId(result, object);
__ SmiTag(result);
__ Bind(&done);
« no previous file with comments | « runtime/vm/assembler_ia32_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698