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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 rbx, rdi, slow); | 489 rbx, rdi, slow); |
490 mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS, FAST_ELEMENTS); | 490 mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS, FAST_ELEMENTS); |
491 ElementsTransitionGenerator::GenerateDoubleToObject(masm, receiver, key, | 491 ElementsTransitionGenerator::GenerateDoubleToObject(masm, receiver, key, |
492 value, rbx, mode, slow); | 492 value, rbx, mode, slow); |
493 __ movp(rbx, FieldOperand(receiver, JSObject::kElementsOffset)); | 493 __ movp(rbx, FieldOperand(receiver, JSObject::kElementsOffset)); |
494 __ jmp(&finish_object_store); | 494 __ jmp(&finish_object_store); |
495 } | 495 } |
496 | 496 |
497 | 497 |
498 void KeyedStoreIC::GenerateMegamorphic(MacroAssembler* masm, | 498 void KeyedStoreIC::GenerateMegamorphic(MacroAssembler* masm, |
499 StrictMode strict_mode) { | 499 LanguageMode language_mode) { |
500 // Return address is on the stack. | 500 // Return address is on the stack. |
501 Label slow, slow_with_tagged_index, fast_object, fast_object_grow; | 501 Label slow, slow_with_tagged_index, fast_object, fast_object_grow; |
502 Label fast_double, fast_double_grow; | 502 Label fast_double, fast_double_grow; |
503 Label array, extra, check_if_double_array, maybe_name_key, miss; | 503 Label array, extra, check_if_double_array, maybe_name_key, miss; |
504 Register receiver = StoreDescriptor::ReceiverRegister(); | 504 Register receiver = StoreDescriptor::ReceiverRegister(); |
505 Register key = StoreDescriptor::NameRegister(); | 505 Register key = StoreDescriptor::NameRegister(); |
506 DCHECK(receiver.is(rdx)); | 506 DCHECK(receiver.is(rdx)); |
507 DCHECK(key.is(rcx)); | 507 DCHECK(key.is(rcx)); |
508 | 508 |
509 // Check that the object isn't a smi. | 509 // Check that the object isn't a smi. |
(...skipping 19 matching lines...) Expand all Loading... |
529 __ movp(rbx, FieldOperand(receiver, JSObject::kElementsOffset)); | 529 __ movp(rbx, FieldOperand(receiver, JSObject::kElementsOffset)); |
530 // Check array bounds. | 530 // Check array bounds. |
531 __ SmiCompareInteger32(FieldOperand(rbx, FixedArray::kLengthOffset), key); | 531 __ SmiCompareInteger32(FieldOperand(rbx, FixedArray::kLengthOffset), key); |
532 // rbx: FixedArray | 532 // rbx: FixedArray |
533 __ j(above, &fast_object); | 533 __ j(above, &fast_object); |
534 | 534 |
535 // Slow case: call runtime. | 535 // Slow case: call runtime. |
536 __ bind(&slow); | 536 __ bind(&slow); |
537 __ Integer32ToSmi(key, key); | 537 __ Integer32ToSmi(key, key); |
538 __ bind(&slow_with_tagged_index); | 538 __ bind(&slow_with_tagged_index); |
539 PropertyICCompiler::GenerateRuntimeSetProperty(masm, strict_mode); | 539 PropertyICCompiler::GenerateRuntimeSetProperty(masm, language_mode); |
540 // Never returns to here. | 540 // Never returns to here. |
541 | 541 |
542 __ bind(&maybe_name_key); | 542 __ bind(&maybe_name_key); |
543 __ movp(r9, FieldOperand(key, HeapObject::kMapOffset)); | 543 __ movp(r9, FieldOperand(key, HeapObject::kMapOffset)); |
544 __ movzxbp(r9, FieldOperand(r9, Map::kInstanceTypeOffset)); | 544 __ movzxbp(r9, FieldOperand(r9, Map::kInstanceTypeOffset)); |
545 __ JumpIfNotUniqueNameInstanceType(r9, &slow_with_tagged_index); | 545 __ JumpIfNotUniqueNameInstanceType(r9, &slow_with_tagged_index); |
546 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 546 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
547 Code::ComputeHandlerFlags(Code::STORE_IC)); | 547 Code::ComputeHandlerFlags(Code::STORE_IC)); |
548 masm->isolate()->stub_cache()->GenerateProbe( | 548 masm->isolate()->stub_cache()->GenerateProbe( |
549 masm, Code::STORE_IC, flags, false, receiver, key, rbx, no_reg); | 549 masm, Code::STORE_IC, flags, false, receiver, key, rbx, no_reg); |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 Condition cc = | 946 Condition cc = |
947 (check == ENABLE_INLINED_SMI_CHECK) | 947 (check == ENABLE_INLINED_SMI_CHECK) |
948 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 948 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
949 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 949 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
950 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 950 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
951 } | 951 } |
952 } | 952 } |
953 } // namespace v8::internal | 953 } // namespace v8::internal |
954 | 954 |
955 #endif // V8_TARGET_ARCH_X64 | 955 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |