2019-04-16 16:19:22 +00:00
|
|
|
// 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;
|
|
|
|
}
|
2019-04-24 17:29:13 +00:00
|
|
|
|
2019-05-14 11:46:12 +00:00
|
|
|
extern transitioning macro ProxiesCodeStubAssembler::CheckGetSetTrapResult(
|
|
|
|
implicit context:
|
|
|
|
Context)(Object, JSProxy, Name, Object, constexpr int31): Object;
|
|
|
|
|
2019-04-24 17:29:13 +00:00
|
|
|
const kProxyNonObject: constexpr MessageTemplate
|
|
|
|
generates 'MessageTemplate::kProxyNonObject';
|
|
|
|
const kProxyHandlerOrTargetRevoked: constexpr MessageTemplate
|
|
|
|
generates 'MessageTemplate::kProxyHandlerOrTargetRevoked';
|
|
|
|
const kProxyRevoked: constexpr MessageTemplate
|
|
|
|
generates 'MessageTemplate::kProxyRevoked';
|
2019-05-14 11:46:12 +00:00
|
|
|
const kProxyTrapReturnedFalsishFor: constexpr MessageTemplate
|
|
|
|
generates 'MessageTemplate::kProxyTrapReturnedFalsishFor';
|
|
|
|
const kProxyPrivate: constexpr MessageTemplate
|
|
|
|
generates 'MessageTemplate::kProxyPrivate';
|
2019-04-24 17:29:13 +00:00
|
|
|
|
|
|
|
const kProxyGet: constexpr int31
|
|
|
|
generates 'JSProxy::AccessKind::kGet';
|
|
|
|
const kProxySet: constexpr int31
|
|
|
|
generates 'JSProxy::AccessKind::kSet';
|
2019-04-16 16:19:22 +00:00
|
|
|
}
|