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

Unified Diff: src/ia32/code-stubs-ia32.cc

Issue 8520006: Optimize the equality check case of ICCompare stubs. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 1 month 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: src/ia32/code-stubs-ia32.cc
===================================================================
--- src/ia32/code-stubs-ia32.cc (revision 9957)
+++ src/ia32/code-stubs-ia32.cc (working copy)
@@ -6502,6 +6502,28 @@
}
+void ICCompareStub::GenerateKnownObjects(MacroAssembler* masm,
+ Handle<Map> map) {
Kevin Millikin (Chromium) 2011/11/11 10:12:34 No need for the extra argument.
Rico 2011/11/15 10:12:26 Done.
+ Label miss;
+ __ mov(ecx, edx);
+ __ and_(ecx, eax);
+ __ JumpIfSmi(ecx, &miss, Label::kNear);
+
+ __ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset));
+ __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset));
+ __ cmp(ecx, map);
Kevin Millikin (Chromium) 2011/11/11 10:12:34 cmp(ecx, known_map_)
Rico 2011/11/15 10:12:26 Done (and below)
+ __ j(not_equal, &miss, Label::kNear);
+ __ cmp(ebx, map);
+ __ j(not_equal, &miss, Label::kNear);
+
+ __ sub(eax, edx);
+ __ ret(0);
+
+ __ bind(&miss);
+ GenerateMiss(masm);
+}
+
+
void ICCompareStub::GenerateMiss(MacroAssembler* masm) {
// Save the registers.
__ pop(ecx);
Kevin Millikin (Chromium) 2011/11/11 10:12:34 I'm not sure why this code is written this way, bu
Rico 2011/11/15 10:12:26 Done.

Powered by Google App Engine
This is Rietveld 408576698