| 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 Register vector = LoadWithVectorDescriptor::VectorRegister(); | 333 Register vector = LoadWithVectorDescriptor::VectorRegister(); |
| 334 Register slot = LoadDescriptor::SlotRegister(); | 334 Register slot = LoadDescriptor::SlotRegister(); |
| 335 DCHECK(!AreAliased(megamorphic_scratch, vector, slot)); | 335 DCHECK(!AreAliased(megamorphic_scratch, vector, slot)); |
| 336 Handle<TypeFeedbackVector> dummy_vector = | 336 Handle<TypeFeedbackVector> dummy_vector = |
| 337 TypeFeedbackVector::DummyVector(masm->isolate()); | 337 TypeFeedbackVector::DummyVector(masm->isolate()); |
| 338 int slot_index = dummy_vector->GetIndex( | 338 int slot_index = dummy_vector->GetIndex( |
| 339 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); | 339 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); |
| 340 __ Move(vector, dummy_vector); | 340 __ Move(vector, dummy_vector); |
| 341 __ Move(slot, Smi::FromInt(slot_index)); | 341 __ Move(slot, Smi::FromInt(slot_index)); |
| 342 | 342 |
| 343 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 343 Code::Flags flags = |
| 344 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 344 Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(Code::LOAD_IC)); |
| 345 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags, | 345 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags, |
| 346 receiver, key, | 346 receiver, key, |
| 347 megamorphic_scratch, no_reg); | 347 megamorphic_scratch, no_reg); |
| 348 // Cache miss. | 348 // Cache miss. |
| 349 GenerateMiss(masm); | 349 GenerateMiss(masm); |
| 350 | 350 |
| 351 // Do a quick inline probe of the receiver's dictionary, if it | 351 // Do a quick inline probe of the receiver's dictionary, if it |
| 352 // exists. | 352 // exists. |
| 353 __ bind(&probe_dictionary); | 353 __ bind(&probe_dictionary); |
| 354 // rbx: elements | 354 // rbx: elements |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 Register slot = VectorStoreICDescriptor::SlotRegister(); | 560 Register slot = VectorStoreICDescriptor::SlotRegister(); |
| 561 // The handlers in the stub cache expect a vector and slot. Since we won't | 561 // The handlers in the stub cache expect a vector and slot. Since we won't |
| 562 // change the IC from any downstream misses, a dummy vector can be used. | 562 // change the IC from any downstream misses, a dummy vector can be used. |
| 563 Handle<TypeFeedbackVector> dummy_vector = | 563 Handle<TypeFeedbackVector> dummy_vector = |
| 564 TypeFeedbackVector::DummyVector(masm->isolate()); | 564 TypeFeedbackVector::DummyVector(masm->isolate()); |
| 565 int slot_index = dummy_vector->GetIndex( | 565 int slot_index = dummy_vector->GetIndex( |
| 566 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); | 566 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); |
| 567 __ Move(vector, dummy_vector); | 567 __ Move(vector, dummy_vector); |
| 568 __ Move(slot, Smi::FromInt(slot_index)); | 568 __ Move(slot, Smi::FromInt(slot_index)); |
| 569 | 569 |
| 570 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 570 Code::Flags flags = |
| 571 Code::ComputeHandlerFlags(Code::STORE_IC)); | 571 Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(Code::STORE_IC)); |
| 572 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, | 572 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, |
| 573 receiver, key, r9, no_reg); | 573 receiver, key, r9, no_reg); |
| 574 // Cache miss. | 574 // Cache miss. |
| 575 __ jmp(&miss); | 575 __ jmp(&miss); |
| 576 | 576 |
| 577 // Extra capacity case: Check if there is extra capacity to | 577 // Extra capacity case: Check if there is extra capacity to |
| 578 // perform the store and update the length. Used for adding one | 578 // perform the store and update the length. Used for adding one |
| 579 // element to the array by writing to array[array.length]. | 579 // element to the array by writing to array[array.length]. |
| 580 __ bind(&extra); | 580 __ bind(&extra); |
| 581 // receiver is a JSArray. | 581 // receiver is a JSArray. |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 Condition cc = | 845 Condition cc = |
| 846 (check == ENABLE_INLINED_SMI_CHECK) | 846 (check == ENABLE_INLINED_SMI_CHECK) |
| 847 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 847 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
| 848 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 848 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
| 849 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 849 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
| 850 } | 850 } |
| 851 } // namespace internal | 851 } // namespace internal |
| 852 } // namespace v8 | 852 } // namespace v8 |
| 853 | 853 |
| 854 #endif // V8_TARGET_ARCH_X64 | 854 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |