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

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

Issue 1378533002: [es6] Introduce %ToInteger and %ToLength. (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
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
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 3763 matching lines...) Expand 10 before | Expand all | Expand 10 after
3774 // overwritten by the write barrier code and is needed afterward. 3774 // overwritten by the write barrier code and is needed afterward.
3775 __ mov(a2, v0); 3775 __ mov(a2, v0);
3776 __ RecordWriteField( 3776 __ RecordWriteField(
3777 a1, JSValue::kValueOffset, a2, a3, kRAHasBeenSaved, kDontSaveFPRegs); 3777 a1, JSValue::kValueOffset, a2, a3, kRAHasBeenSaved, kDontSaveFPRegs);
3778 3778
3779 __ bind(&done); 3779 __ bind(&done);
3780 context()->Plug(v0); 3780 context()->Plug(v0);
3781 } 3781 }
3782 3782
3783 3783
3784 void FullCodeGenerator::EmitToInteger(CallRuntime* expr) {
3785 ZoneList<Expression*>* args = expr->arguments();
3786 DCHECK_EQ(1, args->length());
3787
3788 // Load the argument into v0 and convert it.
3789 VisitForAccumulatorValue(args->at(0));
3790
3791 // Convert the object to an integer.
3792 Label done_convert;
3793 __ JumpIfSmi(v0, &done_convert);
3794 __ Push(v0);
3795 __ CallRuntime(Runtime::kToInteger, 1);
3796 __ bind(&done_convert);
3797 context()->Plug(v0);
3798 }
3799
3800
3784 void FullCodeGenerator::EmitNumberToString(CallRuntime* expr) { 3801 void FullCodeGenerator::EmitNumberToString(CallRuntime* expr) {
3785 ZoneList<Expression*>* args = expr->arguments(); 3802 ZoneList<Expression*>* args = expr->arguments();
3786 DCHECK_EQ(args->length(), 1); 3803 DCHECK_EQ(args->length(), 1);
3787 3804
3788 // Load the argument into a0 and call the stub. 3805 // Load the argument into a0 and call the stub.
3789 VisitForAccumulatorValue(args->at(0)); 3806 VisitForAccumulatorValue(args->at(0));
3790 __ mov(a0, result_register()); 3807 __ mov(a0, result_register());
3791 3808
3792 NumberToStringStub stub(isolate()); 3809 NumberToStringStub stub(isolate());
3793 __ CallStub(&stub); 3810 __ CallStub(&stub);
(...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after
5229 reinterpret_cast<uint64_t>( 5246 reinterpret_cast<uint64_t>(
5230 isolate->builtins()->OsrAfterStackCheck()->entry())); 5247 isolate->builtins()->OsrAfterStackCheck()->entry()));
5231 return OSR_AFTER_STACK_CHECK; 5248 return OSR_AFTER_STACK_CHECK;
5232 } 5249 }
5233 5250
5234 5251
5235 } // namespace internal 5252 } // namespace internal
5236 } // namespace v8 5253 } // namespace v8
5237 5254
5238 #endif // V8_TARGET_ARCH_MIPS64 5255 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698