5 #ifndef V8_OBJECTS_API_CALLBACKS_H_ 6 #define V8_OBJECTS_API_CALLBACKS_H_ 8 #include "src/objects.h" 11 #include "src/objects/object-macros.h" 27 DECL_ACCESSORS2(name,
Name)
28 DECL_INT_ACCESSORS(flags)
29 DECL_ACCESSORS(expected_receiver_type,
Object)
31 DECL_ACCESSORS(getter,
Object)
32 inline bool has_getter();
33 DECL_ACCESSORS(setter,
Object)
34 inline bool has_setter();
37 DECL_ACCESSORS(js_getter,
Object)
38 DECL_ACCESSORS(data,
Object)
40 static Address redirect(
Address address, AccessorComponent component);
41 Address redirected_getter()
const;
46 DECL_BOOLEAN_ACCESSORS(all_can_read)
47 DECL_BOOLEAN_ACCESSORS(all_can_write)
48 DECL_BOOLEAN_ACCESSORS(is_special_data_property)
49 DECL_BOOLEAN_ACCESSORS(replace_on_access)
50 DECL_BOOLEAN_ACCESSORS(is_sloppy)
61 inline PropertyAttributes initial_property_attributes()
const;
62 inline void set_initial_property_attributes(PropertyAttributes attributes);
67 inline bool IsCompatibleReceiver(
Object* receiver);
80 #define ACCESSOR_INFO_FIELDS(V) \ 81 V(kNameOffset, kTaggedSize) \ 82 V(kFlagsOffset, kTaggedSize) \ 83 V(kExpectedReceiverTypeOffset, kTaggedSize) \ 84 V(kSetterOffset, kTaggedSize) \ 85 V(kGetterOffset, kTaggedSize) \ 86 V(kJsGetterOffset, kTaggedSize) \ 87 V(kDataOffset, kTaggedSize) \ 90 DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, ACCESSOR_INFO_FIELDS)
91 #undef ACCESSOR_INFO_FIELDS 94 inline bool HasExpectedReceiverType();
97 #define ACCESSOR_INFO_FLAGS_BIT_FIELDS(V, _) \ 98 V(AllCanReadBit, bool, 1, _) \ 99 V(AllCanWriteBit, bool, 1, _) \ 100 V(IsSpecialDataPropertyBit, bool, 1, _) \ 101 V(IsSloppyBit, bool, 1, _) \ 102 V(ReplaceOnAccessBit, bool, 1, _) \ 103 V(GetterSideEffectTypeBits, SideEffectType, 2, _) \ 105 V(SetterSideEffectTypeBits, SideEffectType, 2, _) \ 106 V(InitialAttributesBits, PropertyAttributes, 3, _) 108 DEFINE_BIT_FIELDS(ACCESSOR_INFO_FLAGS_BIT_FIELDS)
109 #undef ACCESSOR_INFO_FLAGS_BIT_FIELDS 116 DECL_ACCESSORS(callback,
Object)
117 DECL_ACCESSORS(named_interceptor,
Object)
118 DECL_ACCESSORS(indexed_interceptor,
Object)
119 DECL_ACCESSORS(data,
Object)
130 #define ACCESS_CHECK_INFO_FIELDS(V) \ 131 V(kCallbackOffset, kTaggedSize) \ 132 V(kNamedInterceptorOffset, kTaggedSize) \ 133 V(kIndexedInterceptorOffset, kTaggedSize) \ 134 V(kDataOffset, kTaggedSize) \ 137 DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
138 ACCESS_CHECK_INFO_FIELDS)
139 #undef ACCESS_CHECK_INFO_FIELDS 147 DECL_ACCESSORS(getter,
Object)
148 DECL_ACCESSORS(setter,
Object)
149 DECL_ACCESSORS(query,
Object)
150 DECL_ACCESSORS(descriptor,
Object)
151 DECL_ACCESSORS(deleter,
Object)
152 DECL_ACCESSORS(enumerator,
Object)
153 DECL_ACCESSORS(definer,
Object)
154 DECL_ACCESSORS(data,
Object)
155 DECL_BOOLEAN_ACCESSORS(can_intercept_symbols)
156 DECL_BOOLEAN_ACCESSORS(all_can_read)
157 DECL_BOOLEAN_ACCESSORS(non_masking)
158 DECL_BOOLEAN_ACCESSORS(is_named)
159 DECL_BOOLEAN_ACCESSORS(has_no_side_effect)
161 inline int flags()
const;
162 inline void set_flags(
int flags);
171 #define INTERCEPTOR_INFO_FIELDS(V) \ 172 V(kGetterOffset, kTaggedSize) \ 173 V(kSetterOffset, kTaggedSize) \ 174 V(kQueryOffset, kTaggedSize) \ 175 V(kDescriptorOffset, kTaggedSize) \ 176 V(kDeleterOffset, kTaggedSize) \ 177 V(kEnumeratorOffset, kTaggedSize) \ 178 V(kDefinerOffset, kTaggedSize) \ 179 V(kDataOffset, kTaggedSize) \ 180 V(kFlagsOffset, kTaggedSize) \ 183 DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
184 INTERCEPTOR_INFO_FIELDS)
185 #undef INTERCEPTOR_INFO_FIELDS 187 static const int kCanInterceptSymbolsBit = 0;
188 static const int kAllCanReadBit = 1;
189 static const int kNonMasking = 2;
190 static const int kNamed = 3;
191 static const int kHasNoSideEffect = 4;
199 DECL_ACCESSORS(callback,
Object)
200 DECL_ACCESSORS(js_callback,
Object)
201 DECL_ACCESSORS(data,
Object)
205 inline bool IsSideEffectFreeCallHandlerInfo()
const;
206 inline bool IsSideEffectCallHandlerInfo()
const;
207 inline void SetNextCallHasNoSideEffect();
210 inline bool NextCallHasNoSideEffect();
216 Address redirected_callback()
const;
218 static const int kCallbackOffset = kValue1Offset;
219 static const int kJsCallbackOffset = kValue2Offset;
220 static const int kDataOffset = kValue3Offset;
229 #include "src/objects/object-macros-undef.h" 231 #endif // V8_OBJECTS_API_CALLBACKS_H_