| 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_X87 | 7 #if V8_TARGET_ARCH_X87 |
| 8 | 8 |
| 9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
| 10 #include "codegen.h" | 10 #include "codegen.h" |
| (...skipping 2665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2676 RecordComment("Abort message: "); | 2676 RecordComment("Abort message: "); |
| 2677 RecordComment(msg); | 2677 RecordComment(msg); |
| 2678 } | 2678 } |
| 2679 | 2679 |
| 2680 if (FLAG_trap_on_abort) { | 2680 if (FLAG_trap_on_abort) { |
| 2681 int3(); | 2681 int3(); |
| 2682 return; | 2682 return; |
| 2683 } | 2683 } |
| 2684 #endif | 2684 #endif |
| 2685 | 2685 |
| 2686 push(eax); | |
| 2687 push(Immediate(reinterpret_cast<intptr_t>(Smi::FromInt(reason)))); | 2686 push(Immediate(reinterpret_cast<intptr_t>(Smi::FromInt(reason)))); |
| 2688 // Disable stub call restrictions to always allow calls to abort. | 2687 // Disable stub call restrictions to always allow calls to abort. |
| 2689 if (!has_frame_) { | 2688 if (!has_frame_) { |
| 2690 // We don't actually want to generate a pile of code for this, so just | 2689 // We don't actually want to generate a pile of code for this, so just |
| 2691 // claim there is a stack frame, without generating one. | 2690 // claim there is a stack frame, without generating one. |
| 2692 FrameScope scope(this, StackFrame::NONE); | 2691 FrameScope scope(this, StackFrame::NONE); |
| 2693 CallRuntime(Runtime::kAbort, 1); | 2692 CallRuntime(Runtime::kAbort, 1); |
| 2694 } else { | 2693 } else { |
| 2695 CallRuntime(Runtime::kAbort, 1); | 2694 CallRuntime(Runtime::kAbort, 1); |
| 2696 } | 2695 } |
| 2697 // will not return here | 2696 // will not return here |
| 2698 int3(); | 2697 int3(); |
| 2699 } | 2698 } |
| 2700 | 2699 |
| 2701 | 2700 |
| 2702 void MacroAssembler::Throw(BailoutReason reason) { | |
| 2703 #ifdef DEBUG | |
| 2704 const char* msg = GetBailoutReason(reason); | |
| 2705 if (msg != NULL) { | |
| 2706 RecordComment("Throw message: "); | |
| 2707 RecordComment(msg); | |
| 2708 } | |
| 2709 #endif | |
| 2710 | |
| 2711 push(eax); | |
| 2712 push(Immediate(Smi::FromInt(reason))); | |
| 2713 // Disable stub call restrictions to always allow calls to throw. | |
| 2714 if (!has_frame_) { | |
| 2715 // We don't actually want to generate a pile of code for this, so just | |
| 2716 // claim there is a stack frame, without generating one. | |
| 2717 FrameScope scope(this, StackFrame::NONE); | |
| 2718 CallRuntime(Runtime::kHiddenThrowMessage, 1); | |
| 2719 } else { | |
| 2720 CallRuntime(Runtime::kHiddenThrowMessage, 1); | |
| 2721 } | |
| 2722 // will not return here | |
| 2723 int3(); | |
| 2724 } | |
| 2725 | |
| 2726 | |
| 2727 void MacroAssembler::ThrowIf(Condition cc, BailoutReason reason) { | |
| 2728 Label L; | |
| 2729 j(NegateCondition(cc), &L); | |
| 2730 Throw(reason); | |
| 2731 // will not return here | |
| 2732 bind(&L); | |
| 2733 } | |
| 2734 | |
| 2735 | |
| 2736 void MacroAssembler::LoadInstanceDescriptors(Register map, | 2701 void MacroAssembler::LoadInstanceDescriptors(Register map, |
| 2737 Register descriptors) { | 2702 Register descriptors) { |
| 2738 mov(descriptors, FieldOperand(map, Map::kDescriptorsOffset)); | 2703 mov(descriptors, FieldOperand(map, Map::kDescriptorsOffset)); |
| 2739 } | 2704 } |
| 2740 | 2705 |
| 2741 | 2706 |
| 2742 void MacroAssembler::NumberOfOwnDescriptors(Register dst, Register map) { | 2707 void MacroAssembler::NumberOfOwnDescriptors(Register dst, Register map) { |
| 2743 mov(dst, FieldOperand(map, Map::kBitField3Offset)); | 2708 mov(dst, FieldOperand(map, Map::kBitField3Offset)); |
| 2744 DecodeField<Map::NumberOfOwnDescriptorsBits>(dst); | 2709 DecodeField<Map::NumberOfOwnDescriptorsBits>(dst); |
| 2745 } | 2710 } |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3323 if (ms.shift() > 0) sar(edx, ms.shift()); | 3288 if (ms.shift() > 0) sar(edx, ms.shift()); |
| 3324 mov(eax, dividend); | 3289 mov(eax, dividend); |
| 3325 shr(eax, 31); | 3290 shr(eax, 31); |
| 3326 add(edx, eax); | 3291 add(edx, eax); |
| 3327 } | 3292 } |
| 3328 | 3293 |
| 3329 | 3294 |
| 3330 } } // namespace v8::internal | 3295 } } // namespace v8::internal |
| 3331 | 3296 |
| 3332 #endif // V8_TARGET_ARCH_X87 | 3297 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |