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

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

Issue 1319973007: [runtime] Add %ToString and %_ToString and remove the TO_STRING builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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/mips64/full-codegen-mips64.cc ('k') | src/ia32/builtins-ia32.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 3855 matching lines...) Expand 10 before | Expand all | Expand 10 after
3866 3866
3867 // Load the argument into rax and call the stub. 3867 // Load the argument into rax and call the stub.
3868 VisitForAccumulatorValue(args->at(0)); 3868 VisitForAccumulatorValue(args->at(0));
3869 3869
3870 NumberToStringStub stub(isolate()); 3870 NumberToStringStub stub(isolate());
3871 __ CallStub(&stub); 3871 __ CallStub(&stub);
3872 context()->Plug(rax); 3872 context()->Plug(rax);
3873 } 3873 }
3874 3874
3875 3875
3876 void FullCodeGenerator::EmitToString(CallRuntime* expr) {
3877 ZoneList<Expression*>* args = expr->arguments();
3878 DCHECK_EQ(1, args->length());
3879
3880 // Load the argument into rax and convert it.
3881 VisitForAccumulatorValue(args->at(0));
3882
3883 ToStringStub stub(isolate());
3884 __ CallStub(&stub);
3885 context()->Plug(rax);
3886 }
3887
3888
3889 void FullCodeGenerator::EmitToName(CallRuntime* expr) {
3890 ZoneList<Expression*>* args = expr->arguments();
3891 DCHECK_EQ(1, args->length());
3892
3893 // Load the argument into rax and convert it.
3894 VisitForAccumulatorValue(args->at(0));
3895
3896 // Convert the object to a name.
3897 Label convert, done_convert;
3898 __ JumpIfSmi(rax, &convert, Label::kNear);
3899 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE);
3900 __ CmpObjectType(rax, LAST_NAME_TYPE, rcx);
3901 __ j(below_equal, &done_convert, Label::kNear);
3902 __ bind(&convert);
3903 ToStringStub stub(isolate());
3904 __ CallStub(&stub);
3905 __ bind(&done_convert);
3906 context()->Plug(rax);
3907 }
3908
3909
3876 void FullCodeGenerator::EmitToObject(CallRuntime* expr) { 3910 void FullCodeGenerator::EmitToObject(CallRuntime* expr) {
3877 ZoneList<Expression*>* args = expr->arguments(); 3911 ZoneList<Expression*>* args = expr->arguments();
3878 DCHECK_EQ(1, args->length()); 3912 DCHECK_EQ(1, args->length());
3879 3913
3880 // Load the argument into rax and convert it. 3914 // Load the argument into rax and convert it.
3881 VisitForAccumulatorValue(args->at(0)); 3915 VisitForAccumulatorValue(args->at(0));
3882 3916
3883 ToObjectStub stub(isolate()); 3917 ToObjectStub stub(isolate());
3884 __ CallStub(&stub); 3918 __ CallStub(&stub);
3885 context()->Plug(rax); 3919 context()->Plug(rax);
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after
5265 Assembler::target_address_at(call_target_address, 5299 Assembler::target_address_at(call_target_address,
5266 unoptimized_code)); 5300 unoptimized_code));
5267 return OSR_AFTER_STACK_CHECK; 5301 return OSR_AFTER_STACK_CHECK;
5268 } 5302 }
5269 5303
5270 5304
5271 } // namespace internal 5305 } // namespace internal
5272 } // namespace v8 5306 } // namespace v8
5273 5307
5274 #endif // V8_TARGET_ARCH_X64 5308 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698