| 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 1471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1482 __ Ret(HasArgsInRegisters() ? 0 : 2); | 1482 __ Ret(HasArgsInRegisters() ? 0 : 2); |
| 1483 } | 1483 } |
| 1484 } | 1484 } |
| 1485 | 1485 |
| 1486 | 1486 |
| 1487 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { | 1487 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { |
| 1488 Label miss; | 1488 Label miss; |
| 1489 Register receiver = LoadDescriptor::ReceiverRegister(); | 1489 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 1490 // Ensure that the vector and slot registers won't be clobbered before | 1490 // Ensure that the vector and slot registers won't be clobbered before |
| 1491 // calling the miss handler. | 1491 // calling the miss handler. |
| 1492 DCHECK(!FLAG_vector_ics || | 1492 DCHECK(!AreAliased(r4, r5, VectorLoadICDescriptor::VectorRegister(), |
| 1493 !AreAliased(r4, r5, VectorLoadICDescriptor::VectorRegister(), | |
| 1494 VectorLoadICDescriptor::SlotRegister())); | 1493 VectorLoadICDescriptor::SlotRegister())); |
| 1495 | 1494 |
| 1496 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, r4, | 1495 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, r4, |
| 1497 r5, &miss); | 1496 r5, &miss); |
| 1498 __ bind(&miss); | 1497 __ bind(&miss); |
| 1499 PropertyAccessCompiler::TailCallBuiltin( | 1498 PropertyAccessCompiler::TailCallBuiltin( |
| 1500 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); | 1499 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); |
| 1501 } | 1500 } |
| 1502 | 1501 |
| 1503 | 1502 |
| 1504 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { | 1503 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { |
| 1505 // Return address is in lr. | 1504 // Return address is in lr. |
| 1506 Label miss; | 1505 Label miss; |
| 1507 | 1506 |
| 1508 Register receiver = LoadDescriptor::ReceiverRegister(); | 1507 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 1509 Register index = LoadDescriptor::NameRegister(); | 1508 Register index = LoadDescriptor::NameRegister(); |
| 1510 Register scratch = r5; | 1509 Register scratch = r5; |
| 1511 Register result = r0; | 1510 Register result = r0; |
| 1512 DCHECK(!scratch.is(receiver) && !scratch.is(index)); | 1511 DCHECK(!scratch.is(receiver) && !scratch.is(index)); |
| 1513 DCHECK(!FLAG_vector_ics || | 1512 DCHECK(!scratch.is(VectorLoadICDescriptor::VectorRegister()) && |
| 1514 (!scratch.is(VectorLoadICDescriptor::VectorRegister()) && | 1513 result.is(VectorLoadICDescriptor::SlotRegister())); |
| 1515 result.is(VectorLoadICDescriptor::SlotRegister()))); | |
| 1516 | 1514 |
| 1517 // StringCharAtGenerator doesn't use the result register until it's passed | 1515 // StringCharAtGenerator doesn't use the result register until it's passed |
| 1518 // the different miss possibilities. If it did, we would have a conflict | 1516 // the different miss possibilities. If it did, we would have a conflict |
| 1519 // when FLAG_vector_ics is true. | 1517 // when FLAG_vector_ics is true. |
| 1520 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, | 1518 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, |
| 1521 &miss, // When not a string. | 1519 &miss, // When not a string. |
| 1522 &miss, // When not a number. | 1520 &miss, // When not a number. |
| 1523 &miss, // When index out of range. | 1521 &miss, // When index out of range. |
| 1524 STRING_INDEX_IS_ARRAY_INDEX, | 1522 STRING_INDEX_IS_ARRAY_INDEX, |
| 1525 RECEIVER_IS_STRING); | 1523 RECEIVER_IS_STRING); |
| (...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2946 | 2944 |
| 2947 // Index is not a smi. | 2945 // Index is not a smi. |
| 2948 __ bind(&index_not_smi_); | 2946 __ bind(&index_not_smi_); |
| 2949 // If index is a heap number, try converting it to an integer. | 2947 // If index is a heap number, try converting it to an integer. |
| 2950 __ CheckMap(index_, | 2948 __ CheckMap(index_, |
| 2951 result_, | 2949 result_, |
| 2952 Heap::kHeapNumberMapRootIndex, | 2950 Heap::kHeapNumberMapRootIndex, |
| 2953 index_not_number_, | 2951 index_not_number_, |
| 2954 DONT_DO_SMI_CHECK); | 2952 DONT_DO_SMI_CHECK); |
| 2955 call_helper.BeforeCall(masm); | 2953 call_helper.BeforeCall(masm); |
| 2956 if (FLAG_vector_ics && embed_mode == PART_OF_IC_HANDLER) { | 2954 if (embed_mode == PART_OF_IC_HANDLER) { |
| 2957 __ Push(VectorLoadICDescriptor::VectorRegister(), | 2955 __ Push(VectorLoadICDescriptor::VectorRegister(), |
| 2958 VectorLoadICDescriptor::SlotRegister(), object_, index_); | 2956 VectorLoadICDescriptor::SlotRegister(), object_, index_); |
| 2959 } else { | 2957 } else { |
| 2960 // index_ is consumed by runtime conversion function. | 2958 // index_ is consumed by runtime conversion function. |
| 2961 __ Push(object_, index_); | 2959 __ Push(object_, index_); |
| 2962 } | 2960 } |
| 2963 if (index_flags_ == STRING_INDEX_IS_NUMBER) { | 2961 if (index_flags_ == STRING_INDEX_IS_NUMBER) { |
| 2964 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); | 2962 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); |
| 2965 } else { | 2963 } else { |
| 2966 DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); | 2964 DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); |
| 2967 // NumberToSmi discards numbers that are not exact integers. | 2965 // NumberToSmi discards numbers that are not exact integers. |
| 2968 __ CallRuntime(Runtime::kNumberToSmi, 1); | 2966 __ CallRuntime(Runtime::kNumberToSmi, 1); |
| 2969 } | 2967 } |
| 2970 // Save the conversion result before the pop instructions below | 2968 // Save the conversion result before the pop instructions below |
| 2971 // have a chance to overwrite it. | 2969 // have a chance to overwrite it. |
| 2972 __ Move(index_, r0); | 2970 __ Move(index_, r0); |
| 2973 if (FLAG_vector_ics && embed_mode == PART_OF_IC_HANDLER) { | 2971 if (embed_mode == PART_OF_IC_HANDLER) { |
| 2974 __ Pop(VectorLoadICDescriptor::VectorRegister(), | 2972 __ Pop(VectorLoadICDescriptor::VectorRegister(), |
| 2975 VectorLoadICDescriptor::SlotRegister(), object_); | 2973 VectorLoadICDescriptor::SlotRegister(), object_); |
| 2976 } else { | 2974 } else { |
| 2977 __ pop(object_); | 2975 __ pop(object_); |
| 2978 } | 2976 } |
| 2979 // Reload the instance type. | 2977 // Reload the instance type. |
| 2980 __ ldr(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); | 2978 __ ldr(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); |
| 2981 __ ldrb(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); | 2979 __ ldrb(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); |
| 2982 call_helper.AfterCall(masm); | 2980 call_helper.AfterCall(masm); |
| 2983 // If index is still not a smi, it must be out of range. | 2981 // 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... |
| 5309 kStackUnwindSpace, NULL, | 5307 kStackUnwindSpace, NULL, |
| 5310 MemOperand(fp, 6 * kPointerSize), NULL); | 5308 MemOperand(fp, 6 * kPointerSize), NULL); |
| 5311 } | 5309 } |
| 5312 | 5310 |
| 5313 | 5311 |
| 5314 #undef __ | 5312 #undef __ |
| 5315 | 5313 |
| 5316 } } // namespace v8::internal | 5314 } } // namespace v8::internal |
| 5317 | 5315 |
| 5318 #endif // V8_TARGET_ARCH_ARM | 5316 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |