| 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 #if V8_TARGET_ARCH_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
| (...skipping 4728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4739 lw(result, FieldMemOperand(map, Map::kConstructorOrBackPointerOffset)); | 4739 lw(result, FieldMemOperand(map, Map::kConstructorOrBackPointerOffset)); |
| 4740 bind(&loop); | 4740 bind(&loop); |
| 4741 JumpIfSmi(result, &done); | 4741 JumpIfSmi(result, &done); |
| 4742 GetObjectType(result, temp, temp2); | 4742 GetObjectType(result, temp, temp2); |
| 4743 Branch(&done, ne, temp2, Operand(MAP_TYPE)); | 4743 Branch(&done, ne, temp2, Operand(MAP_TYPE)); |
| 4744 lw(result, FieldMemOperand(result, Map::kConstructorOrBackPointerOffset)); | 4744 lw(result, FieldMemOperand(result, Map::kConstructorOrBackPointerOffset)); |
| 4745 Branch(&loop); | 4745 Branch(&loop); |
| 4746 bind(&done); | 4746 bind(&done); |
| 4747 } | 4747 } |
| 4748 | 4748 |
| 4749 | |
| 4750 void MacroAssembler::TryGetFunctionPrototype(Register function, Register result, | |
| 4751 Register scratch, Label* miss) { | |
| 4752 // Get the prototype or initial map from the function. | |
| 4753 lw(result, | |
| 4754 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | |
| 4755 | |
| 4756 // If the prototype or initial map is the hole, don't return it and | |
| 4757 // simply miss the cache instead. This will allow us to allocate a | |
| 4758 // prototype object on-demand in the runtime system. | |
| 4759 LoadRoot(t8, Heap::kTheHoleValueRootIndex); | |
| 4760 Branch(miss, eq, result, Operand(t8)); | |
| 4761 | |
| 4762 // If the function does not have an initial map, we're done. | |
| 4763 Label done; | |
| 4764 GetObjectType(result, scratch, scratch); | |
| 4765 Branch(&done, ne, scratch, Operand(MAP_TYPE)); | |
| 4766 | |
| 4767 // Get the prototype from the initial map. | |
| 4768 lw(result, FieldMemOperand(result, Map::kPrototypeOffset)); | |
| 4769 | |
| 4770 // All done. | |
| 4771 bind(&done); | |
| 4772 } | |
| 4773 | |
| 4774 | |
| 4775 void MacroAssembler::GetObjectType(Register object, | 4749 void MacroAssembler::GetObjectType(Register object, |
| 4776 Register map, | 4750 Register map, |
| 4777 Register type_reg) { | 4751 Register type_reg) { |
| 4778 lw(map, FieldMemOperand(object, HeapObject::kMapOffset)); | 4752 lw(map, FieldMemOperand(object, HeapObject::kMapOffset)); |
| 4779 lbu(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 4753 lbu(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
| 4780 } | 4754 } |
| 4781 | 4755 |
| 4782 | 4756 |
| 4783 // ----------------------------------------------------------------------------- | 4757 // ----------------------------------------------------------------------------- |
| 4784 // Runtime calls. | 4758 // Runtime calls. |
| (...skipping 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6519 if (mag.shift > 0) sra(result, result, mag.shift); | 6493 if (mag.shift > 0) sra(result, result, mag.shift); |
| 6520 srl(at, dividend, 31); | 6494 srl(at, dividend, 31); |
| 6521 Addu(result, result, Operand(at)); | 6495 Addu(result, result, Operand(at)); |
| 6522 } | 6496 } |
| 6523 | 6497 |
| 6524 | 6498 |
| 6525 } // namespace internal | 6499 } // namespace internal |
| 6526 } // namespace v8 | 6500 } // namespace v8 |
| 6527 | 6501 |
| 6528 #endif // V8_TARGET_ARCH_MIPS | 6502 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |