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