summaryrefslogtreecommitdiff
path: root/deps/v8/src/builtins/proxy.tq
blob: 95e05be14fa1d33190bf21fbbf3c1d9c53880452 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include 'src/builtins/builtins-proxy-gen.h'

namespace proxy {

  extern macro ProxiesCodeStubAssembler::AllocateProxy(
      JSReceiver, JSReceiver, Context): JSProxy;
  macro AllocateProxy(implicit context: Context)(
      target: JSReceiver, handler: JSReceiver): JSProxy {
    return AllocateProxy(target, handler, context);
  }

  macro IsRevokedProxy(implicit context: Context)(o: JSReceiver): bool {
    const proxy: JSProxy = Cast<JSProxy>(o) otherwise return false;
    const handler: JSReceiver =
        Cast<JSReceiver>(proxy.handler) otherwise return true;
    return false;
  }
}