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_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1501 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, | 1501 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, |
1502 &miss, // When not a string. | 1502 &miss, // When not a string. |
1503 &miss, // When not a number. | 1503 &miss, // When not a number. |
1504 &miss, // When index out of range. | 1504 &miss, // When index out of range. |
1505 STRING_INDEX_IS_ARRAY_INDEX, | 1505 STRING_INDEX_IS_ARRAY_INDEX, |
1506 RECEIVER_IS_STRING); | 1506 RECEIVER_IS_STRING); |
1507 char_at_generator.GenerateFast(masm); | 1507 char_at_generator.GenerateFast(masm); |
1508 __ Ret(); | 1508 __ Ret(); |
1509 | 1509 |
1510 StubRuntimeCallHelper call_helper; | 1510 StubRuntimeCallHelper call_helper; |
1511 char_at_generator.GenerateSlow(masm, call_helper); | 1511 char_at_generator.GenerateSlow(masm, PART_OF_IC_HANDLER, call_helper); |
1512 | 1512 |
1513 __ bind(&miss); | 1513 __ bind(&miss); |
1514 PropertyAccessCompiler::TailCallBuiltin( | 1514 PropertyAccessCompiler::TailCallBuiltin( |
1515 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); | 1515 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); |
1516 } | 1516 } |
1517 | 1517 |
1518 | 1518 |
1519 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { | 1519 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { |
1520 CHECK(!has_new_target()); | 1520 CHECK(!has_new_target()); |
1521 // The displacement is the offset of the last parameter (if any) | 1521 // The displacement is the offset of the last parameter (if any) |
(...skipping 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2895 index_, | 2895 index_, |
2896 result_, | 2896 result_, |
2897 &call_runtime_); | 2897 &call_runtime_); |
2898 | 2898 |
2899 __ SmiTag(result_); | 2899 __ SmiTag(result_); |
2900 __ bind(&exit_); | 2900 __ bind(&exit_); |
2901 } | 2901 } |
2902 | 2902 |
2903 | 2903 |
2904 void StringCharCodeAtGenerator::GenerateSlow( | 2904 void StringCharCodeAtGenerator::GenerateSlow( |
2905 MacroAssembler* masm, | 2905 MacroAssembler* masm, EmbedMode embed_mode, |
2906 const RuntimeCallHelper& call_helper) { | 2906 const RuntimeCallHelper& call_helper) { |
2907 __ Abort(kUnexpectedFallthroughToCharCodeAtSlowCase); | 2907 __ Abort(kUnexpectedFallthroughToCharCodeAtSlowCase); |
2908 | 2908 |
2909 // Index is not a smi. | 2909 // Index is not a smi. |
2910 __ bind(&index_not_smi_); | 2910 __ bind(&index_not_smi_); |
2911 // If index is a heap number, try converting it to an integer. | 2911 // If index is a heap number, try converting it to an integer. |
2912 __ CheckMap(index_, | 2912 __ CheckMap(index_, |
2913 result_, | 2913 result_, |
2914 Heap::kHeapNumberMapRootIndex, | 2914 Heap::kHeapNumberMapRootIndex, |
2915 index_not_number_, | 2915 index_not_number_, |
2916 DONT_DO_SMI_CHECK); | 2916 DONT_DO_SMI_CHECK); |
2917 call_helper.BeforeCall(masm); | 2917 call_helper.BeforeCall(masm); |
2918 __ push(object_); | 2918 if (FLAG_vector_ics && embed_mode == PART_OF_IC_HANDLER) { |
2919 __ push(index_); // Consumed by runtime conversion function. | 2919 __ Push(VectorLoadICDescriptor::VectorRegister(), |
| 2920 VectorLoadICDescriptor::SlotRegister(), object_, index_); |
| 2921 } else { |
| 2922 // index_ is consumed by runtime conversion function. |
| 2923 __ Push(object_, index_); |
| 2924 } |
2920 if (index_flags_ == STRING_INDEX_IS_NUMBER) { | 2925 if (index_flags_ == STRING_INDEX_IS_NUMBER) { |
2921 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); | 2926 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); |
2922 } else { | 2927 } else { |
2923 DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); | 2928 DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); |
2924 // NumberToSmi discards numbers that are not exact integers. | 2929 // NumberToSmi discards numbers that are not exact integers. |
2925 __ CallRuntime(Runtime::kNumberToSmi, 1); | 2930 __ CallRuntime(Runtime::kNumberToSmi, 1); |
2926 } | 2931 } |
2927 // Save the conversion result before the pop instructions below | 2932 // Save the conversion result before the pop instructions below |
2928 // have a chance to overwrite it. | 2933 // have a chance to overwrite it. |
2929 __ Move(index_, r0); | 2934 __ Move(index_, r0); |
2930 __ pop(object_); | 2935 if (FLAG_vector_ics && embed_mode == PART_OF_IC_HANDLER) { |
| 2936 __ Pop(VectorLoadICDescriptor::VectorRegister(), |
| 2937 VectorLoadICDescriptor::SlotRegister(), object_); |
| 2938 } else { |
| 2939 __ pop(object_); |
| 2940 } |
2931 // Reload the instance type. | 2941 // Reload the instance type. |
2932 __ ldr(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); | 2942 __ ldr(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); |
2933 __ ldrb(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); | 2943 __ ldrb(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); |
2934 call_helper.AfterCall(masm); | 2944 call_helper.AfterCall(masm); |
2935 // If index is still not a smi, it must be out of range. | 2945 // If index is still not a smi, it must be out of range. |
2936 __ JumpIfNotSmi(index_, index_out_of_range_); | 2946 __ JumpIfNotSmi(index_, index_out_of_range_); |
2937 // Otherwise, return to the fast path. | 2947 // Otherwise, return to the fast path. |
2938 __ jmp(&got_smi_index_); | 2948 __ jmp(&got_smi_index_); |
2939 | 2949 |
2940 // Call runtime. We get here when the receiver is a string and the | 2950 // Call runtime. We get here when the receiver is a string and the |
(...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4528 | 4538 |
4529 __ add(feedback, vector, Operand::PointerOffsetFromSmiKey(slot)); | 4539 __ add(feedback, vector, Operand::PointerOffsetFromSmiKey(slot)); |
4530 __ ldr(feedback, FieldMemOperand(feedback, FixedArray::kHeaderSize)); | 4540 __ ldr(feedback, FieldMemOperand(feedback, FixedArray::kHeaderSize)); |
4531 | 4541 |
4532 // Is it a weak cell? | 4542 // Is it a weak cell? |
4533 Label try_array; | 4543 Label try_array; |
4534 Label not_array, smi_key, key_okay, miss; | 4544 Label not_array, smi_key, key_okay, miss; |
4535 __ ldr(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); | 4545 __ ldr(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); |
4536 __ CompareRoot(scratch1, Heap::kWeakCellMapRootIndex); | 4546 __ CompareRoot(scratch1, Heap::kWeakCellMapRootIndex); |
4537 __ b(ne, &try_array); | 4547 __ b(ne, &try_array); |
4538 __ JumpIfNotSmi(key, &miss); | |
4539 HandleMonomorphicCase(masm, receiver, key, vector, slot, feedback, scratch1, | 4548 HandleMonomorphicCase(masm, receiver, key, vector, slot, feedback, scratch1, |
4540 &miss); | 4549 &miss); |
4541 | 4550 |
4542 __ bind(&try_array); | 4551 __ bind(&try_array); |
4543 // Is it a fixed array? | 4552 // Is it a fixed array? |
4544 __ CompareRoot(scratch1, Heap::kFixedArrayMapRootIndex); | 4553 __ CompareRoot(scratch1, Heap::kFixedArrayMapRootIndex); |
4545 __ b(ne, ¬_array); | 4554 __ b(ne, ¬_array); |
| 4555 |
4546 // We have a polymorphic element handler. | 4556 // We have a polymorphic element handler. |
4547 __ JumpIfNotSmi(key, &miss); | |
4548 | |
4549 Label polymorphic, try_poly_name; | 4557 Label polymorphic, try_poly_name; |
4550 __ bind(&polymorphic); | 4558 __ bind(&polymorphic); |
4551 HandleArrayCases(masm, receiver, key, vector, slot, feedback, scratch1, r8, | 4559 HandleArrayCases(masm, receiver, key, vector, slot, feedback, scratch1, r8, |
4552 r9, true, &miss); | 4560 r9, true, &miss); |
4553 | 4561 |
4554 __ bind(¬_array); | 4562 __ bind(¬_array); |
4555 // Is it generic? | 4563 // Is it generic? |
4556 __ CompareRoot(feedback, Heap::kmegamorphic_symbolRootIndex); | 4564 __ CompareRoot(feedback, Heap::kmegamorphic_symbolRootIndex); |
4557 __ b(ne, &try_poly_name); | 4565 __ b(ne, &try_poly_name); |
4558 Handle<Code> megamorphic_stub = | 4566 Handle<Code> megamorphic_stub = |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5277 kStackUnwindSpace, NULL, | 5285 kStackUnwindSpace, NULL, |
5278 MemOperand(fp, 6 * kPointerSize), NULL); | 5286 MemOperand(fp, 6 * kPointerSize), NULL); |
5279 } | 5287 } |
5280 | 5288 |
5281 | 5289 |
5282 #undef __ | 5290 #undef __ |
5283 | 5291 |
5284 } } // namespace v8::internal | 5292 } } // namespace v8::internal |
5285 | 5293 |
5286 #endif // V8_TARGET_ARCH_ARM | 5294 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |