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 "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #if V8_TARGET_ARCH_MIPS | 9 #if V8_TARGET_ARCH_MIPS |
10 | 10 |
(...skipping 3074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3085 | 3085 |
3086 | 3086 |
3087 void MacroAssembler::Ret(Condition cond, | 3087 void MacroAssembler::Ret(Condition cond, |
3088 Register rs, | 3088 Register rs, |
3089 const Operand& rt, | 3089 const Operand& rt, |
3090 BranchDelaySlot bd) { | 3090 BranchDelaySlot bd) { |
3091 Jump(ra, cond, rs, rt, bd); | 3091 Jump(ra, cond, rs, rt, bd); |
3092 } | 3092 } |
3093 | 3093 |
3094 | 3094 |
3095 void MacroAssembler::J(Label* L, BranchDelaySlot bdslot) { | |
3096 BlockTrampolinePoolScope block_trampoline_pool(this); | |
3097 | |
3098 uint32_t imm28; | |
3099 imm28 = jump_address(L); | |
3100 imm28 &= kImm28Mask; | |
3101 { BlockGrowBufferScope block_buf_growth(this); | |
3102 // Buffer growth (and relocation) must be blocked for internal references | |
3103 // until associated instructions are emitted and available to be patched. | |
3104 RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE_ENCODED); | |
3105 j(imm28); | |
3106 } | |
3107 // Emit a nop in the branch delay slot if required. | |
3108 if (bdslot == PROTECT) | |
3109 nop(); | |
3110 } | |
3111 | |
3112 | |
3113 void MacroAssembler::Jr(Label* L, BranchDelaySlot bdslot) { | 3095 void MacroAssembler::Jr(Label* L, BranchDelaySlot bdslot) { |
3114 BlockTrampolinePoolScope block_trampoline_pool(this); | 3096 BlockTrampolinePoolScope block_trampoline_pool(this); |
3115 | 3097 |
3116 uint32_t imm32; | 3098 uint32_t imm32; |
3117 imm32 = jump_address(L); | 3099 imm32 = jump_address(L); |
3118 { BlockGrowBufferScope block_buf_growth(this); | 3100 { BlockGrowBufferScope block_buf_growth(this); |
3119 // Buffer growth (and relocation) must be blocked for internal references | 3101 // Buffer growth (and relocation) must be blocked for internal references |
3120 // until associated instructions are emitted and available to be patched. | 3102 // until associated instructions are emitted and available to be patched. |
3121 RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE_ENCODED); | 3103 RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE_ENCODED); |
3122 lui(at, (imm32 & kHiMask) >> kLuiShift); | 3104 lui(at, (imm32 & kHiMask) >> kLuiShift); |
(...skipping 2943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6066 } | 6048 } |
6067 if (mag.shift > 0) sra(result, result, mag.shift); | 6049 if (mag.shift > 0) sra(result, result, mag.shift); |
6068 srl(at, dividend, 31); | 6050 srl(at, dividend, 31); |
6069 Addu(result, result, Operand(at)); | 6051 Addu(result, result, Operand(at)); |
6070 } | 6052 } |
6071 | 6053 |
6072 | 6054 |
6073 } } // namespace v8::internal | 6055 } } // namespace v8::internal |
6074 | 6056 |
6075 #endif // V8_TARGET_ARCH_MIPS | 6057 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |