Chromium Code Reviews| 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 if (FLAG_vector_ics && embed_mode == PART_OF_IC_HANDLER) { | |
| 2919 __ push(VectorLoadICDescriptor::VectorRegister()); | |
|
Yang
2015/03/23 14:23:59
If you use Push to push both registers at once, yo
mvstanton
2015/03/23 15:54:44
Good idea, and I went further and do one push inst
| |
| 2920 __ push(VectorLoadICDescriptor::SlotRegister()); | |
| 2921 } | |
| 2918 __ push(object_); | 2922 __ push(object_); |
| 2919 __ push(index_); // Consumed by runtime conversion function. | 2923 __ push(index_); // Consumed by runtime conversion function. |
| 2920 if (index_flags_ == STRING_INDEX_IS_NUMBER) { | 2924 if (index_flags_ == STRING_INDEX_IS_NUMBER) { |
| 2921 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); | 2925 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); |
| 2922 } else { | 2926 } else { |
| 2923 DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); | 2927 DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); |
| 2924 // NumberToSmi discards numbers that are not exact integers. | 2928 // NumberToSmi discards numbers that are not exact integers. |
| 2925 __ CallRuntime(Runtime::kNumberToSmi, 1); | 2929 __ CallRuntime(Runtime::kNumberToSmi, 1); |
| 2926 } | 2930 } |
| 2927 // Save the conversion result before the pop instructions below | 2931 // Save the conversion result before the pop instructions below |
| 2928 // have a chance to overwrite it. | 2932 // have a chance to overwrite it. |
| 2929 __ Move(index_, r0); | 2933 __ Move(index_, r0); |
| 2930 __ pop(object_); | 2934 __ pop(object_); |
| 2935 if (FLAG_vector_ics && embed_mode == PART_OF_IC_HANDLER) { | |
| 2936 __ pop(VectorLoadICDescriptor::SlotRegister()); | |
| 2937 __ pop(VectorLoadICDescriptor::VectorRegister()); | |
| 2938 } | |
| 2931 // Reload the instance type. | 2939 // Reload the instance type. |
| 2932 __ ldr(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); | 2940 __ ldr(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); |
| 2933 __ ldrb(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); | 2941 __ ldrb(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); |
| 2934 call_helper.AfterCall(masm); | 2942 call_helper.AfterCall(masm); |
| 2935 // If index is still not a smi, it must be out of range. | 2943 // If index is still not a smi, it must be out of range. |
| 2936 __ JumpIfNotSmi(index_, index_out_of_range_); | 2944 __ JumpIfNotSmi(index_, index_out_of_range_); |
| 2937 // Otherwise, return to the fast path. | 2945 // Otherwise, return to the fast path. |
| 2938 __ jmp(&got_smi_index_); | 2946 __ jmp(&got_smi_index_); |
| 2939 | 2947 |
| 2940 // Call runtime. We get here when the receiver is a string and the | 2948 // 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 | 4536 |
| 4529 __ add(feedback, vector, Operand::PointerOffsetFromSmiKey(slot)); | 4537 __ add(feedback, vector, Operand::PointerOffsetFromSmiKey(slot)); |
| 4530 __ ldr(feedback, FieldMemOperand(feedback, FixedArray::kHeaderSize)); | 4538 __ ldr(feedback, FieldMemOperand(feedback, FixedArray::kHeaderSize)); |
| 4531 | 4539 |
| 4532 // Is it a weak cell? | 4540 // Is it a weak cell? |
| 4533 Label try_array; | 4541 Label try_array; |
| 4534 Label not_array, smi_key, key_okay, miss; | 4542 Label not_array, smi_key, key_okay, miss; |
| 4535 __ ldr(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); | 4543 __ ldr(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); |
| 4536 __ CompareRoot(scratch1, Heap::kWeakCellMapRootIndex); | 4544 __ CompareRoot(scratch1, Heap::kWeakCellMapRootIndex); |
| 4537 __ b(ne, &try_array); | 4545 __ b(ne, &try_array); |
| 4538 __ JumpIfNotSmi(key, &miss); | |
| 4539 HandleMonomorphicCase(masm, receiver, key, vector, slot, feedback, scratch1, | 4546 HandleMonomorphicCase(masm, receiver, key, vector, slot, feedback, scratch1, |
| 4540 &miss); | 4547 &miss); |
| 4541 | 4548 |
| 4542 __ bind(&try_array); | 4549 __ bind(&try_array); |
| 4543 // Is it a fixed array? | 4550 // Is it a fixed array? |
| 4544 __ CompareRoot(scratch1, Heap::kFixedArrayMapRootIndex); | 4551 __ CompareRoot(scratch1, Heap::kFixedArrayMapRootIndex); |
| 4545 __ b(ne, ¬_array); | 4552 __ b(ne, ¬_array); |
| 4553 | |
| 4546 // We have a polymorphic element handler. | 4554 // We have a polymorphic element handler. |
| 4547 __ JumpIfNotSmi(key, &miss); | |
| 4548 | |
| 4549 Label polymorphic, try_poly_name; | 4555 Label polymorphic, try_poly_name; |
| 4550 __ bind(&polymorphic); | 4556 __ bind(&polymorphic); |
| 4551 HandleArrayCases(masm, receiver, key, vector, slot, feedback, scratch1, r8, | 4557 HandleArrayCases(masm, receiver, key, vector, slot, feedback, scratch1, r8, |
| 4552 r9, true, &miss); | 4558 r9, true, &miss); |
| 4553 | 4559 |
| 4554 __ bind(¬_array); | 4560 __ bind(¬_array); |
| 4555 // Is it generic? | 4561 // Is it generic? |
| 4556 __ CompareRoot(feedback, Heap::kmegamorphic_symbolRootIndex); | 4562 __ CompareRoot(feedback, Heap::kmegamorphic_symbolRootIndex); |
| 4557 __ b(ne, &try_poly_name); | 4563 __ b(ne, &try_poly_name); |
| 4558 Handle<Code> megamorphic_stub = | 4564 Handle<Code> megamorphic_stub = |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5277 kStackUnwindSpace, NULL, | 5283 kStackUnwindSpace, NULL, |
| 5278 MemOperand(fp, 6 * kPointerSize), NULL); | 5284 MemOperand(fp, 6 * kPointerSize), NULL); |
| 5279 } | 5285 } |
| 5280 | 5286 |
| 5281 | 5287 |
| 5282 #undef __ | 5288 #undef __ |
| 5283 | 5289 |
| 5284 } } // namespace v8::internal | 5290 } } // namespace v8::internal |
| 5285 | 5291 |
| 5286 #endif // V8_TARGET_ARCH_ARM | 5292 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |