OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
9 #include "src/ic/ic-compiler.h" | 9 #include "src/ic/ic-compiler.h" |
10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 | 660 |
661 __ PopReturnAddressTo(rdi); | 661 __ PopReturnAddressTo(rdi); |
662 __ Push(receiver); | 662 __ Push(receiver); |
663 __ Push(name); | 663 __ Push(name); |
664 __ Push(slot); | 664 __ Push(slot); |
665 __ Push(vector); | 665 __ Push(vector); |
666 __ PushReturnAddressFrom(rdi); | 666 __ PushReturnAddressFrom(rdi); |
667 } | 667 } |
668 | 668 |
669 | 669 |
670 void LoadIC::GenerateMiss(MacroAssembler* masm, int stress) { | 670 void LoadIC::GenerateMiss(MacroAssembler* masm) { |
671 // The return address is on the stack. | 671 // The return address is on the stack. |
672 | 672 |
673 Counters* counters = masm->isolate()->counters(); | 673 Counters* counters = masm->isolate()->counters(); |
674 __ IncrementCounter(counters->load_miss(), 1); | 674 __ IncrementCounter(counters->load_miss(), 1); |
675 | 675 |
676 LoadIC_PushArgs(masm); | 676 LoadIC_PushArgs(masm); |
677 | 677 |
678 Register receiver = LoadDescriptor::ReceiverRegister(); | |
679 | |
680 // Sanity check: The receiver must be a JS-exposed kind of object, | |
681 // not something internal (like a Map, or FixedArray). Check this here | |
682 // to chase after a rare but recurring crash bug. | |
683 // TODO(chromium:527994): Remove this when we have a few crash reports. | |
684 | |
685 Label ok, sound_alarm; | |
686 __ JumpIfSmi(receiver, &ok, Label::kNear); | |
687 __ movp(rbx, FieldOperand(receiver, HeapObject::kMapOffset)); | |
688 __ CompareRoot(rbx, Heap::kMetaMapRootIndex); | |
689 __ j(equal, &sound_alarm); | |
690 __ CompareRoot(rbx, Heap::kFixedArrayMapRootIndex); | |
691 __ j(not_equal, &ok, Label::kNear); | |
692 | |
693 // This cmpp instruction is only here to identify which of several kinds | |
694 // of code blocks embedded the MISS code. (handler, dispatcher). | |
695 __ cmpp(receiver, Immediate(stress)); | |
696 | |
697 __ bind(&sound_alarm); | |
698 __ Push(Smi::FromInt(0xaabbccdd)); | |
699 __ Push(receiver); | |
700 __ movp(rbx, FieldOperand(receiver, HeapObject::kMapOffset)); | |
701 __ Push(rbx); | |
702 __ movp(rbx, FieldOperand(receiver, JSObject::kPropertiesOffset)); | |
703 __ Push(rbx); | |
704 __ int3(); | |
705 | |
706 __ bind(&ok); | |
707 | |
708 // Perform tail call to the entry. | 678 // Perform tail call to the entry. |
709 int arg_count = 4; | 679 int arg_count = 4; |
710 __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count, 1); | 680 __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count, 1); |
711 } | 681 } |
712 | 682 |
713 | 683 |
714 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 684 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
715 LanguageMode language_mode) { | 685 LanguageMode language_mode) { |
716 // The return address is on the stack. | 686 // The return address is on the stack. |
717 Register receiver = LoadDescriptor::ReceiverRegister(); | 687 Register receiver = LoadDescriptor::ReceiverRegister(); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 Condition cc = | 886 Condition cc = |
917 (check == ENABLE_INLINED_SMI_CHECK) | 887 (check == ENABLE_INLINED_SMI_CHECK) |
918 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 888 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
919 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 889 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
920 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 890 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
921 } | 891 } |
922 } // namespace internal | 892 } // namespace internal |
923 } // namespace v8 | 893 } // namespace v8 |
924 | 894 |
925 #endif // V8_TARGET_ARCH_X64 | 895 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |