Line data Source code
1 : // Copyright 2017 the V8 project authors. All rights reserved.
2 : // Use of this source code is governed by a BSD-style license that can be
3 : // found in the LICENSE file.
4 :
5 : #ifndef V8_BUILTINS_BUILTINS_PROXY_GEN_H_
6 : #define V8_BUILTINS_BUILTINS_PROXY_GEN_H_
7 :
8 : #include "src/code-stub-assembler.h"
9 : #include "src/objects/js-proxy.h"
10 :
11 : namespace v8 {
12 : namespace internal {
13 : using compiler::Node;
14 :
15 448 : class ProxiesCodeStubAssembler : public CodeStubAssembler {
16 : public:
17 : explicit ProxiesCodeStubAssembler(compiler::CodeAssemblerState* state)
18 448 : : CodeStubAssembler(state) {}
19 :
20 : // ES6 section 9.5.8 [[Get]] ( P, Receiver )
21 : // name should not be an index.
22 : Node* ProxyGetProperty(Node* context, Node* proxy, Node* name,
23 : Node* receiver);
24 :
25 : // ES6 section 9.5.9 [[Set]] ( P, V, Receiver )
26 : // name should not be an index.
27 : Node* ProxySetProperty(Node* context, Node* proxy, Node* name, Node* value,
28 : Node* receiver);
29 :
30 : Node* AllocateProxy(Node* target, Node* handler, Node* context);
31 : Node* AllocateProxyRevokeFunction(Node* proxy, Node* context);
32 :
33 : protected:
34 : enum ProxyRevokeFunctionContextSlot {
35 : kProxySlot = Context::MIN_CONTEXT_SLOTS,
36 : kProxyContextLength,
37 : };
38 :
39 : void GotoIfRevokedProxy(Node* object, Label* if_proxy_revoked);
40 : Node* AllocateJSArrayForCodeStubArguments(Node* context,
41 : CodeStubArguments& args, Node* argc,
42 : ParameterMode mode);
43 : void CheckHasTrapResult(Node* context, Node* target, Node* proxy, Node* name,
44 : Label* check_passed, Label* if_bailout);
45 :
46 : void CheckGetSetTrapResult(Node* context, Node* target, Node* proxy,
47 : Node* name, Node* trap_result, Label* if_not_found,
48 : JSProxy::AccessKind access_kind);
49 :
50 : private:
51 : Node* CreateProxyRevokeFunctionContext(Node* proxy, Node* native_context);
52 : };
53 :
54 : } // namespace internal
55 : } // namespace v8
56 :
57 : #endif // V8_BUILTINS_BUILTINS_PROXY_GEN_H_
|