| 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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 GenerateDictionaryLoad(masm, &slow, rbx, key, rax, rdi, rax); | 396 GenerateDictionaryLoad(masm, &slow, rbx, key, rax, rdi, rax); |
| 397 __ IncrementCounter(counters->keyed_load_generic_symbol(), 1); | 397 __ IncrementCounter(counters->keyed_load_generic_symbol(), 1); |
| 398 __ ret(0); | 398 __ ret(0); |
| 399 | 399 |
| 400 __ bind(&index_name); | 400 __ bind(&index_name); |
| 401 __ IndexFromHash(rbx, key); | 401 __ IndexFromHash(rbx, key); |
| 402 __ jmp(&index_smi); | 402 __ jmp(&index_smi); |
| 403 } | 403 } |
| 404 | 404 |
| 405 | 405 |
| 406 void KeyedLoadIC::GenerateString(MacroAssembler* masm) { | |
| 407 // Return address is on the stack. | |
| 408 Label miss; | |
| 409 | |
| 410 Register receiver = LoadDescriptor::ReceiverRegister(); | |
| 411 Register index = LoadDescriptor::NameRegister(); | |
| 412 Register scratch = rbx; | |
| 413 Register result = rax; | |
| 414 DCHECK(!scratch.is(receiver) && !scratch.is(index)); | |
| 415 | |
| 416 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, | |
| 417 &miss, // When not a string. | |
| 418 &miss, // When not a number. | |
| 419 &miss, // When index out of range. | |
| 420 STRING_INDEX_IS_ARRAY_INDEX); | |
| 421 char_at_generator.GenerateFast(masm); | |
| 422 __ ret(0); | |
| 423 | |
| 424 StubRuntimeCallHelper call_helper; | |
| 425 char_at_generator.GenerateSlow(masm, call_helper); | |
| 426 | |
| 427 __ bind(&miss); | |
| 428 GenerateMiss(masm); | |
| 429 } | |
| 430 | |
| 431 | |
| 432 static void KeyedStoreGenerateGenericHelper( | 406 static void KeyedStoreGenerateGenericHelper( |
| 433 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, | 407 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, |
| 434 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length) { | 408 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length) { |
| 435 Label transition_smi_elements; | 409 Label transition_smi_elements; |
| 436 Label finish_object_store, non_double_value, transition_double_elements; | 410 Label finish_object_store, non_double_value, transition_double_elements; |
| 437 Label fast_double_without_map_check; | 411 Label fast_double_without_map_check; |
| 438 Register receiver = StoreDescriptor::ReceiverRegister(); | 412 Register receiver = StoreDescriptor::ReceiverRegister(); |
| 439 Register key = StoreDescriptor::NameRegister(); | 413 Register key = StoreDescriptor::NameRegister(); |
| 440 Register value = StoreDescriptor::ValueRegister(); | 414 Register value = StoreDescriptor::ValueRegister(); |
| 441 DCHECK(receiver.is(rdx)); | 415 DCHECK(receiver.is(rdx)); |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 Condition cc = | 955 Condition cc = |
| 982 (check == ENABLE_INLINED_SMI_CHECK) | 956 (check == ENABLE_INLINED_SMI_CHECK) |
| 983 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 957 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
| 984 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 958 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
| 985 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 959 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
| 986 } | 960 } |
| 987 } | 961 } |
| 988 } // namespace v8::internal | 962 } // namespace v8::internal |
| 989 | 963 |
| 990 #endif // V8_TARGET_ARCH_X64 | 964 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |