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

Side by Side Diff: src/full-codegen/x87/full-codegen-x87.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/x64/full-codegen-x64.cc ('k') | src/globals.h » ('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_X87 5 #if V8_TARGET_ARCH_X87
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 3637 matching lines...) Expand 10 before | Expand all | Expand 10 after
3648 // Update the write barrier. Save the value as it will be 3648 // Update the write barrier. Save the value as it will be
3649 // overwritten by the write barrier code and is needed afterward. 3649 // overwritten by the write barrier code and is needed afterward.
3650 __ mov(edx, eax); 3650 __ mov(edx, eax);
3651 __ RecordWriteField(ebx, JSValue::kValueOffset, edx, ecx, kDontSaveFPRegs); 3651 __ RecordWriteField(ebx, JSValue::kValueOffset, edx, ecx, kDontSaveFPRegs);
3652 3652
3653 __ bind(&done); 3653 __ bind(&done);
3654 context()->Plug(eax); 3654 context()->Plug(eax);
3655 } 3655 }
3656 3656
3657 3657
3658 void FullCodeGenerator::EmitToInteger(CallRuntime* expr) {
3659 ZoneList<Expression*>* args = expr->arguments();
3660 DCHECK_EQ(1, args->length());
3661
3662 // Load the argument into eax and convert it.
3663 VisitForAccumulatorValue(args->at(0));
3664
3665 // Convert the object to an integer.
3666 Label done_convert;
3667 __ JumpIfSmi(eax, &done_convert, Label::kNear);
3668 __ Push(eax);
3669 __ CallRuntime(Runtime::kToInteger, 1);
3670 __ bind(&done_convert);
3671 context()->Plug(eax);
3672 }
3673
3674
3658 void FullCodeGenerator::EmitNumberToString(CallRuntime* expr) { 3675 void FullCodeGenerator::EmitNumberToString(CallRuntime* expr) {
3659 ZoneList<Expression*>* args = expr->arguments(); 3676 ZoneList<Expression*>* args = expr->arguments();
3660 DCHECK_EQ(args->length(), 1); 3677 DCHECK_EQ(args->length(), 1);
3661 3678
3662 // Load the argument into eax and call the stub. 3679 // Load the argument into eax and call the stub.
3663 VisitForAccumulatorValue(args->at(0)); 3680 VisitForAccumulatorValue(args->at(0));
3664 3681
3665 NumberToStringStub stub(isolate()); 3682 NumberToStringStub stub(isolate());
3666 __ CallStub(&stub); 3683 __ CallStub(&stub);
3667 context()->Plug(eax); 3684 context()->Plug(eax);
(...skipping 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after
5117 Assembler::target_address_at(call_target_address, 5134 Assembler::target_address_at(call_target_address,
5118 unoptimized_code)); 5135 unoptimized_code));
5119 return OSR_AFTER_STACK_CHECK; 5136 return OSR_AFTER_STACK_CHECK;
5120 } 5137 }
5121 5138
5122 5139
5123 } // namespace internal 5140 } // namespace internal
5124 } // namespace v8 5141 } // namespace v8
5125 5142
5126 #endif // V8_TARGET_ARCH_X87 5143 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698