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 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1576 if (kArchVariant == kMips64r6) { | 1576 if (kArchVariant == kMips64r6) { |
1577 sdc1(fd, rs); | 1577 sdc1(fd, rs); |
1578 } else { | 1578 } else { |
1579 DCHECK(kArchVariant == kMips64r2); | 1579 DCHECK(kArchVariant == kMips64r2); |
1580 dmfc1(scratch, fd); | 1580 dmfc1(scratch, fd); |
1581 Usd(scratch, rs); | 1581 Usd(scratch, rs); |
1582 } | 1582 } |
1583 } | 1583 } |
1584 | 1584 |
1585 void MacroAssembler::li(Register dst, Handle<Object> value, LiFlags mode) { | 1585 void MacroAssembler::li(Register dst, Handle<Object> value, LiFlags mode) { |
1586 AllowDeferredHandleDereference smi_check; | |
1587 if (value->IsSmi()) { | 1586 if (value->IsSmi()) { |
1588 li(dst, Operand(value), mode); | 1587 li(dst, Operand(value), mode); |
1589 } else { | 1588 } else { |
1590 DCHECK(value->IsHeapObject()); | 1589 DCHECK(value->IsHeapObject()); |
1591 if (isolate()->heap()->InNewSpace(*value)) { | 1590 li(dst, Operand(value)); |
1592 Handle<Cell> cell = isolate()->factory()->NewCell(value); | |
1593 li(dst, Operand(cell)); | |
1594 ld(dst, FieldMemOperand(dst, Cell::kValueOffset)); | |
1595 } else { | |
1596 li(dst, Operand(value)); | |
1597 } | |
1598 } | 1591 } |
1599 } | 1592 } |
1600 | 1593 |
1601 static inline int64_t ShiftAndFixSignExtension(int64_t imm, int bitnum) { | 1594 static inline int64_t ShiftAndFixSignExtension(int64_t imm, int bitnum) { |
1602 if ((imm >> (bitnum - 1)) & 0x1) { | 1595 if ((imm >> (bitnum - 1)) & 0x1) { |
1603 imm = (imm >> bitnum) + 1; | 1596 imm = (imm >> bitnum) + 1; |
1604 } else { | 1597 } else { |
1605 imm = imm >> bitnum; | 1598 imm = imm >> bitnum; |
1606 } | 1599 } |
1607 return imm; | 1600 return imm; |
(...skipping 5532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7140 if (mag.shift > 0) sra(result, result, mag.shift); | 7133 if (mag.shift > 0) sra(result, result, mag.shift); |
7141 srl(at, dividend, 31); | 7134 srl(at, dividend, 31); |
7142 Addu(result, result, Operand(at)); | 7135 Addu(result, result, Operand(at)); |
7143 } | 7136 } |
7144 | 7137 |
7145 | 7138 |
7146 } // namespace internal | 7139 } // namespace internal |
7147 } // namespace v8 | 7140 } // namespace v8 |
7148 | 7141 |
7149 #endif // V8_TARGET_ARCH_MIPS64 | 7142 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |