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 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1426 // register which we have just restored. | 1426 // register which we have just restored. |
1427 __ Ret(); | 1427 __ Ret(); |
1428 } | 1428 } |
1429 | 1429 |
1430 | 1430 |
1431 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { | 1431 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { |
1432 Label miss; | 1432 Label miss; |
1433 Register receiver = LoadDescriptor::ReceiverRegister(); | 1433 Register receiver = LoadDescriptor::ReceiverRegister(); |
1434 // Ensure that the vector and slot registers won't be clobbered before | 1434 // Ensure that the vector and slot registers won't be clobbered before |
1435 // calling the miss handler. | 1435 // calling the miss handler. |
1436 DCHECK(!FLAG_vector_ics || | 1436 DCHECK(!AreAliased(x10, x11, VectorLoadICDescriptor::VectorRegister(), |
1437 !AreAliased(x10, x11, VectorLoadICDescriptor::VectorRegister(), | |
1438 VectorLoadICDescriptor::SlotRegister())); | 1437 VectorLoadICDescriptor::SlotRegister())); |
1439 | 1438 |
1440 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, x10, | 1439 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, x10, |
1441 x11, &miss); | 1440 x11, &miss); |
1442 | 1441 |
1443 __ Bind(&miss); | 1442 __ Bind(&miss); |
1444 PropertyAccessCompiler::TailCallBuiltin( | 1443 PropertyAccessCompiler::TailCallBuiltin( |
1445 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); | 1444 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); |
1446 } | 1445 } |
1447 | 1446 |
1448 | 1447 |
1449 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { | 1448 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { |
1450 // Return address is in lr. | 1449 // Return address is in lr. |
1451 Label miss; | 1450 Label miss; |
1452 | 1451 |
1453 Register receiver = LoadDescriptor::ReceiverRegister(); | 1452 Register receiver = LoadDescriptor::ReceiverRegister(); |
1454 Register index = LoadDescriptor::NameRegister(); | 1453 Register index = LoadDescriptor::NameRegister(); |
1455 Register result = x0; | 1454 Register result = x0; |
1456 Register scratch = x10; | 1455 Register scratch = x10; |
1457 DCHECK(!scratch.is(receiver) && !scratch.is(index)); | 1456 DCHECK(!scratch.is(receiver) && !scratch.is(index)); |
1458 DCHECK(!FLAG_vector_ics || | 1457 DCHECK(!scratch.is(VectorLoadICDescriptor::VectorRegister()) && |
1459 (!scratch.is(VectorLoadICDescriptor::VectorRegister()) && | 1458 result.is(VectorLoadICDescriptor::SlotRegister())); |
1460 result.is(VectorLoadICDescriptor::SlotRegister()))); | |
1461 | 1459 |
1462 // StringCharAtGenerator doesn't use the result register until it's passed | 1460 // StringCharAtGenerator doesn't use the result register until it's passed |
1463 // the different miss possibilities. If it did, we would have a conflict | 1461 // the different miss possibilities. If it did, we would have a conflict |
1464 // when FLAG_vector_ics is true. | 1462 // when FLAG_vector_ics is true. |
1465 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, | 1463 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, |
1466 &miss, // When not a string. | 1464 &miss, // When not a string. |
1467 &miss, // When not a number. | 1465 &miss, // When not a number. |
1468 &miss, // When index out of range. | 1466 &miss, // When index out of range. |
1469 STRING_INDEX_IS_ARRAY_INDEX, | 1467 STRING_INDEX_IS_ARRAY_INDEX, |
1470 RECEIVER_IS_STRING); | 1468 RECEIVER_IS_STRING); |
(...skipping 1860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3331 | 3329 |
3332 void StringCharCodeAtGenerator::GenerateSlow( | 3330 void StringCharCodeAtGenerator::GenerateSlow( |
3333 MacroAssembler* masm, EmbedMode embed_mode, | 3331 MacroAssembler* masm, EmbedMode embed_mode, |
3334 const RuntimeCallHelper& call_helper) { | 3332 const RuntimeCallHelper& call_helper) { |
3335 __ Abort(kUnexpectedFallthroughToCharCodeAtSlowCase); | 3333 __ Abort(kUnexpectedFallthroughToCharCodeAtSlowCase); |
3336 | 3334 |
3337 __ Bind(&index_not_smi_); | 3335 __ Bind(&index_not_smi_); |
3338 // If index is a heap number, try converting it to an integer. | 3336 // If index is a heap number, try converting it to an integer. |
3339 __ JumpIfNotHeapNumber(index_, index_not_number_); | 3337 __ JumpIfNotHeapNumber(index_, index_not_number_); |
3340 call_helper.BeforeCall(masm); | 3338 call_helper.BeforeCall(masm); |
3341 if (FLAG_vector_ics && embed_mode == PART_OF_IC_HANDLER) { | 3339 if (embed_mode == PART_OF_IC_HANDLER) { |
3342 __ Push(VectorLoadICDescriptor::VectorRegister(), | 3340 __ Push(VectorLoadICDescriptor::VectorRegister(), |
3343 VectorLoadICDescriptor::SlotRegister(), object_, index_); | 3341 VectorLoadICDescriptor::SlotRegister(), object_, index_); |
3344 } else { | 3342 } else { |
3345 // Save object_ on the stack and pass index_ as argument for runtime call. | 3343 // Save object_ on the stack and pass index_ as argument for runtime call. |
3346 __ Push(object_, index_); | 3344 __ Push(object_, index_); |
3347 } | 3345 } |
3348 if (index_flags_ == STRING_INDEX_IS_NUMBER) { | 3346 if (index_flags_ == STRING_INDEX_IS_NUMBER) { |
3349 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); | 3347 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); |
3350 } else { | 3348 } else { |
3351 DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); | 3349 DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); |
3352 // NumberToSmi discards numbers that are not exact integers. | 3350 // NumberToSmi discards numbers that are not exact integers. |
3353 __ CallRuntime(Runtime::kNumberToSmi, 1); | 3351 __ CallRuntime(Runtime::kNumberToSmi, 1); |
3354 } | 3352 } |
3355 // Save the conversion result before the pop instructions below | 3353 // Save the conversion result before the pop instructions below |
3356 // have a chance to overwrite it. | 3354 // have a chance to overwrite it. |
3357 __ Mov(index_, x0); | 3355 __ Mov(index_, x0); |
3358 if (FLAG_vector_ics && embed_mode == PART_OF_IC_HANDLER) { | 3356 if (embed_mode == PART_OF_IC_HANDLER) { |
3359 __ Pop(object_, VectorLoadICDescriptor::SlotRegister(), | 3357 __ Pop(object_, VectorLoadICDescriptor::SlotRegister(), |
3360 VectorLoadICDescriptor::VectorRegister()); | 3358 VectorLoadICDescriptor::VectorRegister()); |
3361 } else { | 3359 } else { |
3362 __ Pop(object_); | 3360 __ Pop(object_); |
3363 } | 3361 } |
3364 // Reload the instance type. | 3362 // Reload the instance type. |
3365 __ Ldr(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); | 3363 __ Ldr(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); |
3366 __ Ldrb(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); | 3364 __ Ldrb(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); |
3367 call_helper.AfterCall(masm); | 3365 call_helper.AfterCall(masm); |
3368 | 3366 |
(...skipping 2392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5761 kStackUnwindSpace, NULL, spill_offset, | 5759 kStackUnwindSpace, NULL, spill_offset, |
5762 MemOperand(fp, 6 * kPointerSize), NULL); | 5760 MemOperand(fp, 6 * kPointerSize), NULL); |
5763 } | 5761 } |
5764 | 5762 |
5765 | 5763 |
5766 #undef __ | 5764 #undef __ |
5767 | 5765 |
5768 } } // namespace v8::internal | 5766 } } // namespace v8::internal |
5769 | 5767 |
5770 #endif // V8_TARGET_ARCH_ARM64 | 5768 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |