OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1460 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, | 1460 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, |
1461 &miss, // When not a string. | 1461 &miss, // When not a string. |
1462 &miss, // When not a number. | 1462 &miss, // When not a number. |
1463 &miss, // When index out of range. | 1463 &miss, // When index out of range. |
1464 STRING_INDEX_IS_ARRAY_INDEX, | 1464 STRING_INDEX_IS_ARRAY_INDEX, |
1465 RECEIVER_IS_STRING); | 1465 RECEIVER_IS_STRING); |
1466 char_at_generator.GenerateFast(masm); | 1466 char_at_generator.GenerateFast(masm); |
1467 __ Ret(); | 1467 __ Ret(); |
1468 | 1468 |
1469 StubRuntimeCallHelper call_helper; | 1469 StubRuntimeCallHelper call_helper; |
1470 char_at_generator.GenerateSlow(masm, call_helper); | 1470 char_at_generator.GenerateSlow(masm, PART_OF_IC_HANDLER, call_helper); |
1471 | 1471 |
1472 __ Bind(&miss); | 1472 __ Bind(&miss); |
1473 PropertyAccessCompiler::TailCallBuiltin( | 1473 PropertyAccessCompiler::TailCallBuiltin( |
1474 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); | 1474 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); |
1475 } | 1475 } |
1476 | 1476 |
1477 | 1477 |
1478 void InstanceofStub::Generate(MacroAssembler* masm) { | 1478 void InstanceofStub::Generate(MacroAssembler* masm) { |
1479 // Stack on entry: | 1479 // Stack on entry: |
1480 // jssp[0]: function. | 1480 // jssp[0]: function. |
(...skipping 1814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3295 object_, | 3295 object_, |
3296 index_.W(), | 3296 index_.W(), |
3297 result_, | 3297 result_, |
3298 &call_runtime_); | 3298 &call_runtime_); |
3299 __ SmiTag(result_); | 3299 __ SmiTag(result_); |
3300 __ Bind(&exit_); | 3300 __ Bind(&exit_); |
3301 } | 3301 } |
3302 | 3302 |
3303 | 3303 |
3304 void StringCharCodeAtGenerator::GenerateSlow( | 3304 void StringCharCodeAtGenerator::GenerateSlow( |
3305 MacroAssembler* masm, | 3305 MacroAssembler* masm, EmbedMode embed_mode, |
3306 const RuntimeCallHelper& call_helper) { | 3306 const RuntimeCallHelper& call_helper) { |
3307 __ Abort(kUnexpectedFallthroughToCharCodeAtSlowCase); | 3307 __ Abort(kUnexpectedFallthroughToCharCodeAtSlowCase); |
3308 | 3308 |
3309 __ Bind(&index_not_smi_); | 3309 __ Bind(&index_not_smi_); |
3310 // If index is a heap number, try converting it to an integer. | 3310 // If index is a heap number, try converting it to an integer. |
3311 __ JumpIfNotHeapNumber(index_, index_not_number_); | 3311 __ JumpIfNotHeapNumber(index_, index_not_number_); |
3312 call_helper.BeforeCall(masm); | 3312 call_helper.BeforeCall(masm); |
3313 // Save object_ on the stack and pass index_ as argument for runtime call. | 3313 if (FLAG_vector_ics && embed_mode == PART_OF_IC_HANDLER) { |
3314 __ Push(object_, index_); | 3314 __ Push(VectorLoadICDescriptor::VectorRegister(), |
| 3315 VectorLoadICDescriptor::SlotRegister(), object_, index_); |
| 3316 } else { |
| 3317 // Save object_ on the stack and pass index_ as argument for runtime call. |
| 3318 __ Push(object_, index_); |
| 3319 } |
3315 if (index_flags_ == STRING_INDEX_IS_NUMBER) { | 3320 if (index_flags_ == STRING_INDEX_IS_NUMBER) { |
3316 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); | 3321 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); |
3317 } else { | 3322 } else { |
3318 DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); | 3323 DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); |
3319 // NumberToSmi discards numbers that are not exact integers. | 3324 // NumberToSmi discards numbers that are not exact integers. |
3320 __ CallRuntime(Runtime::kNumberToSmi, 1); | 3325 __ CallRuntime(Runtime::kNumberToSmi, 1); |
3321 } | 3326 } |
3322 // Save the conversion result before the pop instructions below | 3327 // Save the conversion result before the pop instructions below |
3323 // have a chance to overwrite it. | 3328 // have a chance to overwrite it. |
3324 __ Mov(index_, x0); | 3329 __ Mov(index_, x0); |
3325 __ Pop(object_); | 3330 if (FLAG_vector_ics && embed_mode == PART_OF_IC_HANDLER) { |
| 3331 __ Pop(object_, VectorLoadICDescriptor::SlotRegister(), |
| 3332 VectorLoadICDescriptor::VectorRegister()); |
| 3333 } else { |
| 3334 __ Pop(object_); |
| 3335 } |
3326 // Reload the instance type. | 3336 // Reload the instance type. |
3327 __ Ldr(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); | 3337 __ Ldr(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); |
3328 __ Ldrb(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); | 3338 __ Ldrb(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); |
3329 call_helper.AfterCall(masm); | 3339 call_helper.AfterCall(masm); |
3330 | 3340 |
3331 // If index is still not a smi, it must be out of range. | 3341 // If index is still not a smi, it must be out of range. |
3332 __ JumpIfNotSmi(index_, index_out_of_range_); | 3342 __ JumpIfNotSmi(index_, index_out_of_range_); |
3333 // Otherwise, return to the fast path. | 3343 // Otherwise, return to the fast path. |
3334 __ B(&got_smi_index_); | 3344 __ B(&got_smi_index_); |
3335 | 3345 |
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4653 Register scratch1 = x5; | 4663 Register scratch1 = x5; |
4654 | 4664 |
4655 __ Add(feedback, vector, Operand::UntagSmiAndScale(slot, kPointerSizeLog2)); | 4665 __ Add(feedback, vector, Operand::UntagSmiAndScale(slot, kPointerSizeLog2)); |
4656 __ Ldr(feedback, FieldMemOperand(feedback, FixedArray::kHeaderSize)); | 4666 __ Ldr(feedback, FieldMemOperand(feedback, FixedArray::kHeaderSize)); |
4657 | 4667 |
4658 // Is it a weak cell? | 4668 // Is it a weak cell? |
4659 Label try_array; | 4669 Label try_array; |
4660 Label not_array, smi_key, key_okay, miss; | 4670 Label not_array, smi_key, key_okay, miss; |
4661 __ Ldr(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); | 4671 __ Ldr(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); |
4662 __ JumpIfNotRoot(scratch1, Heap::kWeakCellMapRootIndex, &try_array); | 4672 __ JumpIfNotRoot(scratch1, Heap::kWeakCellMapRootIndex, &try_array); |
4663 __ JumpIfNotSmi(key, &miss); | |
4664 HandleMonomorphicCase(masm, receiver, key, vector, slot, feedback, scratch1, | 4673 HandleMonomorphicCase(masm, receiver, key, vector, slot, feedback, scratch1, |
4665 &miss); | 4674 &miss); |
4666 | 4675 |
4667 __ Bind(&try_array); | 4676 __ Bind(&try_array); |
4668 // Is it a fixed array? | 4677 // Is it a fixed array? |
4669 __ JumpIfNotRoot(scratch1, Heap::kFixedArrayMapRootIndex, ¬_array); | 4678 __ JumpIfNotRoot(scratch1, Heap::kFixedArrayMapRootIndex, ¬_array); |
| 4679 |
4670 // We have a polymorphic element handler. | 4680 // We have a polymorphic element handler. |
4671 __ JumpIfNotSmi(key, &miss); | |
4672 | |
4673 Label polymorphic, try_poly_name; | 4681 Label polymorphic, try_poly_name; |
4674 __ Bind(&polymorphic); | 4682 __ Bind(&polymorphic); |
4675 HandleArrayCases(masm, receiver, key, vector, slot, feedback, scratch1, x6, | 4683 HandleArrayCases(masm, receiver, key, vector, slot, feedback, scratch1, x6, |
4676 x7, true, &miss); | 4684 x7, true, &miss); |
4677 | 4685 |
4678 __ Bind(¬_array); | 4686 __ Bind(¬_array); |
4679 // Is it generic? | 4687 // Is it generic? |
4680 __ JumpIfNotRoot(feedback, Heap::kmegamorphic_symbolRootIndex, | 4688 __ JumpIfNotRoot(feedback, Heap::kmegamorphic_symbolRootIndex, |
4681 &try_poly_name); | 4689 &try_poly_name); |
4682 Handle<Code> megamorphic_stub = | 4690 Handle<Code> megamorphic_stub = |
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5737 kStackUnwindSpace, NULL, spill_offset, | 5745 kStackUnwindSpace, NULL, spill_offset, |
5738 MemOperand(fp, 6 * kPointerSize), NULL); | 5746 MemOperand(fp, 6 * kPointerSize), NULL); |
5739 } | 5747 } |
5740 | 5748 |
5741 | 5749 |
5742 #undef __ | 5750 #undef __ |
5743 | 5751 |
5744 } } // namespace v8::internal | 5752 } } // namespace v8::internal |
5745 | 5753 |
5746 #endif // V8_TARGET_ARCH_ARM64 | 5754 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |