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

Side by Side Diff: src/full-codegen/ia32/full-codegen-ia32.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/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 3865 matching lines...) Expand 10 before | Expand all | Expand 10 after
3876 3876
3877 // Load the argument into eax and call the stub. 3877 // Load the argument into eax and call the stub.
3878 VisitForAccumulatorValue(args->at(0)); 3878 VisitForAccumulatorValue(args->at(0));
3879 3879
3880 NumberToStringStub stub(isolate()); 3880 NumberToStringStub stub(isolate());
3881 __ CallStub(&stub); 3881 __ CallStub(&stub);
3882 context()->Plug(eax); 3882 context()->Plug(eax);
3883 } 3883 }
3884 3884
3885 3885
3886 void FullCodeGenerator::EmitToString(CallRuntime* expr) {
3887 ZoneList<Expression*>* args = expr->arguments();
3888 DCHECK_EQ(1, args->length());
3889
3890 // Load the argument into eax and convert it.
3891 VisitForAccumulatorValue(args->at(0));
3892
3893 ToStringStub stub(isolate());
3894 __ CallStub(&stub);
3895 context()->Plug(eax);
3896 }
3897
3898
3899 void FullCodeGenerator::EmitToName(CallRuntime* expr) {
3900 ZoneList<Expression*>* args = expr->arguments();
3901 DCHECK_EQ(1, args->length());
3902
3903 // Load the argument into eax and convert it.
3904 VisitForAccumulatorValue(args->at(0));
3905
3906 // Convert the object to a name.
3907 Label convert, done_convert;
3908 __ JumpIfSmi(eax, &convert, Label::kNear);
3909 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE);
3910 __ CmpObjectType(eax, LAST_NAME_TYPE, ecx);
3911 __ j(below_equal, &done_convert, Label::kNear);
3912 __ bind(&convert);
3913 ToStringStub stub(isolate());
3914 __ CallStub(&stub);
3915 __ bind(&done_convert);
3916 context()->Plug(eax);
3917 }
3918
3919
3886 void FullCodeGenerator::EmitToObject(CallRuntime* expr) { 3920 void FullCodeGenerator::EmitToObject(CallRuntime* expr) {
3887 ZoneList<Expression*>* args = expr->arguments(); 3921 ZoneList<Expression*>* args = expr->arguments();
3888 DCHECK_EQ(1, args->length()); 3922 DCHECK_EQ(1, args->length());
3889 3923
3890 // Load the argument into eax and convert it. 3924 // Load the argument into eax and convert it.
3891 VisitForAccumulatorValue(args->at(0)); 3925 VisitForAccumulatorValue(args->at(0));
3892 3926
3893 ToObjectStub stub(isolate()); 3927 ToObjectStub stub(isolate());
3894 __ CallStub(&stub); 3928 __ CallStub(&stub);
3895 context()->Plug(eax); 3929 context()->Plug(eax);
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after
5255 Assembler::target_address_at(call_target_address, 5289 Assembler::target_address_at(call_target_address,
5256 unoptimized_code)); 5290 unoptimized_code));
5257 return OSR_AFTER_STACK_CHECK; 5291 return OSR_AFTER_STACK_CHECK;
5258 } 5292 }
5259 5293
5260 5294
5261 } // namespace internal 5295 } // namespace internal
5262 } // namespace v8 5296 } // namespace v8
5263 5297
5264 #endif // V8_TARGET_ARCH_IA32 5298 #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