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_MIPS64 | 9 #if V8_TARGET_ARCH_MIPS64 |
10 | 10 |
(...skipping 4225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4236 ld(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); | 4236 ld(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); |
4237 lbu(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset)); | 4237 lbu(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset)); |
4238 Branch(fail, hi, scratch, Operand(LAST_NAME_TYPE)); | 4238 Branch(fail, hi, scratch, Operand(LAST_NAME_TYPE)); |
4239 } | 4239 } |
4240 | 4240 |
4241 | 4241 |
4242 // --------------------------------------------------------------------------- | 4242 // --------------------------------------------------------------------------- |
4243 // Support functions. | 4243 // Support functions. |
4244 | 4244 |
4245 | 4245 |
| 4246 void MacroAssembler::GetMapConstructor(Register result, Register map, |
| 4247 Register temp, Register temp2) { |
| 4248 Label done, loop; |
| 4249 ld(result, FieldMemOperand(map, Map::kConstructorOrBackPointerOffset)); |
| 4250 bind(&loop); |
| 4251 JumpIfSmi(result, &done); |
| 4252 GetObjectType(result, temp, temp2); |
| 4253 Branch(&done, ne, temp2, Operand(MAP_TYPE)); |
| 4254 ld(result, FieldMemOperand(result, Map::kConstructorOrBackPointerOffset)); |
| 4255 Branch(&loop); |
| 4256 bind(&done); |
| 4257 } |
| 4258 |
| 4259 |
4246 void MacroAssembler::TryGetFunctionPrototype(Register function, | 4260 void MacroAssembler::TryGetFunctionPrototype(Register function, |
4247 Register result, | 4261 Register result, |
4248 Register scratch, | 4262 Register scratch, |
4249 Label* miss, | 4263 Label* miss, |
4250 bool miss_on_bound_function) { | 4264 bool miss_on_bound_function) { |
4251 Label non_instance; | 4265 Label non_instance; |
4252 if (miss_on_bound_function) { | 4266 if (miss_on_bound_function) { |
4253 // Check that the receiver isn't a smi. | 4267 // Check that the receiver isn't a smi. |
4254 JumpIfSmi(function, miss); | 4268 JumpIfSmi(function, miss); |
4255 | 4269 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4288 | 4302 |
4289 // Get the prototype from the initial map. | 4303 // Get the prototype from the initial map. |
4290 ld(result, FieldMemOperand(result, Map::kPrototypeOffset)); | 4304 ld(result, FieldMemOperand(result, Map::kPrototypeOffset)); |
4291 | 4305 |
4292 if (miss_on_bound_function) { | 4306 if (miss_on_bound_function) { |
4293 jmp(&done); | 4307 jmp(&done); |
4294 | 4308 |
4295 // Non-instance prototype: Fetch prototype from constructor field | 4309 // Non-instance prototype: Fetch prototype from constructor field |
4296 // in initial map. | 4310 // in initial map. |
4297 bind(&non_instance); | 4311 bind(&non_instance); |
4298 ld(result, FieldMemOperand(result, Map::kConstructorOffset)); | 4312 GetMapConstructor(result, result, scratch, at); |
4299 } | 4313 } |
4300 | 4314 |
4301 // All done. | 4315 // All done. |
4302 bind(&done); | 4316 bind(&done); |
4303 } | 4317 } |
4304 | 4318 |
4305 | 4319 |
4306 void MacroAssembler::GetObjectType(Register object, | 4320 void MacroAssembler::GetObjectType(Register object, |
4307 Register map, | 4321 Register map, |
4308 Register type_reg) { | 4322 Register type_reg) { |
(...skipping 1868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6177 } | 6191 } |
6178 if (mag.shift > 0) sra(result, result, mag.shift); | 6192 if (mag.shift > 0) sra(result, result, mag.shift); |
6179 srl(at, dividend, 31); | 6193 srl(at, dividend, 31); |
6180 Addu(result, result, Operand(at)); | 6194 Addu(result, result, Operand(at)); |
6181 } | 6195 } |
6182 | 6196 |
6183 | 6197 |
6184 } } // namespace v8::internal | 6198 } } // namespace v8::internal |
6185 | 6199 |
6186 #endif // V8_TARGET_ARCH_MIPS64 | 6200 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |