OLD | NEW |
1 | |
2 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 3 // found in the LICENSE file. |
5 | 4 |
6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
7 | 6 |
8 #if V8_TARGET_ARCH_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
9 | 8 |
10 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
11 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
(...skipping 4725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4737 } | 4736 } |
4738 } else { | 4737 } else { |
4739 // Slot is in the current function context. Move it into the | 4738 // Slot is in the current function context. Move it into the |
4740 // destination register in case we store into it (the write barrier | 4739 // destination register in case we store into it (the write barrier |
4741 // cannot be allowed to destroy the context in esi). | 4740 // cannot be allowed to destroy the context in esi). |
4742 Move(dst, cp); | 4741 Move(dst, cp); |
4743 } | 4742 } |
4744 } | 4743 } |
4745 | 4744 |
4746 | 4745 |
4747 void MacroAssembler::LoadGlobalProxy(Register dst) { | |
4748 lw(dst, GlobalObjectOperand()); | |
4749 lw(dst, FieldMemOperand(dst, GlobalObject::kGlobalProxyOffset)); | |
4750 } | |
4751 | |
4752 | |
4753 void MacroAssembler::LoadTransitionedArrayMapConditional( | 4746 void MacroAssembler::LoadTransitionedArrayMapConditional( |
4754 ElementsKind expected_kind, | 4747 ElementsKind expected_kind, |
4755 ElementsKind transitioned_kind, | 4748 ElementsKind transitioned_kind, |
4756 Register map_in_out, | 4749 Register map_in_out, |
4757 Register scratch, | 4750 Register scratch, |
4758 Label* no_map_match) { | 4751 Label* no_map_match) { |
4759 // Load the global or builtins object from the current context. | 4752 // Load the global or builtins object from the current context. |
4760 lw(scratch, | 4753 lw(scratch, |
4761 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 4754 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
4762 lw(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset)); | 4755 lw(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset)); |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5167 SmiTst(object, t0); | 5160 SmiTst(object, t0); |
5168 Check(ne, kOperandIsASmiAndNotAName, t0, Operand(zero_reg)); | 5161 Check(ne, kOperandIsASmiAndNotAName, t0, Operand(zero_reg)); |
5169 push(object); | 5162 push(object); |
5170 lw(object, FieldMemOperand(object, HeapObject::kMapOffset)); | 5163 lw(object, FieldMemOperand(object, HeapObject::kMapOffset)); |
5171 lbu(object, FieldMemOperand(object, Map::kInstanceTypeOffset)); | 5164 lbu(object, FieldMemOperand(object, Map::kInstanceTypeOffset)); |
5172 Check(le, kOperandIsNotAName, object, Operand(LAST_NAME_TYPE)); | 5165 Check(le, kOperandIsNotAName, object, Operand(LAST_NAME_TYPE)); |
5173 pop(object); | 5166 pop(object); |
5174 } | 5167 } |
5175 } | 5168 } |
5176 | 5169 |
5177 | |
5178 void MacroAssembler::AssertFunction(Register object) { | |
5179 if (emit_debug_code()) { | |
5180 STATIC_ASSERT(kSmiTag == 0); | |
5181 SmiTst(object, t0); | |
5182 Check(ne, kOperandIsASmiAndNotAFunction, t0, Operand(zero_reg)); | |
5183 push(object); | |
5184 GetObjectType(object, object, object); | |
5185 pop(object); | |
5186 Check(ne, kOperandIsNotAFunction, object, Operand(JS_FUNCTION_TYPE)); | |
5187 } | |
5188 } | |
5189 | |
5190 | 5170 |
5191 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object, | 5171 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object, |
5192 Register scratch) { | 5172 Register scratch) { |
5193 if (emit_debug_code()) { | 5173 if (emit_debug_code()) { |
5194 Label done_checking; | 5174 Label done_checking; |
5195 AssertNotSmi(object); | 5175 AssertNotSmi(object); |
5196 LoadRoot(scratch, Heap::kUndefinedValueRootIndex); | 5176 LoadRoot(scratch, Heap::kUndefinedValueRootIndex); |
5197 Branch(&done_checking, eq, object, Operand(scratch)); | 5177 Branch(&done_checking, eq, object, Operand(scratch)); |
5198 push(object); | 5178 push(object); |
5199 lw(object, FieldMemOperand(object, HeapObject::kMapOffset)); | 5179 lw(object, FieldMemOperand(object, HeapObject::kMapOffset)); |
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6024 if (mag.shift > 0) sra(result, result, mag.shift); | 6004 if (mag.shift > 0) sra(result, result, mag.shift); |
6025 srl(at, dividend, 31); | 6005 srl(at, dividend, 31); |
6026 Addu(result, result, Operand(at)); | 6006 Addu(result, result, Operand(at)); |
6027 } | 6007 } |
6028 | 6008 |
6029 | 6009 |
6030 } // namespace internal | 6010 } // namespace internal |
6031 } // namespace v8 | 6011 } // namespace v8 |
6032 | 6012 |
6033 #endif // V8_TARGET_ARCH_MIPS | 6013 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |