| 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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 ebx, edi, slow); | 605 ebx, edi, slow); |
| 606 mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS, FAST_ELEMENTS); | 606 mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS, FAST_ELEMENTS); |
| 607 ElementsTransitionGenerator::GenerateDoubleToObject(masm, receiver, key, | 607 ElementsTransitionGenerator::GenerateDoubleToObject(masm, receiver, key, |
| 608 value, ebx, mode, slow); | 608 value, ebx, mode, slow); |
| 609 __ mov(ebx, FieldOperand(receiver, JSObject::kElementsOffset)); | 609 __ mov(ebx, FieldOperand(receiver, JSObject::kElementsOffset)); |
| 610 __ jmp(&finish_object_store); | 610 __ jmp(&finish_object_store); |
| 611 } | 611 } |
| 612 | 612 |
| 613 | 613 |
| 614 void KeyedStoreIC::GenerateMegamorphic(MacroAssembler* masm, | 614 void KeyedStoreIC::GenerateMegamorphic(MacroAssembler* masm, |
| 615 StrictMode strict_mode) { | 615 LanguageMode language_mode) { |
| 616 // Return address is on the stack. | 616 // Return address is on the stack. |
| 617 Label slow, fast_object, fast_object_grow; | 617 Label slow, fast_object, fast_object_grow; |
| 618 Label fast_double, fast_double_grow; | 618 Label fast_double, fast_double_grow; |
| 619 Label array, extra, check_if_double_array, maybe_name_key, miss; | 619 Label array, extra, check_if_double_array, maybe_name_key, miss; |
| 620 Register receiver = StoreDescriptor::ReceiverRegister(); | 620 Register receiver = StoreDescriptor::ReceiverRegister(); |
| 621 Register key = StoreDescriptor::NameRegister(); | 621 Register key = StoreDescriptor::NameRegister(); |
| 622 DCHECK(receiver.is(edx)); | 622 DCHECK(receiver.is(edx)); |
| 623 DCHECK(key.is(ecx)); | 623 DCHECK(key.is(ecx)); |
| 624 | 624 |
| 625 // Check that the object isn't a smi. | 625 // Check that the object isn't a smi. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 642 // Object case: Check key against length in the elements array. | 642 // Object case: Check key against length in the elements array. |
| 643 // Key is a smi. | 643 // Key is a smi. |
| 644 // edi: receiver map | 644 // edi: receiver map |
| 645 __ mov(ebx, FieldOperand(receiver, JSObject::kElementsOffset)); | 645 __ mov(ebx, FieldOperand(receiver, JSObject::kElementsOffset)); |
| 646 // Check array bounds. Both the key and the length of FixedArray are smis. | 646 // Check array bounds. Both the key and the length of FixedArray are smis. |
| 647 __ cmp(key, FieldOperand(ebx, FixedArray::kLengthOffset)); | 647 __ cmp(key, FieldOperand(ebx, FixedArray::kLengthOffset)); |
| 648 __ j(below, &fast_object); | 648 __ j(below, &fast_object); |
| 649 | 649 |
| 650 // Slow case: call runtime. | 650 // Slow case: call runtime. |
| 651 __ bind(&slow); | 651 __ bind(&slow); |
| 652 PropertyICCompiler::GenerateRuntimeSetProperty(masm, strict_mode); | 652 PropertyICCompiler::GenerateRuntimeSetProperty(masm, language_mode); |
| 653 // Never returns to here. | 653 // Never returns to here. |
| 654 | 654 |
| 655 __ bind(&maybe_name_key); | 655 __ bind(&maybe_name_key); |
| 656 __ mov(ebx, FieldOperand(key, HeapObject::kMapOffset)); | 656 __ mov(ebx, FieldOperand(key, HeapObject::kMapOffset)); |
| 657 __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset)); | 657 __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset)); |
| 658 __ JumpIfNotUniqueNameInstanceType(ebx, &slow); | 658 __ JumpIfNotUniqueNameInstanceType(ebx, &slow); |
| 659 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 659 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
| 660 Code::ComputeHandlerFlags(Code::STORE_IC)); | 660 Code::ComputeHandlerFlags(Code::STORE_IC)); |
| 661 masm->isolate()->stub_cache()->GenerateProbe( | 661 masm->isolate()->stub_cache()->GenerateProbe( |
| 662 masm, Code::STORE_IC, flags, false, receiver, key, ebx, no_reg); | 662 masm, Code::STORE_IC, flags, false, receiver, key, ebx, no_reg); |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 Condition cc = | 959 Condition cc = |
| 960 (check == ENABLE_INLINED_SMI_CHECK) | 960 (check == ENABLE_INLINED_SMI_CHECK) |
| 961 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 961 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
| 962 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 962 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
| 963 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 963 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
| 964 } | 964 } |
| 965 } | 965 } |
| 966 } // namespace v8::internal | 966 } // namespace v8::internal |
| 967 | 967 |
| 968 #endif // V8_TARGET_ARCH_IA32 | 968 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |