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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
(...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1876 Label ok; | 1876 Label ok; |
1877 test(result, result); | 1877 test(result, result); |
1878 j(not_zero, &ok); | 1878 j(not_zero, &ok); |
1879 mov(scratch, op1); | 1879 mov(scratch, op1); |
1880 or_(scratch, op2); | 1880 or_(scratch, op2); |
1881 j(sign, then_label); | 1881 j(sign, then_label); |
1882 bind(&ok); | 1882 bind(&ok); |
1883 } | 1883 } |
1884 | 1884 |
1885 | 1885 |
| 1886 void MacroAssembler::GetMapConstructor(Register result, Register map, |
| 1887 Register temp) { |
| 1888 Label done, loop; |
| 1889 mov(result, FieldOperand(map, Map::kConstructorOrBackPointerOffset)); |
| 1890 bind(&loop); |
| 1891 JumpIfSmi(result, &done); |
| 1892 CmpObjectType(result, MAP_TYPE, temp); |
| 1893 j(not_equal, &done); |
| 1894 mov(result, FieldOperand(result, Map::kConstructorOrBackPointerOffset)); |
| 1895 jmp(&loop); |
| 1896 bind(&done); |
| 1897 } |
| 1898 |
| 1899 |
1886 void MacroAssembler::TryGetFunctionPrototype(Register function, | 1900 void MacroAssembler::TryGetFunctionPrototype(Register function, |
1887 Register result, | 1901 Register result, |
1888 Register scratch, | 1902 Register scratch, |
1889 Label* miss, | 1903 Label* miss, |
1890 bool miss_on_bound_function) { | 1904 bool miss_on_bound_function) { |
1891 Label non_instance; | 1905 Label non_instance; |
1892 if (miss_on_bound_function) { | 1906 if (miss_on_bound_function) { |
1893 // Check that the receiver isn't a smi. | 1907 // Check that the receiver isn't a smi. |
1894 JumpIfSmi(function, miss); | 1908 JumpIfSmi(function, miss); |
1895 | 1909 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1927 | 1941 |
1928 // Get the prototype from the initial map. | 1942 // Get the prototype from the initial map. |
1929 mov(result, FieldOperand(result, Map::kPrototypeOffset)); | 1943 mov(result, FieldOperand(result, Map::kPrototypeOffset)); |
1930 | 1944 |
1931 if (miss_on_bound_function) { | 1945 if (miss_on_bound_function) { |
1932 jmp(&done); | 1946 jmp(&done); |
1933 | 1947 |
1934 // Non-instance prototype: Fetch prototype from constructor field | 1948 // Non-instance prototype: Fetch prototype from constructor field |
1935 // in initial map. | 1949 // in initial map. |
1936 bind(&non_instance); | 1950 bind(&non_instance); |
1937 mov(result, FieldOperand(result, Map::kConstructorOffset)); | 1951 GetMapConstructor(result, result, scratch); |
1938 } | 1952 } |
1939 | 1953 |
1940 // All done. | 1954 // All done. |
1941 bind(&done); | 1955 bind(&done); |
1942 } | 1956 } |
1943 | 1957 |
1944 | 1958 |
1945 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) { | 1959 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) { |
1946 DCHECK(AllowThisStubCall(stub)); // Calls are not allowed in some stubs. | 1960 DCHECK(AllowThisStubCall(stub)); // Calls are not allowed in some stubs. |
1947 call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id); | 1961 call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id); |
(...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3197 if (mag.shift > 0) sar(edx, mag.shift); | 3211 if (mag.shift > 0) sar(edx, mag.shift); |
3198 mov(eax, dividend); | 3212 mov(eax, dividend); |
3199 shr(eax, 31); | 3213 shr(eax, 31); |
3200 add(edx, eax); | 3214 add(edx, eax); |
3201 } | 3215 } |
3202 | 3216 |
3203 | 3217 |
3204 } } // namespace v8::internal | 3218 } } // namespace v8::internal |
3205 | 3219 |
3206 #endif // V8_TARGET_ARCH_X87 | 3220 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |