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_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 3815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3826 | 3826 |
3827 // Load the argument into eax and call the stub. | 3827 // Load the argument into eax and call the stub. |
3828 VisitForAccumulatorValue(args->at(0)); | 3828 VisitForAccumulatorValue(args->at(0)); |
3829 | 3829 |
3830 NumberToStringStub stub(isolate()); | 3830 NumberToStringStub stub(isolate()); |
3831 __ CallStub(&stub); | 3831 __ CallStub(&stub); |
3832 context()->Plug(eax); | 3832 context()->Plug(eax); |
3833 } | 3833 } |
3834 | 3834 |
3835 | 3835 |
| 3836 void FullCodeGenerator::EmitToString(CallRuntime* expr) { |
| 3837 ZoneList<Expression*>* args = expr->arguments(); |
| 3838 DCHECK_EQ(1, args->length()); |
| 3839 |
| 3840 // Load the argument into eax and convert it. |
| 3841 VisitForAccumulatorValue(args->at(0)); |
| 3842 |
| 3843 ToStringStub stub(isolate()); |
| 3844 __ CallStub(&stub); |
| 3845 context()->Plug(eax); |
| 3846 } |
| 3847 |
| 3848 |
| 3849 void FullCodeGenerator::EmitToName(CallRuntime* expr) { |
| 3850 ZoneList<Expression*>* args = expr->arguments(); |
| 3851 DCHECK_EQ(1, args->length()); |
| 3852 |
| 3853 // Load the argument into eax and convert it. |
| 3854 VisitForAccumulatorValue(args->at(0)); |
| 3855 |
| 3856 // Convert the object to a name. |
| 3857 Label convert, done_convert; |
| 3858 __ JumpIfSmi(eax, &convert, Label::kNear); |
| 3859 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE); |
| 3860 __ CmpObjectType(eax, LAST_NAME_TYPE, ecx); |
| 3861 __ j(below_equal, &done_convert, Label::kNear); |
| 3862 __ bind(&convert); |
| 3863 ToStringStub stub(isolate()); |
| 3864 __ CallStub(&stub); |
| 3865 __ bind(&done_convert); |
| 3866 context()->Plug(eax); |
| 3867 } |
| 3868 |
| 3869 |
3836 void FullCodeGenerator::EmitToObject(CallRuntime* expr) { | 3870 void FullCodeGenerator::EmitToObject(CallRuntime* expr) { |
3837 ZoneList<Expression*>* args = expr->arguments(); | 3871 ZoneList<Expression*>* args = expr->arguments(); |
3838 DCHECK_EQ(1, args->length()); | 3872 DCHECK_EQ(1, args->length()); |
3839 | 3873 |
3840 // Load the argument into eax and convert it. | 3874 // Load the argument into eax and convert it. |
3841 VisitForAccumulatorValue(args->at(0)); | 3875 VisitForAccumulatorValue(args->at(0)); |
3842 | 3876 |
3843 ToObjectStub stub(isolate()); | 3877 ToObjectStub stub(isolate()); |
3844 __ CallStub(&stub); | 3878 __ CallStub(&stub); |
3845 context()->Plug(eax); | 3879 context()->Plug(eax); |
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5205 Assembler::target_address_at(call_target_address, | 5239 Assembler::target_address_at(call_target_address, |
5206 unoptimized_code)); | 5240 unoptimized_code)); |
5207 return OSR_AFTER_STACK_CHECK; | 5241 return OSR_AFTER_STACK_CHECK; |
5208 } | 5242 } |
5209 | 5243 |
5210 | 5244 |
5211 } // namespace internal | 5245 } // namespace internal |
5212 } // namespace v8 | 5246 } // namespace v8 |
5213 | 5247 |
5214 #endif // V8_TARGET_ARCH_X87 | 5248 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |