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 // Note on Mips implementation: | 7 // Note on Mips implementation: |
8 // | 8 // |
9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
(...skipping 3760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3771 // overwritten by the write barrier code and is needed afterward. | 3771 // overwritten by the write barrier code and is needed afterward. |
3772 __ mov(a2, v0); | 3772 __ mov(a2, v0); |
3773 __ RecordWriteField( | 3773 __ RecordWriteField( |
3774 a1, JSValue::kValueOffset, a2, a3, kRAHasBeenSaved, kDontSaveFPRegs); | 3774 a1, JSValue::kValueOffset, a2, a3, kRAHasBeenSaved, kDontSaveFPRegs); |
3775 | 3775 |
3776 __ bind(&done); | 3776 __ bind(&done); |
3777 context()->Plug(v0); | 3777 context()->Plug(v0); |
3778 } | 3778 } |
3779 | 3779 |
3780 | 3780 |
| 3781 void FullCodeGenerator::EmitToInteger(CallRuntime* expr) { |
| 3782 ZoneList<Expression*>* args = expr->arguments(); |
| 3783 DCHECK_EQ(1, args->length()); |
| 3784 |
| 3785 // Load the argument into v0 and convert it. |
| 3786 VisitForAccumulatorValue(args->at(0)); |
| 3787 |
| 3788 // Convert the object to an integer. |
| 3789 Label done_convert; |
| 3790 __ JumpIfSmi(v0, &done_convert); |
| 3791 __ Push(v0); |
| 3792 __ CallRuntime(Runtime::kToInteger, 1); |
| 3793 __ bind(&done_convert); |
| 3794 context()->Plug(v0); |
| 3795 } |
| 3796 |
| 3797 |
3781 void FullCodeGenerator::EmitNumberToString(CallRuntime* expr) { | 3798 void FullCodeGenerator::EmitNumberToString(CallRuntime* expr) { |
3782 ZoneList<Expression*>* args = expr->arguments(); | 3799 ZoneList<Expression*>* args = expr->arguments(); |
3783 DCHECK_EQ(args->length(), 1); | 3800 DCHECK_EQ(args->length(), 1); |
3784 | 3801 |
3785 // Load the argument into a0 and call the stub. | 3802 // Load the argument into a0 and call the stub. |
3786 VisitForAccumulatorValue(args->at(0)); | 3803 VisitForAccumulatorValue(args->at(0)); |
3787 __ mov(a0, result_register()); | 3804 __ mov(a0, result_register()); |
3788 | 3805 |
3789 NumberToStringStub stub(isolate()); | 3806 NumberToStringStub stub(isolate()); |
3790 __ CallStub(&stub); | 3807 __ CallStub(&stub); |
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5223 reinterpret_cast<uint32_t>( | 5240 reinterpret_cast<uint32_t>( |
5224 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5241 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5225 return OSR_AFTER_STACK_CHECK; | 5242 return OSR_AFTER_STACK_CHECK; |
5226 } | 5243 } |
5227 | 5244 |
5228 | 5245 |
5229 } // namespace internal | 5246 } // namespace internal |
5230 } // namespace v8 | 5247 } // namespace v8 |
5231 | 5248 |
5232 #endif // V8_TARGET_ARCH_MIPS | 5249 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |