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 4303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4314 lw(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); | 4314 lw(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); |
4315 lbu(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset)); | 4315 lbu(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset)); |
4316 Branch(fail, hi, scratch, Operand(LAST_NAME_TYPE)); | 4316 Branch(fail, hi, scratch, Operand(LAST_NAME_TYPE)); |
4317 } | 4317 } |
4318 | 4318 |
4319 | 4319 |
4320 // --------------------------------------------------------------------------- | 4320 // --------------------------------------------------------------------------- |
4321 // Support functions. | 4321 // Support functions. |
4322 | 4322 |
4323 | 4323 |
| 4324 void MacroAssembler::GetMapConstructor(Register result, Register map, |
| 4325 Register temp, Register temp2) { |
| 4326 Label done, loop; |
| 4327 lw(result, FieldMemOperand(map, Map::kConstructorOrBackPointerOffset)); |
| 4328 bind(&loop); |
| 4329 JumpIfSmi(result, &done); |
| 4330 GetObjectType(result, temp, temp2); |
| 4331 Branch(&done, ne, temp2, Operand(MAP_TYPE)); |
| 4332 lw(result, FieldMemOperand(result, Map::kConstructorOrBackPointerOffset)); |
| 4333 Branch(&loop); |
| 4334 bind(&done); |
| 4335 } |
| 4336 |
| 4337 |
4324 void MacroAssembler::TryGetFunctionPrototype(Register function, | 4338 void MacroAssembler::TryGetFunctionPrototype(Register function, |
4325 Register result, | 4339 Register result, |
4326 Register scratch, | 4340 Register scratch, |
4327 Label* miss, | 4341 Label* miss, |
4328 bool miss_on_bound_function) { | 4342 bool miss_on_bound_function) { |
4329 Label non_instance; | 4343 Label non_instance; |
4330 if (miss_on_bound_function) { | 4344 if (miss_on_bound_function) { |
4331 // Check that the receiver isn't a smi. | 4345 // Check that the receiver isn't a smi. |
4332 JumpIfSmi(function, miss); | 4346 JumpIfSmi(function, miss); |
4333 | 4347 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4366 | 4380 |
4367 // Get the prototype from the initial map. | 4381 // Get the prototype from the initial map. |
4368 lw(result, FieldMemOperand(result, Map::kPrototypeOffset)); | 4382 lw(result, FieldMemOperand(result, Map::kPrototypeOffset)); |
4369 | 4383 |
4370 if (miss_on_bound_function) { | 4384 if (miss_on_bound_function) { |
4371 jmp(&done); | 4385 jmp(&done); |
4372 | 4386 |
4373 // Non-instance prototype: Fetch prototype from constructor field | 4387 // Non-instance prototype: Fetch prototype from constructor field |
4374 // in initial map. | 4388 // in initial map. |
4375 bind(&non_instance); | 4389 bind(&non_instance); |
4376 lw(result, FieldMemOperand(result, Map::kConstructorOffset)); | 4390 GetMapConstructor(result, result, scratch, at); |
4377 } | 4391 } |
4378 | 4392 |
4379 // All done. | 4393 // All done. |
4380 bind(&done); | 4394 bind(&done); |
4381 } | 4395 } |
4382 | 4396 |
4383 | 4397 |
4384 void MacroAssembler::GetObjectType(Register object, | 4398 void MacroAssembler::GetObjectType(Register object, |
4385 Register map, | 4399 Register map, |
4386 Register type_reg) { | 4400 Register type_reg) { |
(...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6157 } | 6171 } |
6158 if (mag.shift > 0) sra(result, result, mag.shift); | 6172 if (mag.shift > 0) sra(result, result, mag.shift); |
6159 srl(at, dividend, 31); | 6173 srl(at, dividend, 31); |
6160 Addu(result, result, Operand(at)); | 6174 Addu(result, result, Operand(at)); |
6161 } | 6175 } |
6162 | 6176 |
6163 | 6177 |
6164 } } // namespace v8::internal | 6178 } } // namespace v8::internal |
6165 | 6179 |
6166 #endif // V8_TARGET_ARCH_MIPS | 6180 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |