Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: src/arm64/builtins-arm64.cc

Issue 1499593003: [runtime] [proxy] Implementing [[Call]] (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updating comment Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/deoptimizer.h" 10 #include "src/deoptimizer.h"
(...skipping 1659 matching lines...) Expand 10 before | Expand all | Expand 10 after
1670 1670
1671 Label non_callable, non_function, non_smi; 1671 Label non_callable, non_function, non_smi;
1672 __ JumpIfSmi(x1, &non_callable); 1672 __ JumpIfSmi(x1, &non_callable);
1673 __ Bind(&non_smi); 1673 __ Bind(&non_smi);
1674 __ CompareObjectType(x1, x4, x5, JS_FUNCTION_TYPE); 1674 __ CompareObjectType(x1, x4, x5, JS_FUNCTION_TYPE);
1675 __ Jump(masm->isolate()->builtins()->CallFunction(mode), 1675 __ Jump(masm->isolate()->builtins()->CallFunction(mode),
1676 RelocInfo::CODE_TARGET, eq); 1676 RelocInfo::CODE_TARGET, eq);
1677 __ Cmp(x5, JS_PROXY_TYPE); 1677 __ Cmp(x5, JS_PROXY_TYPE);
1678 __ B(ne, &non_function); 1678 __ B(ne, &non_function);
1679 1679
1680 // 1. Call to proxy. 1680 // 1. Runtime fallback for Proxy [[Call]].
1681 // TODO(neis): This doesn't match the ES6 spec for [[Call]] on proxies. 1681 __ Push(x1);
1682 // Increase the arguments size to include the pushed function and the
1683 // existing receiver on the stack.
1684 __ Add(x0, x0, Operand(2));
1685 // Tail-call to the runtime.
1686 __ JumpToExternalReference(
1687 ExternalReference(Runtime::kJSProxyCall, masm->isolate()));
1682 1688
1683 // 2. Call to something else, which might have a [[Call]] internal method (if 1689 // 2. Call to something else, which might have a [[Call]] internal method (if
1684 // not we raise an exception). 1690 // not we raise an exception).
1685 __ Bind(&non_function); 1691 __ Bind(&non_function);
1686 // Check if target has a [[Call]] internal method. 1692 // Check if target has a [[Call]] internal method.
1687 __ Ldrb(x4, FieldMemOperand(x4, Map::kBitFieldOffset)); 1693 __ Ldrb(x4, FieldMemOperand(x4, Map::kBitFieldOffset));
1688 __ TestAndBranchIfAllClear(x4, 1 << Map::kIsCallable, &non_callable); 1694 __ TestAndBranchIfAllClear(x4, 1 << Map::kIsCallable, &non_callable);
1689 // Overwrite the original receiver with the (original) target. 1695 // Overwrite the original receiver with the (original) target.
1690 __ Poke(x1, Operand(x0, LSL, kXRegSizeLog2)); 1696 __ Poke(x1, Operand(x0, LSL, kXRegSizeLog2));
1691 // Let the "call_as_function_delegate" take care of the rest. 1697 // Let the "call_as_function_delegate" take care of the rest.
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
2022 } 2028 }
2023 } 2029 }
2024 2030
2025 2031
2026 #undef __ 2032 #undef __
2027 2033
2028 } // namespace internal 2034 } // namespace internal
2029 } // namespace v8 2035 } // namespace v8
2030 2036
2031 #endif // V8_TARGET_ARCH_ARM 2037 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698