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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1364 __ b(ne, &slow_case); | 1364 __ b(ne, &slow_case); |
1365 __ LoadRoot(r0, Heap::kFalseValueRootIndex); | 1365 __ LoadRoot(r0, Heap::kFalseValueRootIndex); |
1366 __ Ret(); | 1366 __ Ret(); |
1367 | 1367 |
1368 // Fast-case: The {function} must be a valid JSFunction. | 1368 // Fast-case: The {function} must be a valid JSFunction. |
1369 __ bind(&fast_case); | 1369 __ bind(&fast_case); |
1370 __ JumpIfSmi(function, &slow_case); | 1370 __ JumpIfSmi(function, &slow_case); |
1371 __ CompareObjectType(function, function_map, scratch, JS_FUNCTION_TYPE); | 1371 __ CompareObjectType(function, function_map, scratch, JS_FUNCTION_TYPE); |
1372 __ b(ne, &slow_case); | 1372 __ b(ne, &slow_case); |
1373 | 1373 |
| 1374 // Go to the runtime if the function is not a constructor. |
| 1375 __ ldrb(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset)); |
| 1376 __ tst(scratch, Operand(1 << Map::kIsConstructor)); |
| 1377 __ b(eq, &slow_case); |
| 1378 |
1374 // Ensure that {function} has an instance prototype. | 1379 // Ensure that {function} has an instance prototype. |
1375 __ ldrb(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset)); | |
1376 __ tst(scratch, Operand(1 << Map::kHasNonInstancePrototype)); | 1380 __ tst(scratch, Operand(1 << Map::kHasNonInstancePrototype)); |
1377 __ b(ne, &slow_case); | 1381 __ b(ne, &slow_case); |
1378 | 1382 |
1379 // Get the "prototype" (or initial map) of the {function}. | 1383 // Get the "prototype" (or initial map) of the {function}. |
1380 __ ldr(function_prototype, | 1384 __ ldr(function_prototype, |
1381 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | 1385 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); |
1382 __ AssertNotSmi(function_prototype); | 1386 __ AssertNotSmi(function_prototype); |
1383 | 1387 |
1384 // Resolve the prototype if the {function} has an initial map. Afterwards the | 1388 // Resolve the prototype if the {function} has an initial map. Afterwards the |
1385 // {function_prototype} will be either the JSReceiver prototype object or the | 1389 // {function_prototype} will be either the JSReceiver prototype object or the |
(...skipping 4180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5566 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5570 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5567 } | 5571 } |
5568 | 5572 |
5569 | 5573 |
5570 #undef __ | 5574 #undef __ |
5571 | 5575 |
5572 } // namespace internal | 5576 } // namespace internal |
5573 } // namespace v8 | 5577 } // namespace v8 |
5574 | 5578 |
5575 #endif // V8_TARGET_ARCH_ARM | 5579 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |