OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |