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

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

Issue 1319973007: [runtime] Add %ToString and %_ToString and remove the TO_STRING builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 3972 matching lines...) Expand 10 before | Expand all | Expand 10 after
3983 // Load the argument into a0 and call the stub. 3983 // Load the argument into a0 and call the stub.
3984 VisitForAccumulatorValue(args->at(0)); 3984 VisitForAccumulatorValue(args->at(0));
3985 __ mov(a0, result_register()); 3985 __ mov(a0, result_register());
3986 3986
3987 NumberToStringStub stub(isolate()); 3987 NumberToStringStub stub(isolate());
3988 __ CallStub(&stub); 3988 __ CallStub(&stub);
3989 context()->Plug(v0); 3989 context()->Plug(v0);
3990 } 3990 }
3991 3991
3992 3992
3993 void FullCodeGenerator::EmitToString(CallRuntime* expr) {
3994 ZoneList<Expression*>* args = expr->arguments();
3995 DCHECK_EQ(1, args->length());
3996
3997 // Load the argument into a0 and convert it.
3998 VisitForAccumulatorValue(args->at(0));
3999 __ mov(a0, result_register());
4000
4001 ToStringStub stub(isolate());
4002 __ CallStub(&stub);
4003 context()->Plug(v0);
4004 }
4005
4006
4007 void FullCodeGenerator::EmitToName(CallRuntime* expr) {
4008 ZoneList<Expression*>* args = expr->arguments();
4009 DCHECK_EQ(1, args->length());
4010
4011 // Load the argument into v0 and convert it.
4012 VisitForAccumulatorValue(args->at(0));
4013
4014 Label convert, done_convert;
4015 __ JumpIfSmi(v0, &convert);
4016 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE);
4017 __ GetObjectType(v0, a1, a1);
4018 __ Branch(&done_convert, le, a1, Operand(LAST_NAME_TYPE));
4019 __ bind(&convert);
4020 ToStringStub stub(isolate());
4021 __ mov(a0, v0);
4022 __ CallStub(&stub);
4023 __ bind(&done_convert);
4024 context()->Plug(v0);
4025 }
4026
4027
3993 void FullCodeGenerator::EmitToObject(CallRuntime* expr) { 4028 void FullCodeGenerator::EmitToObject(CallRuntime* expr) {
3994 ZoneList<Expression*>* args = expr->arguments(); 4029 ZoneList<Expression*>* args = expr->arguments();
3995 DCHECK_EQ(1, args->length()); 4030 DCHECK_EQ(1, args->length());
3996 4031
3997 // Load the argument into a0 and convert it. 4032 // Load the argument into a0 and convert it.
3998 VisitForAccumulatorValue(args->at(0)); 4033 VisitForAccumulatorValue(args->at(0));
3999 __ mov(a0, result_register()); 4034 __ mov(a0, result_register());
4000 4035
4001 ToObjectStub stub(isolate()); 4036 ToObjectStub stub(isolate());
4002 __ CallStub(&stub); 4037 __ CallStub(&stub);
(...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after
5343 reinterpret_cast<uint32_t>( 5378 reinterpret_cast<uint32_t>(
5344 isolate->builtins()->OsrAfterStackCheck()->entry())); 5379 isolate->builtins()->OsrAfterStackCheck()->entry()));
5345 return OSR_AFTER_STACK_CHECK; 5380 return OSR_AFTER_STACK_CHECK;
5346 } 5381 }
5347 5382
5348 5383
5349 } // namespace internal 5384 } // namespace internal
5350 } // namespace v8 5385 } // namespace v8
5351 5386
5352 #endif // V8_TARGET_ARCH_MIPS 5387 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698