| 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 5590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5601 | 5601 |
| 5602 ASSERT(GetCondition() == equal); | 5602 ASSERT(GetCondition() == equal); |
| 5603 __ subq(rax, rdx); | 5603 __ subq(rax, rdx); |
| 5604 __ ret(0); | 5604 __ ret(0); |
| 5605 | 5605 |
| 5606 __ bind(&miss); | 5606 __ bind(&miss); |
| 5607 GenerateMiss(masm); | 5607 GenerateMiss(masm); |
| 5608 } | 5608 } |
| 5609 | 5609 |
| 5610 | 5610 |
| 5611 void ICCompareStub::GenerateKnownObjects(MacroAssembler* masm) { |
| 5612 Label miss; |
| 5613 Condition either_smi = masm->CheckEitherSmi(rdx, rax); |
| 5614 __ j(either_smi, &miss, Label::kNear); |
| 5615 |
| 5616 __ movq(rcx, FieldOperand(rax, HeapObject::kMapOffset)); |
| 5617 __ movq(rbx, FieldOperand(rdx, HeapObject::kMapOffset)); |
| 5618 __ Cmp(rcx, known_map_); |
| 5619 __ j(not_equal, &miss, Label::kNear); |
| 5620 __ Cmp(rbx, known_map_); |
| 5621 __ j(not_equal, &miss, Label::kNear); |
| 5622 |
| 5623 __ subq(rax, rdx); |
| 5624 __ ret(0); |
| 5625 |
| 5626 __ bind(&miss); |
| 5627 GenerateMiss(masm); |
| 5628 } |
| 5629 |
| 5630 |
| 5611 void ICCompareStub::GenerateMiss(MacroAssembler* masm) { | 5631 void ICCompareStub::GenerateMiss(MacroAssembler* masm) { |
| 5612 // Save the registers. | 5632 { |
| 5613 __ pop(rcx); | 5633 // Call the runtime system in a fresh internal frame. |
| 5614 __ push(rdx); | 5634 ExternalReference miss = |
| 5615 __ push(rax); | 5635 ExternalReference(IC_Utility(IC::kCompareIC_Miss), masm->isolate()); |
| 5616 __ push(rcx); | |
| 5617 | 5636 |
| 5618 // Call the runtime system in a fresh internal frame. | |
| 5619 ExternalReference miss = | |
| 5620 ExternalReference(IC_Utility(IC::kCompareIC_Miss), masm->isolate()); | |
| 5621 { | |
| 5622 FrameScope scope(masm, StackFrame::INTERNAL); | 5637 FrameScope scope(masm, StackFrame::INTERNAL); |
| 5623 __ push(rdx); | 5638 __ push(rdx); |
| 5624 __ push(rax); | 5639 __ push(rax); |
| 5640 __ push(rdx); |
| 5641 __ push(rax); |
| 5625 __ Push(Smi::FromInt(op_)); | 5642 __ Push(Smi::FromInt(op_)); |
| 5626 __ CallExternalReference(miss, 3); | 5643 __ CallExternalReference(miss, 3); |
| 5644 |
| 5645 // Compute the entry point of the rewritten stub. |
| 5646 __ lea(rdi, FieldOperand(rax, Code::kHeaderSize)); |
| 5647 __ pop(rax); |
| 5648 __ pop(rdx); |
| 5627 } | 5649 } |
| 5628 | 5650 |
| 5629 // Compute the entry point of the rewritten stub. | |
| 5630 __ lea(rdi, FieldOperand(rax, Code::kHeaderSize)); | |
| 5631 | |
| 5632 // Restore registers. | |
| 5633 __ pop(rcx); | |
| 5634 __ pop(rax); | |
| 5635 __ pop(rdx); | |
| 5636 __ push(rcx); | |
| 5637 | |
| 5638 // Do a tail call to the rewritten stub. | 5651 // Do a tail call to the rewritten stub. |
| 5639 __ jmp(rdi); | 5652 __ jmp(rdi); |
| 5640 } | 5653 } |
| 5641 | 5654 |
| 5642 | 5655 |
| 5643 void StringDictionaryLookupStub::GenerateNegativeLookup(MacroAssembler* masm, | 5656 void StringDictionaryLookupStub::GenerateNegativeLookup(MacroAssembler* masm, |
| 5644 Label* miss, | 5657 Label* miss, |
| 5645 Label* done, | 5658 Label* done, |
| 5646 Register properties, | 5659 Register properties, |
| 5647 Handle<String> name, | 5660 Handle<String> name, |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6200 xmm0, | 6213 xmm0, |
| 6201 &slow_elements); | 6214 &slow_elements); |
| 6202 __ ret(0); | 6215 __ ret(0); |
| 6203 } | 6216 } |
| 6204 | 6217 |
| 6205 #undef __ | 6218 #undef __ |
| 6206 | 6219 |
| 6207 } } // namespace v8::internal | 6220 } } // namespace v8::internal |
| 6208 | 6221 |
| 6209 #endif // V8_TARGET_ARCH_X64 | 6222 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |