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

Side by Side Diff: src/x64/builtins-x64.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/runtime/runtime-proxy.cc ('k') | src/x87/builtins-x87.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 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_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/codegen.h" 8 #include "src/codegen.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 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after
1738 1738
1739 Label non_callable, non_function, non_smi; 1739 Label non_callable, non_function, non_smi;
1740 __ JumpIfSmi(rdi, &non_callable); 1740 __ JumpIfSmi(rdi, &non_callable);
1741 __ bind(&non_smi); 1741 __ bind(&non_smi);
1742 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx); 1742 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx);
1743 __ j(equal, masm->isolate()->builtins()->CallFunction(mode), 1743 __ j(equal, masm->isolate()->builtins()->CallFunction(mode),
1744 RelocInfo::CODE_TARGET); 1744 RelocInfo::CODE_TARGET);
1745 __ CmpInstanceType(rcx, JS_PROXY_TYPE); 1745 __ CmpInstanceType(rcx, JS_PROXY_TYPE);
1746 __ j(not_equal, &non_function); 1746 __ j(not_equal, &non_function);
1747 1747
1748 // 1. Call to function proxy. 1748 // 1. Runtime fallback for Proxy [[Call]].
1749 // TODO(neis): Implement [[Call]] on proxies. 1749 __ PopReturnAddressTo(kScratchRegister);
1750 __ Push(rdi);
1751 __ PushReturnAddressFrom(kScratchRegister);
1752 // Increase the arguments size to include the pushed function and the
1753 // existing receiver on the stack.
1754 __ addp(rax, Immediate(2));
1755 // Tail-call to the runtime.
1756 __ JumpToExternalReference(
1757 ExternalReference(Runtime::kJSProxyCall, masm->isolate()), 1);
1750 1758
1751 // 2. Call to something else, which might have a [[Call]] internal method (if 1759 // 2. Call to something else, which might have a [[Call]] internal method (if
1752 // not we raise an exception). 1760 // not we raise an exception).
1753 __ bind(&non_function); 1761 __ bind(&non_function);
1754 // Check if target has a [[Call]] internal method. 1762 // Check if target has a [[Call]] internal method.
1755 __ testb(FieldOperand(rcx, Map::kBitFieldOffset), 1763 __ testb(FieldOperand(rcx, Map::kBitFieldOffset),
1756 Immediate(1 << Map::kIsCallable)); 1764 Immediate(1 << Map::kIsCallable));
1757 __ j(zero, &non_callable, Label::kNear); 1765 __ j(zero, &non_callable, Label::kNear);
1758 // Overwrite the original receiver with the (original) target. 1766 // Overwrite the original receiver with the (original) target.
1759 __ movp(args.GetReceiverOperand(), rdi); 1767 __ movp(args.GetReceiverOperand(), rdi);
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
2034 __ ret(0); 2042 __ ret(0);
2035 } 2043 }
2036 2044
2037 2045
2038 #undef __ 2046 #undef __
2039 2047
2040 } // namespace internal 2048 } // namespace internal
2041 } // namespace v8 2049 } // namespace v8
2042 2050
2043 #endif // V8_TARGET_ARCH_X64 2051 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/runtime/runtime-proxy.cc ('k') | src/x87/builtins-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698