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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/base/division-by-constant.h" | 9 #include "src/base/division-by-constant.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1630 if (kArchVariant == kMips64r6) { | 1630 if (kArchVariant == kMips64r6) { |
1631 sdc1(fd, rs); | 1631 sdc1(fd, rs); |
1632 } else { | 1632 } else { |
1633 DCHECK(kArchVariant == kMips64r2); | 1633 DCHECK(kArchVariant == kMips64r2); |
1634 dmfc1(scratch, fd); | 1634 dmfc1(scratch, fd); |
1635 Usd(scratch, rs); | 1635 Usd(scratch, rs); |
1636 } | 1636 } |
1637 } | 1637 } |
1638 | 1638 |
1639 void MacroAssembler::li(Register dst, Handle<Object> value, LiFlags mode) { | 1639 void MacroAssembler::li(Register dst, Handle<Object> value, LiFlags mode) { |
1640 AllowDeferredHandleDereference smi_check; | 1640 li(dst, Operand(value), mode); |
1641 if (value->IsSmi()) { | |
1642 li(dst, Operand(value), mode); | |
1643 } else { | |
1644 DCHECK(value->IsHeapObject()); | |
1645 if (isolate()->heap()->InNewSpace(*value)) { | |
1646 Handle<Cell> cell = isolate()->factory()->NewCell(value); | |
1647 li(dst, Operand(cell)); | |
1648 ld(dst, FieldMemOperand(dst, Cell::kValueOffset)); | |
1649 } else { | |
1650 li(dst, Operand(value)); | |
1651 } | |
1652 } | |
1653 } | 1641 } |
1654 | 1642 |
1655 static inline int64_t ShiftAndFixSignExtension(int64_t imm, int bitnum) { | 1643 static inline int64_t ShiftAndFixSignExtension(int64_t imm, int bitnum) { |
1656 if ((imm >> (bitnum - 1)) & 0x1) { | 1644 if ((imm >> (bitnum - 1)) & 0x1) { |
1657 imm = (imm >> bitnum) + 1; | 1645 imm = (imm >> bitnum) + 1; |
1658 } else { | 1646 } else { |
1659 imm = imm >> bitnum; | 1647 imm = imm >> bitnum; |
1660 } | 1648 } |
1661 return imm; | 1649 return imm; |
1662 } | 1650 } |
(...skipping 5596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7259 if (mag.shift > 0) sra(result, result, mag.shift); | 7247 if (mag.shift > 0) sra(result, result, mag.shift); |
7260 srl(at, dividend, 31); | 7248 srl(at, dividend, 31); |
7261 Addu(result, result, Operand(at)); | 7249 Addu(result, result, Operand(at)); |
7262 } | 7250 } |
7263 | 7251 |
7264 | 7252 |
7265 } // namespace internal | 7253 } // namespace internal |
7266 } // namespace v8 | 7254 } // namespace v8 |
7267 | 7255 |
7268 #endif // V8_TARGET_ARCH_MIPS64 | 7256 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |