| 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 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/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1417 Register index = LoadDescriptor::NameRegister(); | 1417 Register index = LoadDescriptor::NameRegister(); |
| 1418 Register scratch = a5; | 1418 Register scratch = a5; |
| 1419 Register result = v0; | 1419 Register result = v0; |
| 1420 DCHECK(!scratch.is(receiver) && !scratch.is(index)); | 1420 DCHECK(!scratch.is(receiver) && !scratch.is(index)); |
| 1421 DCHECK(!scratch.is(LoadWithVectorDescriptor::VectorRegister())); | 1421 DCHECK(!scratch.is(LoadWithVectorDescriptor::VectorRegister())); |
| 1422 | 1422 |
| 1423 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, | 1423 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, |
| 1424 &miss, // When not a string. | 1424 &miss, // When not a string. |
| 1425 &miss, // When not a number. | 1425 &miss, // When not a number. |
| 1426 &miss, // When index out of range. | 1426 &miss, // When index out of range. |
| 1427 STRING_INDEX_IS_ARRAY_INDEX, | |
| 1428 RECEIVER_IS_STRING); | 1427 RECEIVER_IS_STRING); |
| 1429 char_at_generator.GenerateFast(masm); | 1428 char_at_generator.GenerateFast(masm); |
| 1430 __ Ret(); | 1429 __ Ret(); |
| 1431 | 1430 |
| 1432 StubRuntimeCallHelper call_helper; | 1431 StubRuntimeCallHelper call_helper; |
| 1433 char_at_generator.GenerateSlow(masm, PART_OF_IC_HANDLER, call_helper); | 1432 char_at_generator.GenerateSlow(masm, PART_OF_IC_HANDLER, call_helper); |
| 1434 | 1433 |
| 1435 __ bind(&miss); | 1434 __ bind(&miss); |
| 1436 PropertyAccessCompiler::TailCallBuiltin( | 1435 PropertyAccessCompiler::TailCallBuiltin( |
| 1437 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); | 1436 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); |
| (...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2283 index_not_number_, | 2282 index_not_number_, |
| 2284 DONT_DO_SMI_CHECK); | 2283 DONT_DO_SMI_CHECK); |
| 2285 call_helper.BeforeCall(masm); | 2284 call_helper.BeforeCall(masm); |
| 2286 // Consumed by runtime conversion function: | 2285 // Consumed by runtime conversion function: |
| 2287 if (embed_mode == PART_OF_IC_HANDLER) { | 2286 if (embed_mode == PART_OF_IC_HANDLER) { |
| 2288 __ Push(LoadWithVectorDescriptor::VectorRegister(), | 2287 __ Push(LoadWithVectorDescriptor::VectorRegister(), |
| 2289 LoadWithVectorDescriptor::SlotRegister(), object_, index_); | 2288 LoadWithVectorDescriptor::SlotRegister(), object_, index_); |
| 2290 } else { | 2289 } else { |
| 2291 __ Push(object_, index_); | 2290 __ Push(object_, index_); |
| 2292 } | 2291 } |
| 2293 if (index_flags_ == STRING_INDEX_IS_NUMBER) { | 2292 __ CallRuntime(Runtime::kNumberToSmi); |
| 2294 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero); | |
| 2295 } else { | |
| 2296 DCHECK(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); | |
| 2297 // NumberToSmi discards numbers that are not exact integers. | |
| 2298 __ CallRuntime(Runtime::kNumberToSmi); | |
| 2299 } | |
| 2300 | 2293 |
| 2301 // Save the conversion result before the pop instructions below | 2294 // Save the conversion result before the pop instructions below |
| 2302 // have a chance to overwrite it. | 2295 // have a chance to overwrite it. |
| 2303 | 2296 |
| 2304 __ Move(index_, v0); | 2297 __ Move(index_, v0); |
| 2305 if (embed_mode == PART_OF_IC_HANDLER) { | 2298 if (embed_mode == PART_OF_IC_HANDLER) { |
| 2306 __ Pop(LoadWithVectorDescriptor::VectorRegister(), | 2299 __ Pop(LoadWithVectorDescriptor::VectorRegister(), |
| 2307 LoadWithVectorDescriptor::SlotRegister(), object_); | 2300 LoadWithVectorDescriptor::SlotRegister(), object_); |
| 2308 } else { | 2301 } else { |
| 2309 __ pop(object_); | 2302 __ pop(object_); |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2626 __ bind(&runtime); | 2619 __ bind(&runtime); |
| 2627 __ TailCallRuntime(Runtime::kSubString); | 2620 __ TailCallRuntime(Runtime::kSubString); |
| 2628 | 2621 |
| 2629 __ bind(&single_char); | 2622 __ bind(&single_char); |
| 2630 // v0: original string | 2623 // v0: original string |
| 2631 // a1: instance type | 2624 // a1: instance type |
| 2632 // a2: length | 2625 // a2: length |
| 2633 // a3: from index (untagged) | 2626 // a3: from index (untagged) |
| 2634 __ SmiTag(a3); | 2627 __ SmiTag(a3); |
| 2635 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, | 2628 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, |
| 2636 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); | 2629 RECEIVER_IS_STRING); |
| 2637 generator.GenerateFast(masm); | 2630 generator.GenerateFast(masm); |
| 2638 __ DropAndRet(3); | 2631 __ DropAndRet(3); |
| 2639 generator.SkipSlow(masm, &runtime); | 2632 generator.SkipSlow(masm, &runtime); |
| 2640 } | 2633 } |
| 2641 | 2634 |
| 2642 | 2635 |
| 2643 void ToNumberStub::Generate(MacroAssembler* masm) { | 2636 void ToNumberStub::Generate(MacroAssembler* masm) { |
| 2644 // The ToNumber stub takes one argument in a0. | 2637 // The ToNumber stub takes one argument in a0. |
| 2645 Label not_smi; | 2638 Label not_smi; |
| 2646 __ JumpIfNotSmi(a0, ¬_smi); | 2639 __ JumpIfNotSmi(a0, ¬_smi); |
| (...skipping 3019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5666 kStackUnwindSpace, kInvalidStackOffset, | 5659 kStackUnwindSpace, kInvalidStackOffset, |
| 5667 return_value_operand, NULL); | 5660 return_value_operand, NULL); |
| 5668 } | 5661 } |
| 5669 | 5662 |
| 5670 #undef __ | 5663 #undef __ |
| 5671 | 5664 |
| 5672 } // namespace internal | 5665 } // namespace internal |
| 5673 } // namespace v8 | 5666 } // namespace v8 |
| 5674 | 5667 |
| 5675 #endif // V8_TARGET_ARCH_MIPS64 | 5668 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |