| 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 1907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1918 } | 1918 } |
| 1919 | 1919 |
| 1920 void MacroAssembler::AllocateTwoByteString(Register result, Register length, | 1920 void MacroAssembler::AllocateTwoByteString(Register result, Register length, |
| 1921 Register scratch1, Register scratch2, | 1921 Register scratch1, Register scratch2, |
| 1922 Register scratch3, | 1922 Register scratch3, |
| 1923 Label* gc_required) { | 1923 Label* gc_required) { |
| 1924 // Calculate the number of bytes needed for the characters in the string while | 1924 // Calculate the number of bytes needed for the characters in the string while |
| 1925 // observing object alignment. | 1925 // observing object alignment. |
| 1926 DCHECK((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0); | 1926 DCHECK((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0); |
| 1927 | 1927 |
| 1928 ShiftLeft(scratch1, length, Operand(1)); // Length in bytes, not chars. | 1928 ShiftLeftP(scratch1, length, Operand(1)); // Length in bytes, not chars. |
| 1929 AddP(scratch1, Operand(kObjectAlignmentMask + SeqTwoByteString::kHeaderSize)); | 1929 AddP(scratch1, Operand(kObjectAlignmentMask + SeqTwoByteString::kHeaderSize)); |
| 1930 | 1930 |
| 1931 AndP(scratch1, Operand(~kObjectAlignmentMask)); | 1931 AndP(scratch1, Operand(~kObjectAlignmentMask)); |
| 1932 | 1932 |
| 1933 // Allocate two-byte string in new space. | 1933 // Allocate two-byte string in new space. |
| 1934 Allocate(scratch1, result, scratch2, scratch3, gc_required, | 1934 Allocate(scratch1, result, scratch2, scratch3, gc_required, |
| 1935 NO_ALLOCATION_FLAGS); | 1935 NO_ALLOCATION_FLAGS); |
| 1936 | 1936 |
| 1937 // Set the map, length and hash field. | 1937 // Set the map, length and hash field. |
| 1938 InitializeNewString(result, length, Heap::kStringMapRootIndex, scratch1, | 1938 InitializeNewString(result, length, Heap::kStringMapRootIndex, scratch1, |
| (...skipping 3479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5418 } | 5418 } |
| 5419 if (mag.shift > 0) ShiftRightArith(result, result, Operand(mag.shift)); | 5419 if (mag.shift > 0) ShiftRightArith(result, result, Operand(mag.shift)); |
| 5420 ExtractBit(r0, dividend, 31); | 5420 ExtractBit(r0, dividend, 31); |
| 5421 AddP(result, r0); | 5421 AddP(result, r0); |
| 5422 } | 5422 } |
| 5423 | 5423 |
| 5424 } // namespace internal | 5424 } // namespace internal |
| 5425 } // namespace v8 | 5425 } // namespace v8 |
| 5426 | 5426 |
| 5427 #endif // V8_TARGET_ARCH_S390 | 5427 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |