| 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 #include <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
| 6 | 6 |
| 7 #include "v8.h" | 7 #include "v8.h" |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_ARM | 9 #if V8_TARGET_ARCH_ARM |
| 10 | 10 |
| (...skipping 3757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3768 | 3768 |
| 3769 // For inputs < 255 (including negative) vcvt_u32_f64 with round-to-nearest | 3769 // For inputs < 255 (including negative) vcvt_u32_f64 with round-to-nearest |
| 3770 // rounding mode will provide the correct result. | 3770 // rounding mode will provide the correct result. |
| 3771 vcvt_u32_f64(double_scratch.low(), input_reg, kFPSCRRounding); | 3771 vcvt_u32_f64(double_scratch.low(), input_reg, kFPSCRRounding); |
| 3772 vmov(result_reg, double_scratch.low()); | 3772 vmov(result_reg, double_scratch.low()); |
| 3773 | 3773 |
| 3774 bind(&done); | 3774 bind(&done); |
| 3775 } | 3775 } |
| 3776 | 3776 |
| 3777 | 3777 |
| 3778 void MacroAssembler::Throw(BailoutReason reason) { | |
| 3779 Label throw_start; | |
| 3780 bind(&throw_start); | |
| 3781 #ifdef DEBUG | |
| 3782 const char* msg = GetBailoutReason(reason); | |
| 3783 if (msg != NULL) { | |
| 3784 RecordComment("Throw message: "); | |
| 3785 RecordComment(msg); | |
| 3786 } | |
| 3787 #endif | |
| 3788 | |
| 3789 mov(r0, Operand(Smi::FromInt(reason))); | |
| 3790 push(r0); | |
| 3791 // Disable stub call restrictions to always allow calls to throw. | |
| 3792 if (!has_frame_) { | |
| 3793 // We don't actually want to generate a pile of code for this, so just | |
| 3794 // claim there is a stack frame, without generating one. | |
| 3795 FrameScope scope(this, StackFrame::NONE); | |
| 3796 CallRuntime(Runtime::kHiddenThrowMessage, 1); | |
| 3797 } else { | |
| 3798 CallRuntime(Runtime::kHiddenThrowMessage, 1); | |
| 3799 } | |
| 3800 // will not return here | |
| 3801 if (is_const_pool_blocked()) { | |
| 3802 // If the calling code cares throw the exact number of | |
| 3803 // instructions generated, we insert padding here to keep the size | |
| 3804 // of the ThrowMessage macro constant. | |
| 3805 static const int kExpectedThrowMessageInstructions = 10; | |
| 3806 int throw_instructions = InstructionsGeneratedSince(&throw_start); | |
| 3807 ASSERT(throw_instructions <= kExpectedThrowMessageInstructions); | |
| 3808 while (throw_instructions++ < kExpectedThrowMessageInstructions) { | |
| 3809 nop(); | |
| 3810 } | |
| 3811 } | |
| 3812 } | |
| 3813 | |
| 3814 | |
| 3815 void MacroAssembler::ThrowIf(Condition cc, BailoutReason reason) { | |
| 3816 Label L; | |
| 3817 b(NegateCondition(cc), &L); | |
| 3818 Throw(reason); | |
| 3819 // will not return here | |
| 3820 bind(&L); | |
| 3821 } | |
| 3822 | |
| 3823 | |
| 3824 void MacroAssembler::LoadInstanceDescriptors(Register map, | 3778 void MacroAssembler::LoadInstanceDescriptors(Register map, |
| 3825 Register descriptors) { | 3779 Register descriptors) { |
| 3826 ldr(descriptors, FieldMemOperand(map, Map::kDescriptorsOffset)); | 3780 ldr(descriptors, FieldMemOperand(map, Map::kDescriptorsOffset)); |
| 3827 } | 3781 } |
| 3828 | 3782 |
| 3829 | 3783 |
| 3830 void MacroAssembler::NumberOfOwnDescriptors(Register dst, Register map) { | 3784 void MacroAssembler::NumberOfOwnDescriptors(Register dst, Register map) { |
| 3831 ldr(dst, FieldMemOperand(map, Map::kBitField3Offset)); | 3785 ldr(dst, FieldMemOperand(map, Map::kBitField3Offset)); |
| 3832 DecodeField<Map::NumberOfOwnDescriptorsBits>(dst); | 3786 DecodeField<Map::NumberOfOwnDescriptorsBits>(dst); |
| 3833 } | 3787 } |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4040 sub(result, result, Operand(dividend)); | 3994 sub(result, result, Operand(dividend)); |
| 4041 } | 3995 } |
| 4042 if (ms.shift() > 0) mov(result, Operand(result, ASR, ms.shift())); | 3996 if (ms.shift() > 0) mov(result, Operand(result, ASR, ms.shift())); |
| 4043 add(result, result, Operand(dividend, LSR, 31)); | 3997 add(result, result, Operand(dividend, LSR, 31)); |
| 4044 } | 3998 } |
| 4045 | 3999 |
| 4046 | 4000 |
| 4047 } } // namespace v8::internal | 4001 } } // namespace v8::internal |
| 4048 | 4002 |
| 4049 #endif // V8_TARGET_ARCH_ARM | 4003 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |