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

Side by Side Diff: src/full-codegen/x64/full-codegen-x64.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/ppc/full-codegen-ppc.cc ('k') | src/full-codegen/x87/full-codegen-x87.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_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/compiler.h" 10 #include "src/compiler.h"
(...skipping 3643 matching lines...) Expand 10 before | Expand all | Expand 10 after
3654 // Update the write barrier. Save the value as it will be 3654 // Update the write barrier. Save the value as it will be
3655 // overwritten by the write barrier code and is needed afterward. 3655 // overwritten by the write barrier code and is needed afterward.
3656 __ movp(rdx, rax); 3656 __ movp(rdx, rax);
3657 __ RecordWriteField(rbx, JSValue::kValueOffset, rdx, rcx, kDontSaveFPRegs); 3657 __ RecordWriteField(rbx, JSValue::kValueOffset, rdx, rcx, kDontSaveFPRegs);
3658 3658
3659 __ bind(&done); 3659 __ bind(&done);
3660 context()->Plug(rax); 3660 context()->Plug(rax);
3661 } 3661 }
3662 3662
3663 3663
3664 void FullCodeGenerator::EmitToInteger(CallRuntime* expr) {
3665 ZoneList<Expression*>* args = expr->arguments();
3666 DCHECK_EQ(1, args->length());
3667
3668 // Load the argument into rax and convert it.
3669 VisitForAccumulatorValue(args->at(0));
3670
3671 // Convert the object to an integer.
3672 Label done_convert;
3673 __ JumpIfSmi(rax, &done_convert, Label::kNear);
3674 __ Push(rax);
3675 __ CallRuntime(Runtime::kToInteger, 1);
3676 __ bind(&done_convert);
3677 context()->Plug(rax);
3678 }
3679
3680
3664 void FullCodeGenerator::EmitNumberToString(CallRuntime* expr) { 3681 void FullCodeGenerator::EmitNumberToString(CallRuntime* expr) {
3665 ZoneList<Expression*>* args = expr->arguments(); 3682 ZoneList<Expression*>* args = expr->arguments();
3666 DCHECK_EQ(args->length(), 1); 3683 DCHECK_EQ(args->length(), 1);
3667 3684
3668 // Load the argument into rax and call the stub. 3685 // Load the argument into rax and call the stub.
3669 VisitForAccumulatorValue(args->at(0)); 3686 VisitForAccumulatorValue(args->at(0));
3670 3687
3671 NumberToStringStub stub(isolate()); 3688 NumberToStringStub stub(isolate());
3672 __ CallStub(&stub); 3689 __ CallStub(&stub);
3673 context()->Plug(rax); 3690 context()->Plug(rax);
(...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after
5142 Assembler::target_address_at(call_target_address, 5159 Assembler::target_address_at(call_target_address,
5143 unoptimized_code)); 5160 unoptimized_code));
5144 return OSR_AFTER_STACK_CHECK; 5161 return OSR_AFTER_STACK_CHECK;
5145 } 5162 }
5146 5163
5147 5164
5148 } // namespace internal 5165 } // namespace internal
5149 } // namespace v8 5166 } // namespace v8
5150 5167
5151 #endif // V8_TARGET_ARCH_X64 5168 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/full-codegen/ppc/full-codegen-ppc.cc ('k') | src/full-codegen/x87/full-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698