Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: src/full-codegen/mips/full-codegen-mips.cc

Issue 1412963002: [runtime] Implement %_ToLength via ToLengthStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 3793 matching lines...) Expand 10 before | Expand all | Expand 10 after
3804 // Load the argument into a0 and call the stub. 3804 // Load the argument into a0 and call the stub.
3805 VisitForAccumulatorValue(args->at(0)); 3805 VisitForAccumulatorValue(args->at(0));
3806 __ mov(a0, result_register()); 3806 __ mov(a0, result_register());
3807 3807
3808 NumberToStringStub stub(isolate()); 3808 NumberToStringStub stub(isolate());
3809 __ CallStub(&stub); 3809 __ CallStub(&stub);
3810 context()->Plug(v0); 3810 context()->Plug(v0);
3811 } 3811 }
3812 3812
3813 3813
3814 void FullCodeGenerator::EmitToLength(CallRuntime* expr) {
3815 ZoneList<Expression*>* args = expr->arguments();
3816 DCHECK_EQ(1, args->length());
3817
3818 // Load the argument into a0 and convert it.
3819 VisitForAccumulatorValue(args->at(0));
3820 __ mov(a0, result_register());
3821
3822 ToLengthStub stub(isolate());
3823 __ CallStub(&stub);
3824 context()->Plug(v0);
3825 }
3826
3827
3814 void FullCodeGenerator::EmitToString(CallRuntime* expr) { 3828 void FullCodeGenerator::EmitToString(CallRuntime* expr) {
3815 ZoneList<Expression*>* args = expr->arguments(); 3829 ZoneList<Expression*>* args = expr->arguments();
3816 DCHECK_EQ(1, args->length()); 3830 DCHECK_EQ(1, args->length());
3817 3831
3818 // Load the argument into a0 and convert it. 3832 // Load the argument into a0 and convert it.
3819 VisitForAccumulatorValue(args->at(0)); 3833 VisitForAccumulatorValue(args->at(0));
3820 __ mov(a0, result_register()); 3834 __ mov(a0, result_register());
3821 3835
3822 ToStringStub stub(isolate()); 3836 ToStringStub stub(isolate());
3823 __ CallStub(&stub); 3837 __ CallStub(&stub);
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after
5260 reinterpret_cast<uint32_t>( 5274 reinterpret_cast<uint32_t>(
5261 isolate->builtins()->OsrAfterStackCheck()->entry())); 5275 isolate->builtins()->OsrAfterStackCheck()->entry()));
5262 return OSR_AFTER_STACK_CHECK; 5276 return OSR_AFTER_STACK_CHECK;
5263 } 5277 }
5264 5278
5265 5279
5266 } // namespace internal 5280 } // namespace internal
5267 } // namespace v8 5281 } // namespace v8
5268 5282
5269 #endif // V8_TARGET_ARCH_MIPS 5283 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698