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

Side by Side Diff: src/full-codegen/ia32/full-codegen-ia32.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/full-codegen.h ('k') | src/full-codegen/mips/full-codegen-mips.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_IA32 5 #if V8_TARGET_ARCH_IA32
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 3646 matching lines...) Expand 10 before | Expand all | Expand 10 after
3657 // Update the write barrier. Save the value as it will be 3657 // Update the write barrier. Save the value as it will be
3658 // overwritten by the write barrier code and is needed afterward. 3658 // overwritten by the write barrier code and is needed afterward.
3659 __ mov(edx, eax); 3659 __ mov(edx, eax);
3660 __ RecordWriteField(ebx, JSValue::kValueOffset, edx, ecx, kDontSaveFPRegs); 3660 __ RecordWriteField(ebx, JSValue::kValueOffset, edx, ecx, kDontSaveFPRegs);
3661 3661
3662 __ bind(&done); 3662 __ bind(&done);
3663 context()->Plug(eax); 3663 context()->Plug(eax);
3664 } 3664 }
3665 3665
3666 3666
3667 void FullCodeGenerator::EmitToInteger(CallRuntime* expr) {
3668 ZoneList<Expression*>* args = expr->arguments();
3669 DCHECK_EQ(1, args->length());
3670
3671 // Load the argument into eax and convert it.
3672 VisitForAccumulatorValue(args->at(0));
3673
3674 // Convert the object to an integer.
3675 Label done_convert;
3676 __ JumpIfSmi(eax, &done_convert, Label::kNear);
3677 __ Push(eax);
3678 __ CallRuntime(Runtime::kToInteger, 1);
3679 __ bind(&done_convert);
3680 context()->Plug(eax);
3681 }
3682
3683
3667 void FullCodeGenerator::EmitNumberToString(CallRuntime* expr) { 3684 void FullCodeGenerator::EmitNumberToString(CallRuntime* expr) {
3668 ZoneList<Expression*>* args = expr->arguments(); 3685 ZoneList<Expression*>* args = expr->arguments();
3669 DCHECK_EQ(args->length(), 1); 3686 DCHECK_EQ(args->length(), 1);
3670 3687
3671 // Load the argument into eax and call the stub. 3688 // Load the argument into eax and call the stub.
3672 VisitForAccumulatorValue(args->at(0)); 3689 VisitForAccumulatorValue(args->at(0));
3673 3690
3674 NumberToStringStub stub(isolate()); 3691 NumberToStringStub stub(isolate());
3675 __ CallStub(&stub); 3692 __ CallStub(&stub);
3676 context()->Plug(eax); 3693 context()->Plug(eax);
(...skipping 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after
5126 Assembler::target_address_at(call_target_address, 5143 Assembler::target_address_at(call_target_address,
5127 unoptimized_code)); 5144 unoptimized_code));
5128 return OSR_AFTER_STACK_CHECK; 5145 return OSR_AFTER_STACK_CHECK;
5129 } 5146 }
5130 5147
5131 5148
5132 } // namespace internal 5149 } // namespace internal
5133 } // namespace v8 5150 } // namespace v8
5134 5151
5135 #endif // V8_TARGET_ARCH_IA32 5152 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/full-codegen/full-codegen.h ('k') | src/full-codegen/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698