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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 333 |
334 // If the receiver is a fast-case object, check the stub cache. Otherwise | 334 // If the receiver is a fast-case object, check the stub cache. Otherwise |
335 // probe the dictionary. | 335 // probe the dictionary. |
336 __ mov(ebx, FieldOperand(receiver, JSObject::kPropertiesOffset)); | 336 __ mov(ebx, FieldOperand(receiver, JSObject::kPropertiesOffset)); |
337 __ cmp(FieldOperand(ebx, HeapObject::kMapOffset), | 337 __ cmp(FieldOperand(ebx, HeapObject::kMapOffset), |
338 Immediate(isolate->factory()->hash_table_map())); | 338 Immediate(isolate->factory()->hash_table_map())); |
339 __ j(equal, &probe_dictionary); | 339 __ j(equal, &probe_dictionary); |
340 | 340 |
341 // The handlers in the stub cache expect a vector and slot. Since we won't | 341 // The handlers in the stub cache expect a vector and slot. Since we won't |
342 // change the IC from any downstream misses, a dummy vector can be used. | 342 // change the IC from any downstream misses, a dummy vector can be used. |
343 Handle<TypeFeedbackVector> dummy_vector = Handle<TypeFeedbackVector>::cast( | 343 Handle<TypeFeedbackVector> dummy_vector = |
344 isolate->factory()->keyed_load_dummy_vector()); | 344 TypeFeedbackVector::DummyVector(isolate); |
345 int slot = dummy_vector->GetIndex(FeedbackVectorICSlot(0)); | 345 int slot = dummy_vector->GetIndex( |
| 346 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); |
346 __ push(Immediate(Smi::FromInt(slot))); | 347 __ push(Immediate(Smi::FromInt(slot))); |
347 __ push(Immediate(dummy_vector)); | 348 __ push(Immediate(dummy_vector)); |
348 | 349 |
349 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 350 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
350 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 351 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
351 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags, | 352 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags, |
352 false, receiver, key, ebx, edi); | 353 false, receiver, key, ebx, edi); |
353 | 354 |
354 __ pop(LoadWithVectorDescriptor::VectorRegister()); | 355 __ pop(LoadWithVectorDescriptor::VectorRegister()); |
355 __ pop(LoadDescriptor::SlotRegister()); | 356 __ pop(LoadDescriptor::SlotRegister()); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 | 561 |
561 __ bind(&maybe_name_key); | 562 __ bind(&maybe_name_key); |
562 __ mov(ebx, FieldOperand(key, HeapObject::kMapOffset)); | 563 __ mov(ebx, FieldOperand(key, HeapObject::kMapOffset)); |
563 __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset)); | 564 __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset)); |
564 __ JumpIfNotUniqueNameInstanceType(ebx, &slow); | 565 __ JumpIfNotUniqueNameInstanceType(ebx, &slow); |
565 | 566 |
566 | 567 |
567 if (FLAG_vector_stores) { | 568 if (FLAG_vector_stores) { |
568 // The handlers in the stub cache expect a vector and slot. Since we won't | 569 // The handlers in the stub cache expect a vector and slot. Since we won't |
569 // change the IC from any downstream misses, a dummy vector can be used. | 570 // change the IC from any downstream misses, a dummy vector can be used. |
570 Handle<TypeFeedbackVector> dummy_vector = Handle<TypeFeedbackVector>::cast( | 571 Handle<TypeFeedbackVector> dummy_vector = |
571 masm->isolate()->factory()->keyed_store_dummy_vector()); | 572 TypeFeedbackVector::DummyVector(masm->isolate()); |
572 int slot = dummy_vector->GetIndex(FeedbackVectorICSlot(0)); | 573 int slot = dummy_vector->GetIndex( |
| 574 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); |
573 __ push(Immediate(Smi::FromInt(slot))); | 575 __ push(Immediate(Smi::FromInt(slot))); |
574 __ push(Immediate(dummy_vector)); | 576 __ push(Immediate(dummy_vector)); |
575 } | 577 } |
576 | 578 |
577 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 579 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
578 Code::ComputeHandlerFlags(Code::STORE_IC)); | 580 Code::ComputeHandlerFlags(Code::STORE_IC)); |
579 masm->isolate()->stub_cache()->GenerateProbe( | 581 masm->isolate()->stub_cache()->GenerateProbe( |
580 masm, Code::STORE_IC, flags, false, receiver, key, ebx, no_reg); | 582 masm, Code::STORE_IC, flags, false, receiver, key, ebx, no_reg); |
581 | 583 |
582 if (FLAG_vector_stores) { | 584 if (FLAG_vector_stores) { |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 Condition cc = | 888 Condition cc = |
887 (check == ENABLE_INLINED_SMI_CHECK) | 889 (check == ENABLE_INLINED_SMI_CHECK) |
888 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 890 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
889 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 891 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
890 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 892 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
891 } | 893 } |
892 } // namespace internal | 894 } // namespace internal |
893 } // namespace v8 | 895 } // namespace v8 |
894 | 896 |
895 #endif // V8_TARGET_ARCH_IA32 | 897 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |