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/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1678 | 1678 |
1679 Label non_callable, non_function, non_smi; | 1679 Label non_callable, non_function, non_smi; |
1680 __ JumpIfSmi(r1, &non_callable); | 1680 __ JumpIfSmi(r1, &non_callable); |
1681 __ bind(&non_smi); | 1681 __ bind(&non_smi); |
1682 __ CompareObjectType(r1, r4, r5, JS_FUNCTION_TYPE); | 1682 __ CompareObjectType(r1, r4, r5, JS_FUNCTION_TYPE); |
1683 __ Jump(masm->isolate()->builtins()->CallFunction(mode), | 1683 __ Jump(masm->isolate()->builtins()->CallFunction(mode), |
1684 RelocInfo::CODE_TARGET, eq); | 1684 RelocInfo::CODE_TARGET, eq); |
1685 __ cmp(r5, Operand(JS_PROXY_TYPE)); | 1685 __ cmp(r5, Operand(JS_PROXY_TYPE)); |
1686 __ b(ne, &non_function); | 1686 __ b(ne, &non_function); |
1687 | 1687 |
1688 // 1. Call to Proxy. | 1688 // 1. Runtime fallback for Proxy [[Call]]. |
1689 // TODO(neis): Implement [[Call]] on proxies. | 1689 __ Push(r1); |
| 1690 // Increase the arguments size to include the pushed function and the |
| 1691 // existing receiver on the stack. |
| 1692 __ add(r0, r0, Operand(2)); |
| 1693 // Tail-call to the runtime. |
| 1694 __ JumpToExternalReference( |
| 1695 ExternalReference(Runtime::kJSProxyCall, masm->isolate())); |
1690 | 1696 |
1691 // 2. Call to something else, which might have a [[Call]] internal method (if | 1697 // 2. Call to something else, which might have a [[Call]] internal method (if |
1692 // not we raise an exception). | 1698 // not we raise an exception). |
1693 __ bind(&non_function); | 1699 __ bind(&non_function); |
1694 // Check if target has a [[Call]] internal method. | 1700 // Check if target has a [[Call]] internal method. |
1695 __ ldrb(r4, FieldMemOperand(r4, Map::kBitFieldOffset)); | 1701 __ ldrb(r4, FieldMemOperand(r4, Map::kBitFieldOffset)); |
1696 __ tst(r4, Operand(1 << Map::kIsCallable)); | 1702 __ tst(r4, Operand(1 << Map::kIsCallable)); |
1697 __ b(eq, &non_callable); | 1703 __ b(eq, &non_callable); |
1698 // Overwrite the original receiver the (original) target. | 1704 // Overwrite the original receiver the (original) target. |
1699 __ str(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2)); | 1705 __ str(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2)); |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1937 } | 1943 } |
1938 } | 1944 } |
1939 | 1945 |
1940 | 1946 |
1941 #undef __ | 1947 #undef __ |
1942 | 1948 |
1943 } // namespace internal | 1949 } // namespace internal |
1944 } // namespace v8 | 1950 } // namespace v8 |
1945 | 1951 |
1946 #endif // V8_TARGET_ARCH_ARM | 1952 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |