OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1691 | 1691 |
1692 Label non_callable, non_function, non_smi; | 1692 Label non_callable, non_function, non_smi; |
1693 __ JumpIfSmi(r4, &non_callable); | 1693 __ JumpIfSmi(r4, &non_callable); |
1694 __ bind(&non_smi); | 1694 __ bind(&non_smi); |
1695 __ CompareObjectType(r4, r7, r8, JS_FUNCTION_TYPE); | 1695 __ CompareObjectType(r4, r7, r8, JS_FUNCTION_TYPE); |
1696 __ Jump(masm->isolate()->builtins()->CallFunction(mode), | 1696 __ Jump(masm->isolate()->builtins()->CallFunction(mode), |
1697 RelocInfo::CODE_TARGET, eq); | 1697 RelocInfo::CODE_TARGET, eq); |
1698 __ cmpi(r8, Operand(JS_PROXY_TYPE)); | 1698 __ cmpi(r8, Operand(JS_PROXY_TYPE)); |
1699 __ bne(&non_function); | 1699 __ bne(&non_function); |
1700 | 1700 |
1701 // 1. Call to proxy. | 1701 // 1. Runtime fallback for Proxy [[Call]]. |
1702 // TODO(neis): Implement [[Call]] on proxies. | 1702 __ Push(r4); |
| 1703 // Increase the arguments size to include the pushed function and the |
| 1704 // existing receiver on the stack. |
| 1705 __ addi(r3, r3, Operand(2)); |
| 1706 // Tail-call to the runtime. |
| 1707 __ JumpToExternalReference( |
| 1708 ExternalReference(Runtime::kJSProxyCall, masm->isolate())); |
1703 | 1709 |
1704 // 2. Call to something else, which might have a [[Call]] internal method (if | 1710 // 2. Call to something else, which might have a [[Call]] internal method (if |
1705 // not we raise an exception). | 1711 // not we raise an exception). |
1706 __ bind(&non_function); | 1712 __ bind(&non_function); |
1707 // Check if target has a [[Call]] internal method. | 1713 // Check if target has a [[Call]] internal method. |
1708 __ lbz(r7, FieldMemOperand(r7, Map::kBitFieldOffset)); | 1714 __ lbz(r7, FieldMemOperand(r7, Map::kBitFieldOffset)); |
1709 __ TestBit(r7, Map::kIsCallable, r0); | 1715 __ TestBit(r7, Map::kIsCallable, r0); |
1710 __ beq(&non_callable, cr0); | 1716 __ beq(&non_callable, cr0); |
1711 // Overwrite the original receiver the (original) target. | 1717 // Overwrite the original receiver the (original) target. |
1712 __ ShiftLeftImm(r8, r3, Operand(kPointerSizeLog2)); | 1718 __ ShiftLeftImm(r8, r3, Operand(kPointerSizeLog2)); |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1965 __ bkpt(0); | 1971 __ bkpt(0); |
1966 } | 1972 } |
1967 } | 1973 } |
1968 | 1974 |
1969 | 1975 |
1970 #undef __ | 1976 #undef __ |
1971 } // namespace internal | 1977 } // namespace internal |
1972 } // namespace v8 | 1978 } // namespace v8 |
1973 | 1979 |
1974 #endif // V8_TARGET_ARCH_PPC | 1980 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |