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 6652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6663 | 6663 |
6664 ASSERT(GetCondition() == equal); | 6664 ASSERT(GetCondition() == equal); |
6665 __ sub(eax, edx); | 6665 __ sub(eax, edx); |
6666 __ ret(0); | 6666 __ ret(0); |
6667 | 6667 |
6668 __ bind(&miss); | 6668 __ bind(&miss); |
6669 GenerateMiss(masm); | 6669 GenerateMiss(masm); |
6670 } | 6670 } |
6671 | 6671 |
6672 | 6672 |
| 6673 void ICCompareStub::GenerateKnownObjects(MacroAssembler* masm) { |
| 6674 Label miss; |
| 6675 __ mov(ecx, edx); |
| 6676 __ and_(ecx, eax); |
| 6677 __ JumpIfSmi(ecx, &miss, Label::kNear); |
| 6678 |
| 6679 __ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset)); |
| 6680 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); |
| 6681 __ cmp(ecx, known_map_); |
| 6682 __ j(not_equal, &miss, Label::kNear); |
| 6683 __ cmp(ebx, known_map_); |
| 6684 __ j(not_equal, &miss, Label::kNear); |
| 6685 |
| 6686 __ sub(eax, edx); |
| 6687 __ ret(0); |
| 6688 |
| 6689 __ bind(&miss); |
| 6690 GenerateMiss(masm); |
| 6691 } |
| 6692 |
| 6693 |
6673 void ICCompareStub::GenerateMiss(MacroAssembler* masm) { | 6694 void ICCompareStub::GenerateMiss(MacroAssembler* masm) { |
6674 // Save the registers. | |
6675 __ pop(ecx); | |
6676 __ push(edx); | |
6677 __ push(eax); | |
6678 __ push(ecx); | |
6679 | |
6680 { | 6695 { |
6681 // Call the runtime system in a fresh internal frame. | 6696 // Call the runtime system in a fresh internal frame. |
6682 ExternalReference miss = ExternalReference(IC_Utility(IC::kCompareIC_Miss), | 6697 ExternalReference miss = ExternalReference(IC_Utility(IC::kCompareIC_Miss), |
6683 masm->isolate()); | 6698 masm->isolate()); |
6684 FrameScope scope(masm, StackFrame::INTERNAL); | 6699 FrameScope scope(masm, StackFrame::INTERNAL); |
6685 __ push(edx); | 6700 __ push(edx); // Preserve edx and eax. |
| 6701 __ push(eax); |
| 6702 __ push(edx); // And also use them as the arguments. |
6686 __ push(eax); | 6703 __ push(eax); |
6687 __ push(Immediate(Smi::FromInt(op_))); | 6704 __ push(Immediate(Smi::FromInt(op_))); |
6688 __ CallExternalReference(miss, 3); | 6705 __ CallExternalReference(miss, 3); |
| 6706 // Compute the entry point of the rewritten stub. |
| 6707 __ lea(edi, FieldOperand(eax, Code::kHeaderSize)); |
| 6708 __ pop(eax); |
| 6709 __ pop(edx); |
6689 } | 6710 } |
6690 | 6711 |
6691 // Compute the entry point of the rewritten stub. | |
6692 __ lea(edi, FieldOperand(eax, Code::kHeaderSize)); | |
6693 | |
6694 // Restore registers. | |
6695 __ pop(ecx); | |
6696 __ pop(eax); | |
6697 __ pop(edx); | |
6698 __ push(ecx); | |
6699 | |
6700 // Do a tail call to the rewritten stub. | 6712 // Do a tail call to the rewritten stub. |
6701 __ jmp(edi); | 6713 __ jmp(edi); |
6702 } | 6714 } |
6703 | 6715 |
6704 | 6716 |
6705 // Helper function used to check that the dictionary doesn't contain | 6717 // Helper function used to check that the dictionary doesn't contain |
6706 // the property. This function may return false negatives, so miss_label | 6718 // the property. This function may return false negatives, so miss_label |
6707 // must always call a backup property check that is complete. | 6719 // must always call a backup property check that is complete. |
6708 // This function is safe to call if the receiver has fast properties. | 6720 // This function is safe to call if the receiver has fast properties. |
6709 // Name must be a symbol and receiver must be a heap object. | 6721 // Name must be a symbol and receiver must be a heap object. |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7273 false); | 7285 false); |
7274 __ pop(edx); | 7286 __ pop(edx); |
7275 __ ret(0); | 7287 __ ret(0); |
7276 } | 7288 } |
7277 | 7289 |
7278 #undef __ | 7290 #undef __ |
7279 | 7291 |
7280 } } // namespace v8::internal | 7292 } } // namespace v8::internal |
7281 | 7293 |
7282 #endif // V8_TARGET_ARCH_IA32 | 7294 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |