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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1860 __ CallRuntime(Runtime::kStringCharFromCode); | 1860 __ CallRuntime(Runtime::kStringCharFromCode); |
1861 if (!result_.is(eax)) { | 1861 if (!result_.is(eax)) { |
1862 __ mov(result_, eax); | 1862 __ mov(result_, eax); |
1863 } | 1863 } |
1864 call_helper.AfterCall(masm); | 1864 call_helper.AfterCall(masm); |
1865 __ jmp(&exit_); | 1865 __ jmp(&exit_); |
1866 | 1866 |
1867 __ Abort(kUnexpectedFallthroughFromCharFromCodeSlowCase); | 1867 __ Abort(kUnexpectedFallthroughFromCharFromCodeSlowCase); |
1868 } | 1868 } |
1869 | 1869 |
1870 | |
1871 void StringHelper::GenerateCopyCharacters(MacroAssembler* masm, | |
1872 Register dest, | |
1873 Register src, | |
1874 Register count, | |
1875 Register scratch, | |
1876 String::Encoding encoding) { | |
1877 DCHECK(!scratch.is(dest)); | |
1878 DCHECK(!scratch.is(src)); | |
1879 DCHECK(!scratch.is(count)); | |
1880 | |
1881 // Nothing to do for zero characters. | |
1882 Label done; | |
1883 __ test(count, count); | |
1884 __ j(zero, &done); | |
1885 | |
1886 // Make count the number of bytes to copy. | |
1887 if (encoding == String::TWO_BYTE_ENCODING) { | |
1888 __ shl(count, 1); | |
1889 } | |
1890 | |
1891 Label loop; | |
1892 __ bind(&loop); | |
1893 __ mov_b(scratch, Operand(src, 0)); | |
1894 __ mov_b(Operand(dest, 0), scratch); | |
1895 __ inc(src); | |
1896 __ inc(dest); | |
1897 __ dec(count); | |
1898 __ j(not_zero, &loop); | |
1899 | |
1900 __ bind(&done); | |
1901 } | |
1902 | |
1903 | |
1904 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, | 1870 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, |
1905 Register left, | 1871 Register left, |
1906 Register right, | 1872 Register right, |
1907 Register scratch1, | 1873 Register scratch1, |
1908 Register scratch2) { | 1874 Register scratch2) { |
1909 Register length = scratch1; | 1875 Register length = scratch1; |
1910 | 1876 |
1911 // Compare lengths. | 1877 // Compare lengths. |
1912 Label strings_not_equal, check_zero_length; | 1878 Label strings_not_equal, check_zero_length; |
1913 __ mov(length, FieldOperand(left, String::kLengthOffset)); | 1879 __ mov(length, FieldOperand(left, String::kLengthOffset)); |
(...skipping 2305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4219 kStackUnwindSpace, nullptr, return_value_operand, | 4185 kStackUnwindSpace, nullptr, return_value_operand, |
4220 NULL); | 4186 NULL); |
4221 } | 4187 } |
4222 | 4188 |
4223 #undef __ | 4189 #undef __ |
4224 | 4190 |
4225 } // namespace internal | 4191 } // namespace internal |
4226 } // namespace v8 | 4192 } // namespace v8 |
4227 | 4193 |
4228 #endif // V8_TARGET_ARCH_X87 | 4194 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |