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

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 12254036: Minor cleanup of CompareIC state (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/code-stubs.cc ('k') | src/ic.h » ('j') | src/ic.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4425 matching lines...) Expand 10 before | Expand all | Expand 10 after
4436 } 4436 }
4437 4437
4438 4438
4439 static void CheckInputType(MacroAssembler* masm, 4439 static void CheckInputType(MacroAssembler* masm,
4440 Register input, 4440 Register input,
4441 CompareIC::State expected, 4441 CompareIC::State expected,
4442 Label* fail) { 4442 Label* fail) {
4443 Label ok; 4443 Label ok;
4444 if (expected == CompareIC::SMI) { 4444 if (expected == CompareIC::SMI) {
4445 __ JumpIfNotSmi(input, fail); 4445 __ JumpIfNotSmi(input, fail);
4446 } else if (expected == CompareIC::HEAP_NUMBER) { 4446 } else if (expected == CompareIC::NUMBER) {
4447 __ JumpIfSmi(input, &ok); 4447 __ JumpIfSmi(input, &ok);
4448 __ cmp(FieldOperand(input, HeapObject::kMapOffset), 4448 __ cmp(FieldOperand(input, HeapObject::kMapOffset),
4449 Immediate(masm->isolate()->factory()->heap_number_map())); 4449 Immediate(masm->isolate()->factory()->heap_number_map()));
4450 __ j(not_equal, fail); 4450 __ j(not_equal, fail);
4451 } 4451 }
4452 // We could be strict about symbol/string here, but as long as 4452 // We could be strict about symbol/string here, but as long as
4453 // hydrogen doesn't care, the stub doesn't have to care either. 4453 // hydrogen doesn't care, the stub doesn't have to care either.
4454 __ bind(&ok); 4454 __ bind(&ok);
4455 } 4455 }
4456 4456
(...skipping 2292 matching lines...) Expand 10 before | Expand all | Expand 10 after
6749 __ bind(&done); 6749 __ bind(&done);
6750 __ mov(eax, edx); 6750 __ mov(eax, edx);
6751 } 6751 }
6752 __ ret(0); 6752 __ ret(0);
6753 6753
6754 __ bind(&miss); 6754 __ bind(&miss);
6755 GenerateMiss(masm); 6755 GenerateMiss(masm);
6756 } 6756 }
6757 6757
6758 6758
6759 void ICCompareStub::GenerateHeapNumbers(MacroAssembler* masm) { 6759 void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
6760 ASSERT(state_ == CompareIC::HEAP_NUMBER); 6760 ASSERT(state_ == CompareIC::NUMBER);
6761 6761
6762 Label generic_stub; 6762 Label generic_stub;
6763 Label unordered, maybe_undefined1, maybe_undefined2; 6763 Label unordered, maybe_undefined1, maybe_undefined2;
6764 Label miss; 6764 Label miss;
6765 6765
6766 if (left_ == CompareIC::SMI) { 6766 if (left_ == CompareIC::SMI) {
6767 __ JumpIfNotSmi(edx, &miss); 6767 __ JumpIfNotSmi(edx, &miss);
6768 } 6768 }
6769 if (right_ == CompareIC::SMI) { 6769 if (right_ == CompareIC::SMI) {
6770 __ JumpIfNotSmi(eax, &miss); 6770 __ JumpIfNotSmi(eax, &miss);
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
7696 // Restore ecx. 7696 // Restore ecx.
7697 __ pop(ecx); 7697 __ pop(ecx);
7698 __ ret(0); 7698 __ ret(0);
7699 } 7699 }
7700 7700
7701 #undef __ 7701 #undef __
7702 7702
7703 } } // namespace v8::internal 7703 } } // namespace v8::internal
7704 7704
7705 #endif // V8_TARGET_ARCH_IA32 7705 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | src/ic.h » ('j') | src/ic.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698