| 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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 __ ret(0); | 422 __ ret(0); |
| 423 | 423 |
| 424 StubRuntimeCallHelper call_helper; | 424 StubRuntimeCallHelper call_helper; |
| 425 char_at_generator.GenerateSlow(masm, call_helper); | 425 char_at_generator.GenerateSlow(masm, call_helper); |
| 426 | 426 |
| 427 __ bind(&miss); | 427 __ bind(&miss); |
| 428 GenerateMiss(masm); | 428 GenerateMiss(masm); |
| 429 } | 429 } |
| 430 | 430 |
| 431 | 431 |
| 432 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { | |
| 433 // Return address is on the stack. | |
| 434 Label slow; | |
| 435 | |
| 436 Register receiver = LoadDescriptor::ReceiverRegister(); | |
| 437 Register key = LoadDescriptor::NameRegister(); | |
| 438 Register scratch = rax; | |
| 439 DCHECK(!scratch.is(receiver) && !scratch.is(key)); | |
| 440 | |
| 441 // Check that the receiver isn't a smi. | |
| 442 __ JumpIfSmi(receiver, &slow); | |
| 443 | |
| 444 // Check that the key is an array index, that is Uint32. | |
| 445 STATIC_ASSERT(kSmiValueSize <= 32); | |
| 446 __ JumpUnlessNonNegativeSmi(key, &slow); | |
| 447 | |
| 448 // Get the map of the receiver. | |
| 449 __ movp(scratch, FieldOperand(receiver, HeapObject::kMapOffset)); | |
| 450 | |
| 451 // Check that it has indexed interceptor and access checks | |
| 452 // are not enabled for this object. | |
| 453 __ movb(scratch, FieldOperand(scratch, Map::kBitFieldOffset)); | |
| 454 __ andb(scratch, Immediate(kSlowCaseBitFieldMask)); | |
| 455 __ cmpb(scratch, Immediate(1 << Map::kHasIndexedInterceptor)); | |
| 456 __ j(not_zero, &slow); | |
| 457 | |
| 458 // Everything is fine, call runtime. | |
| 459 __ PopReturnAddressTo(scratch); | |
| 460 __ Push(receiver); // receiver | |
| 461 __ Push(key); // key | |
| 462 __ PushReturnAddressFrom(scratch); | |
| 463 | |
| 464 // Perform tail call to the entry. | |
| 465 __ TailCallExternalReference( | |
| 466 ExternalReference(IC_Utility(kLoadElementWithInterceptor), | |
| 467 masm->isolate()), | |
| 468 2, 1); | |
| 469 | |
| 470 __ bind(&slow); | |
| 471 GenerateMiss(masm); | |
| 472 } | |
| 473 | |
| 474 | |
| 475 static void KeyedStoreGenerateGenericHelper( | 432 static void KeyedStoreGenerateGenericHelper( |
| 476 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, | 433 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, |
| 477 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length) { | 434 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length) { |
| 478 Label transition_smi_elements; | 435 Label transition_smi_elements; |
| 479 Label finish_object_store, non_double_value, transition_double_elements; | 436 Label finish_object_store, non_double_value, transition_double_elements; |
| 480 Label fast_double_without_map_check; | 437 Label fast_double_without_map_check; |
| 481 Register receiver = StoreDescriptor::ReceiverRegister(); | 438 Register receiver = StoreDescriptor::ReceiverRegister(); |
| 482 Register key = StoreDescriptor::NameRegister(); | 439 Register key = StoreDescriptor::NameRegister(); |
| 483 Register value = StoreDescriptor::ValueRegister(); | 440 Register value = StoreDescriptor::ValueRegister(); |
| 484 DCHECK(receiver.is(rdx)); | 441 DCHECK(receiver.is(rdx)); |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 Condition cc = | 1006 Condition cc = |
| 1050 (check == ENABLE_INLINED_SMI_CHECK) | 1007 (check == ENABLE_INLINED_SMI_CHECK) |
| 1051 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 1008 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
| 1052 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 1009 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
| 1053 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1010 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
| 1054 } | 1011 } |
| 1055 } | 1012 } |
| 1056 } // namespace v8::internal | 1013 } // namespace v8::internal |
| 1057 | 1014 |
| 1058 #endif // V8_TARGET_ARCH_X64 | 1015 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |