OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 <assert.h> // For assert | 5 #include <assert.h> // For assert |
6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
7 | 7 |
8 #if V8_TARGET_ARCH_S390 | 8 #if V8_TARGET_ARCH_S390 |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1699 | 1699 |
1700 // Get the value at the masked, scaled index and return. | 1700 // Get the value at the masked, scaled index and return. |
1701 const int kValueOffset = | 1701 const int kValueOffset = |
1702 SeededNumberDictionary::kElementsStartOffset + kPointerSize; | 1702 SeededNumberDictionary::kElementsStartOffset + kPointerSize; |
1703 LoadP(result, FieldMemOperand(t2, kValueOffset)); | 1703 LoadP(result, FieldMemOperand(t2, kValueOffset)); |
1704 } | 1704 } |
1705 | 1705 |
1706 void MacroAssembler::Allocate(int object_size, Register result, | 1706 void MacroAssembler::Allocate(int object_size, Register result, |
1707 Register scratch1, Register scratch2, | 1707 Register scratch1, Register scratch2, |
1708 Label* gc_required, AllocationFlags flags) { | 1708 Label* gc_required, AllocationFlags flags) { |
1709 DCHECK(object_size <= Page::kMaxRegularHeapObjectSize); | 1709 DCHECK(object_size <= kMaxRegularHeapObjectSize); |
1710 DCHECK((flags & ALLOCATION_FOLDED) == 0); | 1710 DCHECK((flags & ALLOCATION_FOLDED) == 0); |
1711 if (!FLAG_inline_new) { | 1711 if (!FLAG_inline_new) { |
1712 if (emit_debug_code()) { | 1712 if (emit_debug_code()) { |
1713 // Trash the registers to simulate an allocation failure. | 1713 // Trash the registers to simulate an allocation failure. |
1714 LoadImmP(result, Operand(0x7091)); | 1714 LoadImmP(result, Operand(0x7091)); |
1715 LoadImmP(scratch1, Operand(0x7191)); | 1715 LoadImmP(scratch1, Operand(0x7191)); |
1716 LoadImmP(scratch2, Operand(0x7291)); | 1716 LoadImmP(scratch2, Operand(0x7291)); |
1717 } | 1717 } |
1718 b(gc_required); | 1718 b(gc_required); |
1719 return; | 1719 return; |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1955 } | 1955 } |
1956 StoreP(result_end, MemOperand(top_address)); | 1956 StoreP(result_end, MemOperand(top_address)); |
1957 | 1957 |
1958 // Tag object. | 1958 // Tag object. |
1959 AddP(result, result, Operand(kHeapObjectTag)); | 1959 AddP(result, result, Operand(kHeapObjectTag)); |
1960 } | 1960 } |
1961 | 1961 |
1962 void MacroAssembler::FastAllocate(int object_size, Register result, | 1962 void MacroAssembler::FastAllocate(int object_size, Register result, |
1963 Register scratch1, Register scratch2, | 1963 Register scratch1, Register scratch2, |
1964 AllocationFlags flags) { | 1964 AllocationFlags flags) { |
1965 DCHECK(object_size <= Page::kMaxRegularHeapObjectSize); | 1965 DCHECK(object_size <= kMaxRegularHeapObjectSize); |
1966 DCHECK(!AreAliased(result, scratch1, scratch2, ip)); | 1966 DCHECK(!AreAliased(result, scratch1, scratch2, ip)); |
1967 | 1967 |
1968 // Make object size into bytes. | 1968 // Make object size into bytes. |
1969 if ((flags & SIZE_IN_WORDS) != 0) { | 1969 if ((flags & SIZE_IN_WORDS) != 0) { |
1970 object_size *= kPointerSize; | 1970 object_size *= kPointerSize; |
1971 } | 1971 } |
1972 DCHECK_EQ(0, object_size & kObjectAlignmentMask); | 1972 DCHECK_EQ(0, object_size & kObjectAlignmentMask); |
1973 | 1973 |
1974 ExternalReference allocation_top = | 1974 ExternalReference allocation_top = |
1975 AllocationUtils::GetAllocationTopReference(isolate(), flags); | 1975 AllocationUtils::GetAllocationTopReference(isolate(), flags); |
(...skipping 3557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5533 } | 5533 } |
5534 if (mag.shift > 0) ShiftRightArith(result, result, Operand(mag.shift)); | 5534 if (mag.shift > 0) ShiftRightArith(result, result, Operand(mag.shift)); |
5535 ExtractBit(r0, dividend, 31); | 5535 ExtractBit(r0, dividend, 31); |
5536 AddP(result, r0); | 5536 AddP(result, r0); |
5537 } | 5537 } |
5538 | 5538 |
5539 } // namespace internal | 5539 } // namespace internal |
5540 } // namespace v8 | 5540 } // namespace v8 |
5541 | 5541 |
5542 #endif // V8_TARGET_ARCH_S390 | 5542 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |