| 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 1455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1466 __ Ret(HasArgsInRegisters() ? 0 : 2); | 1466 __ Ret(HasArgsInRegisters() ? 0 : 2); |
| 1467 } | 1467 } |
| 1468 } | 1468 } |
| 1469 | 1469 |
| 1470 | 1470 |
| 1471 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { | 1471 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { |
| 1472 Label miss; | 1472 Label miss; |
| 1473 Register receiver = LoadDescriptor::ReceiverRegister(); | 1473 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 1474 // Ensure that the vector and slot registers won't be clobbered before | 1474 // Ensure that the vector and slot registers won't be clobbered before |
| 1475 // calling the miss handler. | 1475 // calling the miss handler. |
| 1476 DCHECK(!FLAG_vector_ics || | 1476 DCHECK(!AreAliased(r4, r5, VectorLoadICDescriptor::VectorRegister(), |
| 1477 !AreAliased(r4, r5, VectorLoadICDescriptor::VectorRegister(), | |
| 1478 VectorLoadICDescriptor::SlotRegister())); | 1477 VectorLoadICDescriptor::SlotRegister())); |
| 1479 | 1478 |
| 1480 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, r4, | 1479 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, r4, |
| 1481 r5, &miss); | 1480 r5, &miss); |
| 1482 __ bind(&miss); | 1481 __ bind(&miss); |
| 1483 PropertyAccessCompiler::TailCallBuiltin( | 1482 PropertyAccessCompiler::TailCallBuiltin( |
| 1484 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); | 1483 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); |
| 1485 } | 1484 } |
| 1486 | 1485 |
| 1487 | 1486 |
| 1488 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { | 1487 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { |
| 1489 // Return address is in lr. | 1488 // Return address is in lr. |
| 1490 Label miss; | 1489 Label miss; |
| 1491 | 1490 |
| 1492 Register receiver = LoadDescriptor::ReceiverRegister(); | 1491 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 1493 Register index = LoadDescriptor::NameRegister(); | 1492 Register index = LoadDescriptor::NameRegister(); |
| 1494 Register scratch = r5; | 1493 Register scratch = r5; |
| 1495 Register result = r0; | 1494 Register result = r0; |
| 1496 DCHECK(!scratch.is(receiver) && !scratch.is(index)); | 1495 DCHECK(!scratch.is(receiver) && !scratch.is(index)); |
| 1497 DCHECK(!FLAG_vector_ics || | 1496 DCHECK(!scratch.is(VectorLoadICDescriptor::VectorRegister()) && |
| 1498 (!scratch.is(VectorLoadICDescriptor::VectorRegister()) && | 1497 result.is(VectorLoadICDescriptor::SlotRegister())); |
| 1499 result.is(VectorLoadICDescriptor::SlotRegister()))); | |
| 1500 | 1498 |
| 1501 // StringCharAtGenerator doesn't use the result register until it's passed | 1499 // StringCharAtGenerator doesn't use the result register until it's passed |
| 1502 // the different miss possibilities. If it did, we would have a conflict | 1500 // the different miss possibilities. If it did, we would have a conflict |
| 1503 // when FLAG_vector_ics is true. | 1501 // when FLAG_vector_ics is true. |
| 1504 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, | 1502 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, |
| 1505 &miss, // When not a string. | 1503 &miss, // When not a string. |
| 1506 &miss, // When not a number. | 1504 &miss, // When not a number. |
| 1507 &miss, // When index out of range. | 1505 &miss, // When index out of range. |
| 1508 STRING_INDEX_IS_ARRAY_INDEX, | 1506 STRING_INDEX_IS_ARRAY_INDEX, |
| 1509 RECEIVER_IS_STRING); | 1507 RECEIVER_IS_STRING); |
| (...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2930 | 2928 |
| 2931 // Index is not a smi. | 2929 // Index is not a smi. |
| 2932 __ bind(&index_not_smi_); | 2930 __ bind(&index_not_smi_); |
| 2933 // If index is a heap number, try converting it to an integer. | 2931 // If index is a heap number, try converting it to an integer. |
| 2934 __ CheckMap(index_, | 2932 __ CheckMap(index_, |
| 2935 result_, | 2933 result_, |
| 2936 Heap::kHeapNumberMapRootIndex, | 2934 Heap::kHeapNumberMapRootIndex, |
| 2937 index_not_number_, | 2935 index_not_number_, |
| 2938 DONT_DO_SMI_CHECK); | 2936 DONT_DO_SMI_CHECK); |
| 2939 call_helper.BeforeCall(masm); | 2937 call_helper.BeforeCall(masm); |
| 2940 if (FLAG_vector_ics && embed_mode == PART_OF_IC_HANDLER) { | 2938 if (embed_mode == PART_OF_IC_HANDLER) { |
| 2941 __ Push(VectorLoadICDescriptor::VectorRegister(), | 2939 __ Push(VectorLoadICDescriptor::VectorRegister(), |
| 2942 VectorLoadICDescriptor::SlotRegister(), object_, index_); | 2940 VectorLoadICDescriptor::SlotRegister(), object_, index_); |
| 2943 } else { | 2941 } else { |
| 2944 // index_ is consumed by runtime conversion function. | 2942 // index_ is consumed by runtime conversion function. |
| 2945 __ Push(object_, index_); | 2943 __ Push(object_, index_); |
| 2946 } | 2944 } |
| 2947 if (index_flags_ == STRING_INDEX_IS_NUMBER) { | 2945 if (index_flags_ == STRING_INDEX_IS_NUMBER) { |
| 2948 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); | 2946 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); |
| 2949 } else { | 2947 } else { |
| 2950 DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); | 2948 DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); |
| 2951 // NumberToSmi discards numbers that are not exact integers. | 2949 // NumberToSmi discards numbers that are not exact integers. |
| 2952 __ CallRuntime(Runtime::kNumberToSmi, 1); | 2950 __ CallRuntime(Runtime::kNumberToSmi, 1); |
| 2953 } | 2951 } |
| 2954 // Save the conversion result before the pop instructions below | 2952 // Save the conversion result before the pop instructions below |
| 2955 // have a chance to overwrite it. | 2953 // have a chance to overwrite it. |
| 2956 __ Move(index_, r0); | 2954 __ Move(index_, r0); |
| 2957 if (FLAG_vector_ics && embed_mode == PART_OF_IC_HANDLER) { | 2955 if (embed_mode == PART_OF_IC_HANDLER) { |
| 2958 __ Pop(VectorLoadICDescriptor::VectorRegister(), | 2956 __ Pop(VectorLoadICDescriptor::VectorRegister(), |
| 2959 VectorLoadICDescriptor::SlotRegister(), object_); | 2957 VectorLoadICDescriptor::SlotRegister(), object_); |
| 2960 } else { | 2958 } else { |
| 2961 __ pop(object_); | 2959 __ pop(object_); |
| 2962 } | 2960 } |
| 2963 // Reload the instance type. | 2961 // Reload the instance type. |
| 2964 __ ldr(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); | 2962 __ ldr(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); |
| 2965 __ ldrb(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); | 2963 __ ldrb(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); |
| 2966 call_helper.AfterCall(masm); | 2964 call_helper.AfterCall(masm); |
| 2967 // If index is still not a smi, it must be out of range. | 2965 // If index is still not a smi, it must be out of range. |
| (...skipping 2325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5293 kStackUnwindSpace, NULL, | 5291 kStackUnwindSpace, NULL, |
| 5294 MemOperand(fp, 6 * kPointerSize), NULL); | 5292 MemOperand(fp, 6 * kPointerSize), NULL); |
| 5295 } | 5293 } |
| 5296 | 5294 |
| 5297 | 5295 |
| 5298 #undef __ | 5296 #undef __ |
| 5299 | 5297 |
| 5300 } } // namespace v8::internal | 5298 } } // namespace v8::internal |
| 5301 | 5299 |
| 5302 #endif // V8_TARGET_ARCH_ARM | 5300 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |