| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 8 | 8 |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 // If the receiver is a fast-case object, check the stub cache. Otherwise | 328 // If the receiver is a fast-case object, check the stub cache. Otherwise |
| 329 // probe the dictionary. | 329 // probe the dictionary. |
| 330 __ movp(rbx, FieldOperand(receiver, JSObject::kPropertiesOffset)); | 330 __ movp(rbx, FieldOperand(receiver, JSObject::kPropertiesOffset)); |
| 331 __ CompareRoot(FieldOperand(rbx, HeapObject::kMapOffset), | 331 __ CompareRoot(FieldOperand(rbx, HeapObject::kMapOffset), |
| 332 Heap::kHashTableMapRootIndex); | 332 Heap::kHashTableMapRootIndex); |
| 333 __ j(equal, &probe_dictionary); | 333 __ j(equal, &probe_dictionary); |
| 334 | 334 |
| 335 Register megamorphic_scratch = rdi; | 335 Register megamorphic_scratch = rdi; |
| 336 // The handlers in the stub cache expect a vector and slot. Since we won't | 336 // The handlers in the stub cache expect a vector and slot. Since we won't |
| 337 // change the IC from any downstream misses, a dummy vector can be used. | 337 // change the IC from any downstream misses, a dummy vector can be used. |
| 338 Register vector = VectorLoadICDescriptor::VectorRegister(); | 338 Register vector = LoadWithVectorDescriptor::VectorRegister(); |
| 339 Register slot = VectorLoadICDescriptor::SlotRegister(); | 339 Register slot = LoadDescriptor::SlotRegister(); |
| 340 DCHECK(!AreAliased(megamorphic_scratch, vector, slot)); | 340 DCHECK(!AreAliased(megamorphic_scratch, vector, slot)); |
| 341 Handle<TypeFeedbackVector> dummy_vector = Handle<TypeFeedbackVector>::cast( | 341 Handle<TypeFeedbackVector> dummy_vector = Handle<TypeFeedbackVector>::cast( |
| 342 masm->isolate()->factory()->keyed_load_dummy_vector()); | 342 masm->isolate()->factory()->keyed_load_dummy_vector()); |
| 343 int int_slot = dummy_vector->GetIndex(FeedbackVectorICSlot(0)); | 343 int int_slot = dummy_vector->GetIndex(FeedbackVectorICSlot(0)); |
| 344 __ Move(vector, dummy_vector); | 344 __ Move(vector, dummy_vector); |
| 345 __ Move(slot, Smi::FromInt(int_slot)); | 345 __ Move(slot, Smi::FromInt(int_slot)); |
| 346 | 346 |
| 347 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 347 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
| 348 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 348 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
| 349 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags, | 349 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags, |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 | 727 |
| 728 // Dictionary load failed, go slow (but don't miss). | 728 // Dictionary load failed, go slow (but don't miss). |
| 729 __ bind(&slow); | 729 __ bind(&slow); |
| 730 GenerateRuntimeGetProperty(masm); | 730 GenerateRuntimeGetProperty(masm); |
| 731 } | 731 } |
| 732 | 732 |
| 733 | 733 |
| 734 static void LoadIC_PushArgs(MacroAssembler* masm) { | 734 static void LoadIC_PushArgs(MacroAssembler* masm) { |
| 735 Register receiver = LoadDescriptor::ReceiverRegister(); | 735 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 736 Register name = LoadDescriptor::NameRegister(); | 736 Register name = LoadDescriptor::NameRegister(); |
| 737 Register slot = VectorLoadICDescriptor::SlotRegister(); | 737 Register slot = LoadDescriptor::SlotRegister(); |
| 738 Register vector = VectorLoadICDescriptor::VectorRegister(); | 738 Register vector = LoadWithVectorDescriptor::VectorRegister(); |
| 739 DCHECK(!rdi.is(receiver) && !rdi.is(name) && !rdi.is(slot) && | 739 DCHECK(!rdi.is(receiver) && !rdi.is(name) && !rdi.is(slot) && |
| 740 !rdi.is(vector)); | 740 !rdi.is(vector)); |
| 741 | 741 |
| 742 __ PopReturnAddressTo(rdi); | 742 __ PopReturnAddressTo(rdi); |
| 743 __ Push(receiver); | 743 __ Push(receiver); |
| 744 __ Push(name); | 744 __ Push(name); |
| 745 __ Push(slot); | 745 __ Push(slot); |
| 746 __ Push(vector); | 746 __ Push(vector); |
| 747 __ PushReturnAddressFrom(rdi); | 747 __ PushReturnAddressFrom(rdi); |
| 748 } | 748 } |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 950 Condition cc = | 950 Condition cc = |
| 951 (check == ENABLE_INLINED_SMI_CHECK) | 951 (check == ENABLE_INLINED_SMI_CHECK) |
| 952 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 952 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
| 953 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 953 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
| 954 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 954 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
| 955 } | 955 } |
| 956 } | 956 } |
| 957 } // namespace v8::internal | 957 } // namespace v8::internal |
| 958 | 958 |
| 959 #endif // V8_TARGET_ARCH_X64 | 959 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |