OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 6484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6495 | 6495 |
6496 ASSERT(GetCondition() == equal); | 6496 ASSERT(GetCondition() == equal); |
6497 __ sub(eax, edx); | 6497 __ sub(eax, edx); |
6498 __ ret(0); | 6498 __ ret(0); |
6499 | 6499 |
6500 __ bind(&miss); | 6500 __ bind(&miss); |
6501 GenerateMiss(masm); | 6501 GenerateMiss(masm); |
6502 } | 6502 } |
6503 | 6503 |
6504 | 6504 |
6505 void ICCompareStub::GenerateKnownObjects(MacroAssembler* masm, | |
6506 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.
| |
6507 Label miss; | |
6508 __ mov(ecx, edx); | |
6509 __ and_(ecx, eax); | |
6510 __ JumpIfSmi(ecx, &miss, Label::kNear); | |
6511 | |
6512 __ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset)); | |
6513 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); | |
6514 __ 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)
| |
6515 __ j(not_equal, &miss, Label::kNear); | |
6516 __ cmp(ebx, map); | |
6517 __ j(not_equal, &miss, Label::kNear); | |
6518 | |
6519 __ sub(eax, edx); | |
6520 __ ret(0); | |
6521 | |
6522 __ bind(&miss); | |
6523 GenerateMiss(masm); | |
6524 } | |
6525 | |
6526 | |
6505 void ICCompareStub::GenerateMiss(MacroAssembler* masm) { | 6527 void ICCompareStub::GenerateMiss(MacroAssembler* masm) { |
6506 // Save the registers. | 6528 // Save the registers. |
6507 __ pop(ecx); | 6529 __ 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.
| |
6508 __ push(edx); | 6530 __ push(edx); |
6509 __ push(eax); | 6531 __ push(eax); |
6510 __ push(ecx); | 6532 __ push(ecx); |
6511 | 6533 |
6512 { | 6534 { |
6513 // Call the runtime system in a fresh internal frame. | 6535 // Call the runtime system in a fresh internal frame. |
6514 ExternalReference miss = ExternalReference(IC_Utility(IC::kCompareIC_Miss), | 6536 ExternalReference miss = ExternalReference(IC_Utility(IC::kCompareIC_Miss), |
6515 masm->isolate()); | 6537 masm->isolate()); |
6516 FrameScope scope(masm, StackFrame::INTERNAL); | 6538 FrameScope scope(masm, StackFrame::INTERNAL); |
6517 __ push(edx); | 6539 __ push(edx); |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7111 __ bind(&element_done); | 7133 __ bind(&element_done); |
7112 __ ret(0); | 7134 __ ret(0); |
7113 } | 7135 } |
7114 } | 7136 } |
7115 | 7137 |
7116 #undef __ | 7138 #undef __ |
7117 | 7139 |
7118 } } // namespace v8::internal | 7140 } } // namespace v8::internal |
7119 | 7141 |
7120 #endif // V8_TARGET_ARCH_IA32 | 7142 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |