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

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

Issue 1412963002: [runtime] Implement %_ToLength via ToLengthStub. (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
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/debug/debug.h" 10 #include "src/debug/debug.h"
(...skipping 3686 matching lines...) Expand 10 before | Expand all | Expand 10 after
3697 3697
3698 // Load the argument into rax and convert it. 3698 // Load the argument into rax and convert it.
3699 VisitForAccumulatorValue(args->at(0)); 3699 VisitForAccumulatorValue(args->at(0));
3700 3700
3701 ToStringStub stub(isolate()); 3701 ToStringStub stub(isolate());
3702 __ CallStub(&stub); 3702 __ CallStub(&stub);
3703 context()->Plug(rax); 3703 context()->Plug(rax);
3704 } 3704 }
3705 3705
3706 3706
3707 void FullCodeGenerator::EmitToLength(CallRuntime* expr) {
3708 ZoneList<Expression*>* args = expr->arguments();
3709 DCHECK_EQ(1, args->length());
3710
3711 // Load the argument into rax and convert it.
3712 VisitForAccumulatorValue(args->at(0));
3713
3714 ToLengthStub stub(isolate());
3715 __ CallStub(&stub);
3716 context()->Plug(rax);
3717 }
3718
3719
3707 void FullCodeGenerator::EmitToNumber(CallRuntime* expr) { 3720 void FullCodeGenerator::EmitToNumber(CallRuntime* expr) {
3708 ZoneList<Expression*>* args = expr->arguments(); 3721 ZoneList<Expression*>* args = expr->arguments();
3709 DCHECK_EQ(1, args->length()); 3722 DCHECK_EQ(1, args->length());
3710 3723
3711 // Load the argument into rax and convert it. 3724 // Load the argument into rax and convert it.
3712 VisitForAccumulatorValue(args->at(0)); 3725 VisitForAccumulatorValue(args->at(0));
3713 3726
3714 ToNumberStub stub(isolate()); 3727 ToNumberStub stub(isolate());
3715 __ CallStub(&stub); 3728 __ CallStub(&stub);
3716 context()->Plug(rax); 3729 context()->Plug(rax);
(...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after
5177 Assembler::target_address_at(call_target_address, 5190 Assembler::target_address_at(call_target_address,
5178 unoptimized_code)); 5191 unoptimized_code));
5179 return OSR_AFTER_STACK_CHECK; 5192 return OSR_AFTER_STACK_CHECK;
5180 } 5193 }
5181 5194
5182 5195
5183 } // namespace internal 5196 } // namespace internal
5184 } // namespace v8 5197 } // namespace v8
5185 5198
5186 #endif // V8_TARGET_ARCH_X64 5199 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698