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 "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
10 #include "codegen.h" | 10 #include "codegen.h" |
(...skipping 2768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2779 RecordComment("Abort message: "); | 2779 RecordComment("Abort message: "); |
2780 RecordComment(msg); | 2780 RecordComment(msg); |
2781 } | 2781 } |
2782 | 2782 |
2783 if (FLAG_trap_on_abort) { | 2783 if (FLAG_trap_on_abort) { |
2784 int3(); | 2784 int3(); |
2785 return; | 2785 return; |
2786 } | 2786 } |
2787 #endif | 2787 #endif |
2788 | 2788 |
2789 push(eax); | |
2790 push(Immediate(reinterpret_cast<intptr_t>(Smi::FromInt(reason)))); | 2789 push(Immediate(reinterpret_cast<intptr_t>(Smi::FromInt(reason)))); |
2791 // Disable stub call restrictions to always allow calls to abort. | 2790 // Disable stub call restrictions to always allow calls to abort. |
2792 if (!has_frame_) { | 2791 if (!has_frame_) { |
2793 // We don't actually want to generate a pile of code for this, so just | 2792 // We don't actually want to generate a pile of code for this, so just |
2794 // claim there is a stack frame, without generating one. | 2793 // claim there is a stack frame, without generating one. |
2795 FrameScope scope(this, StackFrame::NONE); | 2794 FrameScope scope(this, StackFrame::NONE); |
2796 CallRuntime(Runtime::kAbort, 1); | 2795 CallRuntime(Runtime::kAbort, 1); |
2797 } else { | 2796 } else { |
2798 CallRuntime(Runtime::kAbort, 1); | 2797 CallRuntime(Runtime::kAbort, 1); |
2799 } | 2798 } |
2800 // will not return here | 2799 // will not return here |
2801 int3(); | 2800 int3(); |
2802 } | 2801 } |
2803 | 2802 |
2804 | 2803 |
2805 void MacroAssembler::Throw(BailoutReason reason) { | |
2806 #ifdef DEBUG | |
2807 const char* msg = GetBailoutReason(reason); | |
2808 if (msg != NULL) { | |
2809 RecordComment("Throw message: "); | |
2810 RecordComment(msg); | |
2811 } | |
2812 #endif | |
2813 | |
2814 push(eax); | |
2815 push(Immediate(Smi::FromInt(reason))); | |
2816 // Disable stub call restrictions to always allow calls to throw. | |
2817 if (!has_frame_) { | |
2818 // We don't actually want to generate a pile of code for this, so just | |
2819 // claim there is a stack frame, without generating one. | |
2820 FrameScope scope(this, StackFrame::NONE); | |
2821 CallRuntime(Runtime::kHiddenThrowMessage, 1); | |
2822 } else { | |
2823 CallRuntime(Runtime::kHiddenThrowMessage, 1); | |
2824 } | |
2825 // will not return here | |
2826 int3(); | |
2827 } | |
2828 | |
2829 | |
2830 void MacroAssembler::ThrowIf(Condition cc, BailoutReason reason) { | |
2831 Label L; | |
2832 j(NegateCondition(cc), &L); | |
2833 Throw(reason); | |
2834 // will not return here | |
2835 bind(&L); | |
2836 } | |
2837 | |
2838 | |
2839 void MacroAssembler::LoadInstanceDescriptors(Register map, | 2804 void MacroAssembler::LoadInstanceDescriptors(Register map, |
2840 Register descriptors) { | 2805 Register descriptors) { |
2841 mov(descriptors, FieldOperand(map, Map::kDescriptorsOffset)); | 2806 mov(descriptors, FieldOperand(map, Map::kDescriptorsOffset)); |
2842 } | 2807 } |
2843 | 2808 |
2844 | 2809 |
2845 void MacroAssembler::NumberOfOwnDescriptors(Register dst, Register map) { | 2810 void MacroAssembler::NumberOfOwnDescriptors(Register dst, Register map) { |
2846 mov(dst, FieldOperand(map, Map::kBitField3Offset)); | 2811 mov(dst, FieldOperand(map, Map::kBitField3Offset)); |
2847 DecodeField<Map::NumberOfOwnDescriptorsBits>(dst); | 2812 DecodeField<Map::NumberOfOwnDescriptorsBits>(dst); |
2848 } | 2813 } |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3436 if (ms.shift() > 0) sar(edx, ms.shift()); | 3401 if (ms.shift() > 0) sar(edx, ms.shift()); |
3437 mov(eax, dividend); | 3402 mov(eax, dividend); |
3438 shr(eax, 31); | 3403 shr(eax, 31); |
3439 add(edx, eax); | 3404 add(edx, eax); |
3440 } | 3405 } |
3441 | 3406 |
3442 | 3407 |
3443 } } // namespace v8::internal | 3408 } } // namespace v8::internal |
3444 | 3409 |
3445 #endif // V8_TARGET_ARCH_IA32 | 3410 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |