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 3643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3654 // Update the write barrier. Save the value as it will be | 3654 // Update the write barrier. Save the value as it will be |
3655 // overwritten by the write barrier code and is needed afterward. | 3655 // overwritten by the write barrier code and is needed afterward. |
3656 __ movp(rdx, rax); | 3656 __ movp(rdx, rax); |
3657 __ RecordWriteField(rbx, JSValue::kValueOffset, rdx, rcx, kDontSaveFPRegs); | 3657 __ RecordWriteField(rbx, JSValue::kValueOffset, rdx, rcx, kDontSaveFPRegs); |
3658 | 3658 |
3659 __ bind(&done); | 3659 __ bind(&done); |
3660 context()->Plug(rax); | 3660 context()->Plug(rax); |
3661 } | 3661 } |
3662 | 3662 |
3663 | 3663 |
| 3664 void FullCodeGenerator::EmitToInteger(CallRuntime* expr) { |
| 3665 ZoneList<Expression*>* args = expr->arguments(); |
| 3666 DCHECK_EQ(1, args->length()); |
| 3667 |
| 3668 // Load the argument into rax and convert it. |
| 3669 VisitForAccumulatorValue(args->at(0)); |
| 3670 |
| 3671 // Convert the object to an integer. |
| 3672 Label done_convert; |
| 3673 __ JumpIfSmi(rax, &done_convert, Label::kNear); |
| 3674 __ Push(rax); |
| 3675 __ CallRuntime(Runtime::kToInteger, 1); |
| 3676 __ bind(&done_convert); |
| 3677 context()->Plug(rax); |
| 3678 } |
| 3679 |
| 3680 |
3664 void FullCodeGenerator::EmitNumberToString(CallRuntime* expr) { | 3681 void FullCodeGenerator::EmitNumberToString(CallRuntime* expr) { |
3665 ZoneList<Expression*>* args = expr->arguments(); | 3682 ZoneList<Expression*>* args = expr->arguments(); |
3666 DCHECK_EQ(args->length(), 1); | 3683 DCHECK_EQ(args->length(), 1); |
3667 | 3684 |
3668 // Load the argument into rax and call the stub. | 3685 // Load the argument into rax and call the stub. |
3669 VisitForAccumulatorValue(args->at(0)); | 3686 VisitForAccumulatorValue(args->at(0)); |
3670 | 3687 |
3671 NumberToStringStub stub(isolate()); | 3688 NumberToStringStub stub(isolate()); |
3672 __ CallStub(&stub); | 3689 __ CallStub(&stub); |
3673 context()->Plug(rax); | 3690 context()->Plug(rax); |
(...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5142 Assembler::target_address_at(call_target_address, | 5159 Assembler::target_address_at(call_target_address, |
5143 unoptimized_code)); | 5160 unoptimized_code)); |
5144 return OSR_AFTER_STACK_CHECK; | 5161 return OSR_AFTER_STACK_CHECK; |
5145 } | 5162 } |
5146 | 5163 |
5147 | 5164 |
5148 } // namespace internal | 5165 } // namespace internal |
5149 } // namespace v8 | 5166 } // namespace v8 |
5150 | 5167 |
5151 #endif // V8_TARGET_ARCH_X64 | 5168 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |