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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
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 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 | 1379 |
1380 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { | 1380 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { |
1381 // Return address is in ra. | 1381 // Return address is in ra. |
1382 Label miss; | 1382 Label miss; |
1383 | 1383 |
1384 Register receiver = LoadDescriptor::ReceiverRegister(); | 1384 Register receiver = LoadDescriptor::ReceiverRegister(); |
1385 Register index = LoadDescriptor::NameRegister(); | 1385 Register index = LoadDescriptor::NameRegister(); |
1386 Register scratch = a5; | 1386 Register scratch = a5; |
1387 Register result = v0; | 1387 Register result = v0; |
1388 DCHECK(!scratch.is(receiver) && !scratch.is(index)); | 1388 DCHECK(!scratch.is(receiver) && !scratch.is(index)); |
1389 DCHECK(!FLAG_vector_ics || | 1389 DCHECK(!scratch.is(VectorLoadICDescriptor::VectorRegister())); |
1390 !scratch.is(VectorLoadICDescriptor::VectorRegister())); | |
1391 | 1390 |
1392 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, | 1391 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, |
1393 &miss, // When not a string. | 1392 &miss, // When not a string. |
1394 &miss, // When not a number. | 1393 &miss, // When not a number. |
1395 &miss, // When index out of range. | 1394 &miss, // When index out of range. |
1396 STRING_INDEX_IS_ARRAY_INDEX, | 1395 STRING_INDEX_IS_ARRAY_INDEX, |
1397 RECEIVER_IS_STRING); | 1396 RECEIVER_IS_STRING); |
1398 char_at_generator.GenerateFast(masm); | 1397 char_at_generator.GenerateFast(masm); |
1399 __ Ret(); | 1398 __ Ret(); |
1400 | 1399 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1604 __ DropAndRet(HasArgsInRegisters() ? 0 : 2); | 1603 __ DropAndRet(HasArgsInRegisters() ? 0 : 2); |
1605 } | 1604 } |
1606 } | 1605 } |
1607 | 1606 |
1608 | 1607 |
1609 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { | 1608 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { |
1610 Label miss; | 1609 Label miss; |
1611 Register receiver = LoadDescriptor::ReceiverRegister(); | 1610 Register receiver = LoadDescriptor::ReceiverRegister(); |
1612 // Ensure that the vector and slot registers won't be clobbered before | 1611 // Ensure that the vector and slot registers won't be clobbered before |
1613 // calling the miss handler. | 1612 // calling the miss handler. |
1614 DCHECK(!FLAG_vector_ics || | 1613 DCHECK(!AreAliased(a4, a5, VectorLoadICDescriptor::VectorRegister(), |
1615 !AreAliased(a4, a5, VectorLoadICDescriptor::VectorRegister(), | |
1616 VectorLoadICDescriptor::SlotRegister())); | 1614 VectorLoadICDescriptor::SlotRegister())); |
1617 | 1615 |
1618 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, a4, | 1616 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, a4, |
1619 a5, &miss); | 1617 a5, &miss); |
1620 __ bind(&miss); | 1618 __ bind(&miss); |
1621 PropertyAccessCompiler::TailCallBuiltin( | 1619 PropertyAccessCompiler::TailCallBuiltin( |
1622 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); | 1620 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); |
1623 } | 1621 } |
1624 | 1622 |
1625 | 1623 |
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3124 // Index is not a smi. | 3122 // Index is not a smi. |
3125 __ bind(&index_not_smi_); | 3123 __ bind(&index_not_smi_); |
3126 // If index is a heap number, try converting it to an integer. | 3124 // If index is a heap number, try converting it to an integer. |
3127 __ CheckMap(index_, | 3125 __ CheckMap(index_, |
3128 result_, | 3126 result_, |
3129 Heap::kHeapNumberMapRootIndex, | 3127 Heap::kHeapNumberMapRootIndex, |
3130 index_not_number_, | 3128 index_not_number_, |
3131 DONT_DO_SMI_CHECK); | 3129 DONT_DO_SMI_CHECK); |
3132 call_helper.BeforeCall(masm); | 3130 call_helper.BeforeCall(masm); |
3133 // Consumed by runtime conversion function: | 3131 // Consumed by runtime conversion function: |
3134 if (FLAG_vector_ics && embed_mode == PART_OF_IC_HANDLER) { | 3132 if (embed_mode == PART_OF_IC_HANDLER) { |
3135 __ Push(VectorLoadICDescriptor::VectorRegister(), | 3133 __ Push(VectorLoadICDescriptor::VectorRegister(), |
3136 VectorLoadICDescriptor::SlotRegister(), object_, index_); | 3134 VectorLoadICDescriptor::SlotRegister(), object_, index_); |
3137 } else { | 3135 } else { |
3138 __ Push(object_, index_); | 3136 __ Push(object_, index_); |
3139 } | 3137 } |
3140 if (index_flags_ == STRING_INDEX_IS_NUMBER) { | 3138 if (index_flags_ == STRING_INDEX_IS_NUMBER) { |
3141 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); | 3139 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); |
3142 } else { | 3140 } else { |
3143 DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); | 3141 DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); |
3144 // NumberToSmi discards numbers that are not exact integers. | 3142 // NumberToSmi discards numbers that are not exact integers. |
3145 __ CallRuntime(Runtime::kNumberToSmi, 1); | 3143 __ CallRuntime(Runtime::kNumberToSmi, 1); |
3146 } | 3144 } |
3147 | 3145 |
3148 // Save the conversion result before the pop instructions below | 3146 // Save the conversion result before the pop instructions below |
3149 // have a chance to overwrite it. | 3147 // have a chance to overwrite it. |
3150 | 3148 |
3151 __ Move(index_, v0); | 3149 __ Move(index_, v0); |
3152 if (FLAG_vector_ics && embed_mode == PART_OF_IC_HANDLER) { | 3150 if (embed_mode == PART_OF_IC_HANDLER) { |
3153 __ Pop(VectorLoadICDescriptor::VectorRegister(), | 3151 __ Pop(VectorLoadICDescriptor::VectorRegister(), |
3154 VectorLoadICDescriptor::SlotRegister(), object_); | 3152 VectorLoadICDescriptor::SlotRegister(), object_); |
3155 } else { | 3153 } else { |
3156 __ pop(object_); | 3154 __ pop(object_); |
3157 } | 3155 } |
3158 // Reload the instance type. | 3156 // Reload the instance type. |
3159 __ ld(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); | 3157 __ ld(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); |
3160 __ lbu(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); | 3158 __ lbu(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); |
3161 call_helper.AfterCall(masm); | 3159 call_helper.AfterCall(masm); |
3162 // If index is still not a smi, it must be out of range. | 3160 // If index is still not a smi, it must be out of range. |
(...skipping 2395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5558 kStackUnwindSpace, kInvalidStackOffset, | 5556 kStackUnwindSpace, kInvalidStackOffset, |
5559 MemOperand(fp, 6 * kPointerSize), NULL); | 5557 MemOperand(fp, 6 * kPointerSize), NULL); |
5560 } | 5558 } |
5561 | 5559 |
5562 | 5560 |
5563 #undef __ | 5561 #undef __ |
5564 | 5562 |
5565 } } // namespace v8::internal | 5563 } } // namespace v8::internal |
5566 | 5564 |
5567 #endif // V8_TARGET_ARCH_MIPS64 | 5565 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |