| 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 #if V8_TARGET_ARCH_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
| 6 | 6 |
| 7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
| 8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1421 Register index = LoadDescriptor::NameRegister(); | 1421 Register index = LoadDescriptor::NameRegister(); |
| 1422 Register scratch = t1; | 1422 Register scratch = t1; |
| 1423 Register result = v0; | 1423 Register result = v0; |
| 1424 DCHECK(!scratch.is(receiver) && !scratch.is(index)); | 1424 DCHECK(!scratch.is(receiver) && !scratch.is(index)); |
| 1425 DCHECK(!scratch.is(LoadWithVectorDescriptor::VectorRegister())); | 1425 DCHECK(!scratch.is(LoadWithVectorDescriptor::VectorRegister())); |
| 1426 | 1426 |
| 1427 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, | 1427 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, |
| 1428 &miss, // When not a string. | 1428 &miss, // When not a string. |
| 1429 &miss, // When not a number. | 1429 &miss, // When not a number. |
| 1430 &miss, // When index out of range. | 1430 &miss, // When index out of range. |
| 1431 STRING_INDEX_IS_ARRAY_INDEX, | |
| 1432 RECEIVER_IS_STRING); | 1431 RECEIVER_IS_STRING); |
| 1433 char_at_generator.GenerateFast(masm); | 1432 char_at_generator.GenerateFast(masm); |
| 1434 __ Ret(); | 1433 __ Ret(); |
| 1435 | 1434 |
| 1436 StubRuntimeCallHelper call_helper; | 1435 StubRuntimeCallHelper call_helper; |
| 1437 char_at_generator.GenerateSlow(masm, PART_OF_IC_HANDLER, call_helper); | 1436 char_at_generator.GenerateSlow(masm, PART_OF_IC_HANDLER, call_helper); |
| 1438 | 1437 |
| 1439 __ bind(&miss); | 1438 __ bind(&miss); |
| 1440 PropertyAccessCompiler::TailCallBuiltin( | 1439 PropertyAccessCompiler::TailCallBuiltin( |
| 1441 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); | 1440 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2267 index_not_number_, | 2266 index_not_number_, |
| 2268 DONT_DO_SMI_CHECK); | 2267 DONT_DO_SMI_CHECK); |
| 2269 call_helper.BeforeCall(masm); | 2268 call_helper.BeforeCall(masm); |
| 2270 // Consumed by runtime conversion function: | 2269 // Consumed by runtime conversion function: |
| 2271 if (embed_mode == PART_OF_IC_HANDLER) { | 2270 if (embed_mode == PART_OF_IC_HANDLER) { |
| 2272 __ Push(LoadWithVectorDescriptor::VectorRegister(), | 2271 __ Push(LoadWithVectorDescriptor::VectorRegister(), |
| 2273 LoadWithVectorDescriptor::SlotRegister(), object_, index_); | 2272 LoadWithVectorDescriptor::SlotRegister(), object_, index_); |
| 2274 } else { | 2273 } else { |
| 2275 __ Push(object_, index_); | 2274 __ Push(object_, index_); |
| 2276 } | 2275 } |
| 2277 if (index_flags_ == STRING_INDEX_IS_NUMBER) { | 2276 __ CallRuntime(Runtime::kNumberToSmi); |
| 2278 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero); | |
| 2279 } else { | |
| 2280 DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); | |
| 2281 // NumberToSmi discards numbers that are not exact integers. | |
| 2282 __ CallRuntime(Runtime::kNumberToSmi); | |
| 2283 } | |
| 2284 | 2277 |
| 2285 // Save the conversion result before the pop instructions below | 2278 // Save the conversion result before the pop instructions below |
| 2286 // have a chance to overwrite it. | 2279 // have a chance to overwrite it. |
| 2287 __ Move(index_, v0); | 2280 __ Move(index_, v0); |
| 2288 if (embed_mode == PART_OF_IC_HANDLER) { | 2281 if (embed_mode == PART_OF_IC_HANDLER) { |
| 2289 __ Pop(LoadWithVectorDescriptor::VectorRegister(), | 2282 __ Pop(LoadWithVectorDescriptor::VectorRegister(), |
| 2290 LoadWithVectorDescriptor::SlotRegister(), object_); | 2283 LoadWithVectorDescriptor::SlotRegister(), object_); |
| 2291 } else { | 2284 } else { |
| 2292 __ pop(object_); | 2285 __ pop(object_); |
| 2293 } | 2286 } |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2615 __ bind(&runtime); | 2608 __ bind(&runtime); |
| 2616 __ TailCallRuntime(Runtime::kSubString); | 2609 __ TailCallRuntime(Runtime::kSubString); |
| 2617 | 2610 |
| 2618 __ bind(&single_char); | 2611 __ bind(&single_char); |
| 2619 // v0: original string | 2612 // v0: original string |
| 2620 // a1: instance type | 2613 // a1: instance type |
| 2621 // a2: length | 2614 // a2: length |
| 2622 // a3: from index (untagged) | 2615 // a3: from index (untagged) |
| 2623 __ SmiTag(a3, a3); | 2616 __ SmiTag(a3, a3); |
| 2624 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, | 2617 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, |
| 2625 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); | 2618 RECEIVER_IS_STRING); |
| 2626 generator.GenerateFast(masm); | 2619 generator.GenerateFast(masm); |
| 2627 __ DropAndRet(3); | 2620 __ DropAndRet(3); |
| 2628 generator.SkipSlow(masm, &runtime); | 2621 generator.SkipSlow(masm, &runtime); |
| 2629 } | 2622 } |
| 2630 | 2623 |
| 2631 | 2624 |
| 2632 void ToNumberStub::Generate(MacroAssembler* masm) { | 2625 void ToNumberStub::Generate(MacroAssembler* masm) { |
| 2633 // The ToNumber stub takes one argument in a0. | 2626 // The ToNumber stub takes one argument in a0. |
| 2634 Label not_smi; | 2627 Label not_smi; |
| 2635 __ JumpIfNotSmi(a0, ¬_smi); | 2628 __ JumpIfNotSmi(a0, ¬_smi); |
| (...skipping 2995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5631 kStackUnwindSpace, kInvalidStackOffset, | 5624 kStackUnwindSpace, kInvalidStackOffset, |
| 5632 return_value_operand, NULL); | 5625 return_value_operand, NULL); |
| 5633 } | 5626 } |
| 5634 | 5627 |
| 5635 #undef __ | 5628 #undef __ |
| 5636 | 5629 |
| 5637 } // namespace internal | 5630 } // namespace internal |
| 5638 } // namespace v8 | 5631 } // namespace v8 |
| 5639 | 5632 |
| 5640 #endif // V8_TARGET_ARCH_MIPS | 5633 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |