Commit d0cfb9d1 authored by Suraj Sharma's avatar Suraj Sharma Committed by Commit Bot

[torque] Derive CallHandlerInfo directly from Struct.

Bug: v8:8952
Change-Id: I37410feab6fb24b306ba8712013267ba1ff5bc5d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1618341Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Suraj Sharma <surshar@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#61931}
parent cb027fdb
...@@ -441,6 +441,13 @@ transient type FastJSArrayForReadWithNoCustomIteration extends ...@@ -441,6 +441,13 @@ transient type FastJSArrayForReadWithNoCustomIteration extends
type NoSharedNameSentinel extends Smi; type NoSharedNameSentinel extends Smi;
@generateCppClass
extern class CallHandlerInfo extends Struct {
callback: Foreign | Undefined;
js_callback: Foreign | Undefined;
data: Object;
}
type JSModuleNamespace extends JSObject; type JSModuleNamespace extends JSObject;
type WeakArrayList extends HeapObject; type WeakArrayList extends HeapObject;
......
...@@ -1750,15 +1750,12 @@ USE_TORQUE_VERIFIER(AccessorPair) ...@@ -1750,15 +1750,12 @@ USE_TORQUE_VERIFIER(AccessorPair)
USE_TORQUE_VERIFIER(AccessCheckInfo) USE_TORQUE_VERIFIER(AccessCheckInfo)
void CallHandlerInfo::CallHandlerInfoVerify(Isolate* isolate) { void CallHandlerInfo::CallHandlerInfoVerify(Isolate* isolate) {
CHECK(IsCallHandlerInfo()); TorqueGeneratedClassVerifiers::CallHandlerInfoVerify(*this, isolate);
CHECK(map() == ReadOnlyRoots(isolate).side_effect_call_handler_info_map() || CHECK(map() == ReadOnlyRoots(isolate).side_effect_call_handler_info_map() ||
map() == map() ==
ReadOnlyRoots(isolate).side_effect_free_call_handler_info_map() || ReadOnlyRoots(isolate).side_effect_free_call_handler_info_map() ||
map() == ReadOnlyRoots(isolate) map() == ReadOnlyRoots(isolate)
.next_call_side_effect_free_call_handler_info_map()); .next_call_side_effect_free_call_handler_info_map());
VerifyPointer(isolate, callback());
VerifyPointer(isolate, js_callback());
VerifyPointer(isolate, data());
} }
void InterceptorInfo::InterceptorInfoVerify(Isolate* isolate) { void InterceptorInfo::InterceptorInfoVerify(Isolate* isolate) {
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "src/objects/js-objects-inl.h" #include "src/objects/js-objects-inl.h"
#include "src/objects/name.h" #include "src/objects/name.h"
#include "src/objects/templates.h" #include "src/objects/templates.h"
#include "torque-generated/class-definitions-tq-inl.h"
// Has to be the last include (doesn't have include guards): // Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h" #include "src/objects/object-macros.h"
...@@ -23,12 +24,12 @@ namespace internal { ...@@ -23,12 +24,12 @@ namespace internal {
OBJECT_CONSTRUCTORS_IMPL(AccessCheckInfo, Struct) OBJECT_CONSTRUCTORS_IMPL(AccessCheckInfo, Struct)
OBJECT_CONSTRUCTORS_IMPL(AccessorInfo, Struct) OBJECT_CONSTRUCTORS_IMPL(AccessorInfo, Struct)
OBJECT_CONSTRUCTORS_IMPL(InterceptorInfo, Struct) OBJECT_CONSTRUCTORS_IMPL(InterceptorInfo, Struct)
OBJECT_CONSTRUCTORS_IMPL(CallHandlerInfo, Tuple3)
TQ_OBJECT_CONSTRUCTORS_IMPL(CallHandlerInfo)
CAST_ACCESSOR(AccessorInfo) CAST_ACCESSOR(AccessorInfo)
CAST_ACCESSOR(AccessCheckInfo) CAST_ACCESSOR(AccessCheckInfo)
CAST_ACCESSOR(InterceptorInfo) CAST_ACCESSOR(InterceptorInfo)
CAST_ACCESSOR(CallHandlerInfo)
ACCESSORS(AccessorInfo, name, Name, kNameOffset) ACCESSORS(AccessorInfo, name, Name, kNameOffset)
SMI_ACCESSORS(AccessorInfo, flags, kFlagsOffset) SMI_ACCESSORS(AccessorInfo, flags, kFlagsOffset)
...@@ -119,9 +120,6 @@ BOOL_ACCESSORS(InterceptorInfo, flags, non_masking, kNonMasking) ...@@ -119,9 +120,6 @@ BOOL_ACCESSORS(InterceptorInfo, flags, non_masking, kNonMasking)
BOOL_ACCESSORS(InterceptorInfo, flags, is_named, kNamed) BOOL_ACCESSORS(InterceptorInfo, flags, is_named, kNamed)
BOOL_ACCESSORS(InterceptorInfo, flags, has_no_side_effect, kHasNoSideEffect) BOOL_ACCESSORS(InterceptorInfo, flags, has_no_side_effect, kHasNoSideEffect)
ACCESSORS(CallHandlerInfo, callback, Object, kCallbackOffset)
ACCESSORS(CallHandlerInfo, js_callback, Object, kJsCallbackOffset)
ACCESSORS(CallHandlerInfo, data, Object, kDataOffset)
bool CallHandlerInfo::IsSideEffectFreeCallHandlerInfo() const { bool CallHandlerInfo::IsSideEffectFreeCallHandlerInfo() const {
ReadOnlyRoots roots = GetReadOnlyRoots(); ReadOnlyRoots roots = GetReadOnlyRoots();
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define V8_OBJECTS_API_CALLBACKS_H_ #define V8_OBJECTS_API_CALLBACKS_H_
#include "src/objects/struct.h" #include "src/objects/struct.h"
#include "torque-generated/class-definitions-tq.h"
// Has to be the last include (doesn't have include guards): // Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h" #include "src/objects/object-macros.h"
...@@ -159,14 +160,9 @@ class InterceptorInfo : public Struct { ...@@ -159,14 +160,9 @@ class InterceptorInfo : public Struct {
OBJECT_CONSTRUCTORS(InterceptorInfo, Struct); OBJECT_CONSTRUCTORS(InterceptorInfo, Struct);
}; };
class CallHandlerInfo : public Tuple3 { class CallHandlerInfo
: public TorqueGeneratedCallHandlerInfo<CallHandlerInfo, Struct> {
public: public:
DECL_ACCESSORS(callback, Object)
DECL_ACCESSORS(js_callback, Object)
DECL_ACCESSORS(data, Object)
DECL_CAST(CallHandlerInfo)
inline bool IsSideEffectFreeCallHandlerInfo() const; inline bool IsSideEffectFreeCallHandlerInfo() const;
inline bool IsSideEffectCallHandlerInfo() const; inline bool IsSideEffectCallHandlerInfo() const;
inline void SetNextCallHasNoSideEffect(); inline void SetNextCallHasNoSideEffect();
...@@ -180,11 +176,7 @@ class CallHandlerInfo : public Tuple3 { ...@@ -180,11 +176,7 @@ class CallHandlerInfo : public Tuple3 {
Address redirected_callback() const; Address redirected_callback() const;
static const int kCallbackOffset = kValue1Offset; TQ_OBJECT_CONSTRUCTORS(CallHandlerInfo)
static const int kJsCallbackOffset = kValue2Offset;
static const int kDataOffset = kValue3Offset;
OBJECT_CONSTRUCTORS(CallHandlerInfo, Tuple3);
}; };
} // namespace internal } // namespace internal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment