OLD | NEW |
1 | 1 |
2 // Copyright 2012 the V8 project authors. All rights reserved. | 2 // Copyright 2012 the V8 project authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
7 | 7 |
8 #if V8_TARGET_ARCH_MIPS | 8 #if V8_TARGET_ARCH_MIPS |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1218 } | 1218 } |
1219 addiu(sp, sp, stack_offset); | 1219 addiu(sp, sp, stack_offset); |
1220 } | 1220 } |
1221 | 1221 |
1222 | 1222 |
1223 void MacroAssembler::FlushICache(Register address, unsigned instructions) { | 1223 void MacroAssembler::FlushICache(Register address, unsigned instructions) { |
1224 RegList saved_regs = kJSCallerSaved | ra.bit(); | 1224 RegList saved_regs = kJSCallerSaved | ra.bit(); |
1225 MultiPush(saved_regs); | 1225 MultiPush(saved_regs); |
1226 AllowExternalCallThatCantCauseGC scope(this); | 1226 AllowExternalCallThatCantCauseGC scope(this); |
1227 | 1227 |
1228 // Save to a0 in case address == t0. | |
1229 Move(a0, address); | 1228 Move(a0, address); |
1230 PrepareCallCFunction(2, t0); | 1229 PrepareCallCFunction(2, t8); |
1231 | 1230 |
1232 li(a1, instructions * kInstrSize); | 1231 li(a1, instructions * kInstrSize); |
1233 CallCFunction(ExternalReference::flush_icache_function(isolate()), 2); | 1232 CallCFunction(ExternalReference::flush_icache_function(isolate()), 2); |
1234 MultiPop(saved_regs); | 1233 MultiPop(saved_regs); |
1235 } | 1234 } |
1236 | 1235 |
1237 | 1236 |
1238 void MacroAssembler::Ext(Register rt, | 1237 void MacroAssembler::Ext(Register rt, |
1239 Register rs, | 1238 Register rs, |
1240 uint16_t pos, | 1239 uint16_t pos, |
(...skipping 3902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5143 STATIC_ASSERT(kSmiTag == 0); | 5142 STATIC_ASSERT(kSmiTag == 0); |
5144 andi(at, object, kSmiTagMask); | 5143 andi(at, object, kSmiTagMask); |
5145 Check(eq, kOperandIsASmi, at, Operand(zero_reg)); | 5144 Check(eq, kOperandIsASmi, at, Operand(zero_reg)); |
5146 } | 5145 } |
5147 } | 5146 } |
5148 | 5147 |
5149 | 5148 |
5150 void MacroAssembler::AssertString(Register object) { | 5149 void MacroAssembler::AssertString(Register object) { |
5151 if (emit_debug_code()) { | 5150 if (emit_debug_code()) { |
5152 STATIC_ASSERT(kSmiTag == 0); | 5151 STATIC_ASSERT(kSmiTag == 0); |
5153 SmiTst(object, t0); | 5152 SmiTst(object, t8); |
5154 Check(ne, kOperandIsASmiAndNotAString, t0, Operand(zero_reg)); | 5153 Check(ne, kOperandIsASmiAndNotAString, t8, Operand(zero_reg)); |
5155 push(object); | 5154 GetObjectType(object, t8, t8); |
5156 lw(object, FieldMemOperand(object, HeapObject::kMapOffset)); | 5155 Check(lo, kOperandIsNotAString, t8, Operand(FIRST_NONSTRING_TYPE)); |
5157 lbu(object, FieldMemOperand(object, Map::kInstanceTypeOffset)); | |
5158 Check(lo, kOperandIsNotAString, object, Operand(FIRST_NONSTRING_TYPE)); | |
5159 pop(object); | |
5160 } | 5156 } |
5161 } | 5157 } |
5162 | 5158 |
5163 | 5159 |
5164 void MacroAssembler::AssertName(Register object) { | 5160 void MacroAssembler::AssertName(Register object) { |
5165 if (emit_debug_code()) { | 5161 if (emit_debug_code()) { |
5166 STATIC_ASSERT(kSmiTag == 0); | 5162 STATIC_ASSERT(kSmiTag == 0); |
5167 SmiTst(object, t0); | 5163 SmiTst(object, t8); |
5168 Check(ne, kOperandIsASmiAndNotAName, t0, Operand(zero_reg)); | 5164 Check(ne, kOperandIsASmiAndNotAName, t8, Operand(zero_reg)); |
5169 push(object); | 5165 GetObjectType(object, t8, t8); |
5170 lw(object, FieldMemOperand(object, HeapObject::kMapOffset)); | 5166 Check(le, kOperandIsNotAName, t8, Operand(LAST_NAME_TYPE)); |
5171 lbu(object, FieldMemOperand(object, Map::kInstanceTypeOffset)); | |
5172 Check(le, kOperandIsNotAName, object, Operand(LAST_NAME_TYPE)); | |
5173 pop(object); | |
5174 } | 5167 } |
5175 } | 5168 } |
5176 | 5169 |
5177 | 5170 |
5178 void MacroAssembler::AssertFunction(Register object) { | 5171 void MacroAssembler::AssertFunction(Register object) { |
5179 if (emit_debug_code()) { | 5172 if (emit_debug_code()) { |
5180 STATIC_ASSERT(kSmiTag == 0); | 5173 STATIC_ASSERT(kSmiTag == 0); |
5181 SmiTst(object, t0); | 5174 SmiTst(object, t8); |
5182 Check(ne, kOperandIsASmiAndNotAFunction, t0, Operand(zero_reg)); | 5175 Check(ne, kOperandIsASmiAndNotAFunction, t8, Operand(zero_reg)); |
5183 GetObjectType(object, t0, t0); | 5176 GetObjectType(object, t8, t8); |
5184 Check(eq, kOperandIsNotAFunction, t0, Operand(JS_FUNCTION_TYPE)); | 5177 Check(eq, kOperandIsNotAFunction, t8, Operand(JS_FUNCTION_TYPE)); |
5185 } | 5178 } |
5186 } | 5179 } |
5187 | 5180 |
5188 | 5181 |
5189 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object, | 5182 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object, |
5190 Register scratch) { | 5183 Register scratch) { |
5191 if (emit_debug_code()) { | 5184 if (emit_debug_code()) { |
5192 Label done_checking; | 5185 Label done_checking; |
5193 AssertNotSmi(object); | 5186 AssertNotSmi(object); |
5194 LoadRoot(scratch, Heap::kUndefinedValueRootIndex); | 5187 LoadRoot(scratch, Heap::kUndefinedValueRootIndex); |
5195 Branch(&done_checking, eq, object, Operand(scratch)); | 5188 Branch(&done_checking, eq, object, Operand(scratch)); |
5196 push(object); | 5189 lw(t8, FieldMemOperand(object, HeapObject::kMapOffset)); |
5197 lw(object, FieldMemOperand(object, HeapObject::kMapOffset)); | |
5198 LoadRoot(scratch, Heap::kAllocationSiteMapRootIndex); | 5190 LoadRoot(scratch, Heap::kAllocationSiteMapRootIndex); |
5199 Assert(eq, kExpectedUndefinedOrCell, object, Operand(scratch)); | 5191 Assert(eq, kExpectedUndefinedOrCell, t8, Operand(scratch)); |
5200 pop(object); | |
5201 bind(&done_checking); | 5192 bind(&done_checking); |
5202 } | 5193 } |
5203 } | 5194 } |
5204 | 5195 |
5205 | 5196 |
5206 void MacroAssembler::AssertIsRoot(Register reg, Heap::RootListIndex index) { | 5197 void MacroAssembler::AssertIsRoot(Register reg, Heap::RootListIndex index) { |
5207 if (emit_debug_code()) { | 5198 if (emit_debug_code()) { |
5208 DCHECK(!reg.is(at)); | 5199 DCHECK(!reg.is(at)); |
5209 LoadRoot(at, index); | 5200 LoadRoot(at, index); |
5210 Check(eq, kHeapNumberMapRegisterClobbered, reg, Operand(at)); | 5201 Check(eq, kHeapNumberMapRegisterClobbered, reg, Operand(at)); |
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6022 if (mag.shift > 0) sra(result, result, mag.shift); | 6013 if (mag.shift > 0) sra(result, result, mag.shift); |
6023 srl(at, dividend, 31); | 6014 srl(at, dividend, 31); |
6024 Addu(result, result, Operand(at)); | 6015 Addu(result, result, Operand(at)); |
6025 } | 6016 } |
6026 | 6017 |
6027 | 6018 |
6028 } // namespace internal | 6019 } // namespace internal |
6029 } // namespace v8 | 6020 } // namespace v8 |
6030 | 6021 |
6031 #endif // V8_TARGET_ARCH_MIPS | 6022 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |