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 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1590 if (kArchVariant == kMips64r6) { | 1590 if (kArchVariant == kMips64r6) { |
1591 sdc1(fd, rs); | 1591 sdc1(fd, rs); |
1592 } else { | 1592 } else { |
1593 DCHECK(kArchVariant == kMips64r2); | 1593 DCHECK(kArchVariant == kMips64r2); |
1594 dmfc1(scratch, fd); | 1594 dmfc1(scratch, fd); |
1595 Usd(scratch, rs); | 1595 Usd(scratch, rs); |
1596 } | 1596 } |
1597 } | 1597 } |
1598 | 1598 |
1599 void MacroAssembler::li(Register dst, Handle<Object> value, LiFlags mode) { | 1599 void MacroAssembler::li(Register dst, Handle<Object> value, LiFlags mode) { |
1600 AllowDeferredHandleDereference smi_check; | 1600 li(dst, Operand(value), mode); |
1601 if (value->IsSmi()) { | |
1602 li(dst, Operand(value), mode); | |
1603 } else { | |
1604 DCHECK(value->IsHeapObject()); | |
1605 if (isolate()->heap()->InNewSpace(*value)) { | |
1606 Handle<Cell> cell = isolate()->factory()->NewCell(value); | |
1607 li(dst, Operand(cell)); | |
1608 ld(dst, FieldMemOperand(dst, Cell::kValueOffset)); | |
1609 } else { | |
1610 li(dst, Operand(value)); | |
1611 } | |
1612 } | |
1613 } | 1601 } |
1614 | 1602 |
1615 static inline int64_t ShiftAndFixSignExtension(int64_t imm, int bitnum) { | 1603 static inline int64_t ShiftAndFixSignExtension(int64_t imm, int bitnum) { |
1616 if ((imm >> (bitnum - 1)) & 0x1) { | 1604 if ((imm >> (bitnum - 1)) & 0x1) { |
1617 imm = (imm >> bitnum) + 1; | 1605 imm = (imm >> bitnum) + 1; |
1618 } else { | 1606 } else { |
1619 imm = imm >> bitnum; | 1607 imm = imm >> bitnum; |
1620 } | 1608 } |
1621 return imm; | 1609 return imm; |
1622 } | 1610 } |
(...skipping 5597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7220 if (mag.shift > 0) sra(result, result, mag.shift); | 7208 if (mag.shift > 0) sra(result, result, mag.shift); |
7221 srl(at, dividend, 31); | 7209 srl(at, dividend, 31); |
7222 Addu(result, result, Operand(at)); | 7210 Addu(result, result, Operand(at)); |
7223 } | 7211 } |
7224 | 7212 |
7225 | 7213 |
7226 } // namespace internal | 7214 } // namespace internal |
7227 } // namespace v8 | 7215 } // namespace v8 |
7228 | 7216 |
7229 #endif // V8_TARGET_ARCH_MIPS64 | 7217 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |