| 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 1844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1855 __ j(not_equal, &slow_case); | 1855 __ j(not_equal, &slow_case); |
| 1856 __ LoadRoot(eax, Heap::kFalseValueRootIndex); | 1856 __ LoadRoot(eax, Heap::kFalseValueRootIndex); |
| 1857 __ ret(0); | 1857 __ ret(0); |
| 1858 | 1858 |
| 1859 // Fast-case: The {function} must be a valid JSFunction. | 1859 // Fast-case: The {function} must be a valid JSFunction. |
| 1860 __ bind(&fast_case); | 1860 __ bind(&fast_case); |
| 1861 __ JumpIfSmi(function, &slow_case); | 1861 __ JumpIfSmi(function, &slow_case); |
| 1862 __ CmpObjectType(function, JS_FUNCTION_TYPE, function_map); | 1862 __ CmpObjectType(function, JS_FUNCTION_TYPE, function_map); |
| 1863 __ j(not_equal, &slow_case); | 1863 __ j(not_equal, &slow_case); |
| 1864 | 1864 |
| 1865 // Go to the runtime if the function is not a constructor. |
| 1866 __ test_b(FieldOperand(function_map, Map::kBitFieldOffset), |
| 1867 static_cast<uint8_t>(1 << Map::kIsConstructor)); |
| 1868 __ j(zero, &slow_case); |
| 1869 |
| 1865 // Ensure that {function} has an instance prototype. | 1870 // Ensure that {function} has an instance prototype. |
| 1866 __ test_b(FieldOperand(function_map, Map::kBitFieldOffset), | 1871 __ test_b(FieldOperand(function_map, Map::kBitFieldOffset), |
| 1867 static_cast<uint8_t>(1 << Map::kHasNonInstancePrototype)); | 1872 static_cast<uint8_t>(1 << Map::kHasNonInstancePrototype)); |
| 1868 __ j(not_zero, &slow_case); | 1873 __ j(not_zero, &slow_case); |
| 1869 | 1874 |
| 1870 // Get the "prototype" (or initial map) of the {function}. | 1875 // Get the "prototype" (or initial map) of the {function}. |
| 1871 __ mov(function_prototype, | 1876 __ mov(function_prototype, |
| 1872 FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | 1877 FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); |
| 1873 __ AssertNotSmi(function_prototype); | 1878 __ AssertNotSmi(function_prototype); |
| 1874 | 1879 |
| (...skipping 3652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5527 return_value_operand, NULL); | 5532 return_value_operand, NULL); |
| 5528 } | 5533 } |
| 5529 | 5534 |
| 5530 | 5535 |
| 5531 #undef __ | 5536 #undef __ |
| 5532 | 5537 |
| 5533 } // namespace internal | 5538 } // namespace internal |
| 5534 } // namespace v8 | 5539 } // namespace v8 |
| 5535 | 5540 |
| 5536 #endif // V8_TARGET_ARCH_X87 | 5541 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |