Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: src/objects.h

Issue 1600353003: [runtime] remove left-over distinction between AccessorInfo and ExecutableAccessorInfo (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/log.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index e6417c92edde4d3eb63123469c65dcabc9317cf4..c81f9dbe29c3d59fa232fc87d7a550d3fe427ee4 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -134,7 +134,6 @@
// - Struct
// - Box
// - AccessorInfo
-// - ExecutableAccessorInfo
// - AccessorPair
// - AccessCheckInfo
// - InterceptorInfo
@@ -384,9 +383,7 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
\
V(FILLER_TYPE) \
\
- V(DECLARED_ACCESSOR_DESCRIPTOR_TYPE) \
- V(DECLARED_ACCESSOR_INFO_TYPE) \
- V(EXECUTABLE_ACCESSOR_INFO_TYPE) \
+ V(ACCESSOR_INFO_TYPE) \
V(ACCESSOR_PAIR_TYPE) \
V(ACCESS_CHECK_INFO_TYPE) \
V(INTERCEPTOR_INFO_TYPE) \
@@ -505,8 +502,7 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
// manually.
#define STRUCT_LIST(V) \
V(BOX, Box, box) \
- V(EXECUTABLE_ACCESSOR_INFO, ExecutableAccessorInfo, \
- executable_accessor_info) \
+ V(ACCESSOR_INFO, AccessorInfo, accessor_info) \
V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \
V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \
V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \
@@ -676,9 +672,7 @@ enum InstanceType {
FILLER_TYPE, // LAST_DATA_TYPE
// Structs.
- DECLARED_ACCESSOR_DESCRIPTOR_TYPE,
- DECLARED_ACCESSOR_INFO_TYPE,
- EXECUTABLE_ACCESSOR_INFO_TYPE,
+ ACCESSOR_INFO_TYPE,
ACCESSOR_PAIR_TYPE,
ACCESS_CHECK_INFO_TYPE,
INTERCEPTOR_INFO_TYPE,
@@ -1043,7 +1037,6 @@ class Object {
INLINE(bool IsFixedArrayBase() const);
INLINE(bool IsExternal() const);
- INLINE(bool IsAccessorInfo() const);
INLINE(bool IsStruct() const);
#define DECLARE_STRUCT_PREDICATE(NAME, Name, name) \
@@ -2072,27 +2065,27 @@ class JSObject: public JSReceiver {
LookupIterator* it, Handle<Object> value);
// SetLocalPropertyIgnoreAttributes converts callbacks to fields. We need to
- // grant an exemption to ExecutableAccessor callbacks in some cases.
- enum ExecutableAccessorInfoHandling { DEFAULT_HANDLING, DONT_FORCE_FIELD };
+ // grant an exemption to AccessorInfo callbacks in some cases.
+ enum AccessorInfoHandling { DEFAULT_HANDLING, DONT_FORCE_FIELD };
MUST_USE_RESULT static MaybeHandle<Object> DefineOwnPropertyIgnoreAttributes(
LookupIterator* it, Handle<Object> value, PropertyAttributes attributes,
- ExecutableAccessorInfoHandling handling = DEFAULT_HANDLING);
+ AccessorInfoHandling handling = DEFAULT_HANDLING);
MUST_USE_RESULT static Maybe<bool> DefineOwnPropertyIgnoreAttributes(
LookupIterator* it, Handle<Object> value, PropertyAttributes attributes,
ShouldThrow should_throw,
- ExecutableAccessorInfoHandling handling = DEFAULT_HANDLING);
+ AccessorInfoHandling handling = DEFAULT_HANDLING);
MUST_USE_RESULT static MaybeHandle<Object> SetOwnPropertyIgnoreAttributes(
Handle<JSObject> object, Handle<Name> name, Handle<Object> value,
PropertyAttributes attributes,
- ExecutableAccessorInfoHandling handling = DEFAULT_HANDLING);
+ AccessorInfoHandling handling = DEFAULT_HANDLING);
MUST_USE_RESULT static MaybeHandle<Object> SetOwnElementIgnoreAttributes(
Handle<JSObject> object, uint32_t index, Handle<Object> value,
PropertyAttributes attributes,
- ExecutableAccessorInfoHandling handling = DEFAULT_HANDLING);
+ AccessorInfoHandling handling = DEFAULT_HANDLING);
// Equivalent to one of the above depending on whether |name| can be converted
// to an array index.
@@ -2100,7 +2093,7 @@ class JSObject: public JSReceiver {
DefinePropertyOrElementIgnoreAttributes(
Handle<JSObject> object, Handle<Name> name, Handle<Object> value,
PropertyAttributes attributes = NONE,
- ExecutableAccessorInfoHandling handling = DEFAULT_HANDLING);
+ AccessorInfoHandling handling = DEFAULT_HANDLING);
// Adds or reconfigures a property to attributes NONE. It will fail when it
// cannot.
@@ -10182,11 +10175,28 @@ class JSRegExpResult: public JSArray {
};
+// An accessor must have a getter, but can have no setter.
+//
+// When setting a property, V8 searches accessors in prototypes.
+// If an accessor was found and it does not have a setter,
+// the request is ignored.
+//
+// If the accessor in the prototype has the READ_ONLY property attribute, then
+// a new value is added to the derived object when the property is set.
+// This shadows the accessor in the prototype.
class AccessorInfo: public Struct {
public:
DECL_ACCESSORS(name, Object)
DECL_INT_ACCESSORS(flag)
DECL_ACCESSORS(expected_receiver_type, Object)
+ DECL_ACCESSORS(getter, Object)
+ DECL_ACCESSORS(setter, Object)
+ DECL_ACCESSORS(data, Object)
+
+ // Dispatched behavior.
+ DECLARE_PRINTER(AccessorInfo)
+
+ static void ClearSetter(Handle<AccessorInfo> info);
inline bool all_can_read();
inline void set_all_can_read(bool value);
@@ -10220,7 +10230,11 @@ class AccessorInfo: public Struct {
static const int kNameOffset = HeapObject::kHeaderSize;
static const int kFlagOffset = kNameOffset + kPointerSize;
static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize;
- static const int kSize = kExpectedReceiverTypeOffset + kPointerSize;
+ static const int kGetterOffset = kExpectedReceiverTypeOffset + kPointerSize;
+ static const int kSetterOffset = kGetterOffset + kPointerSize;
+ static const int kDataOffset = kSetterOffset + kPointerSize;
+ static const int kSize = kDataOffset + kPointerSize;
+
private:
inline bool HasExpectedReceiverType();
@@ -10235,39 +10249,6 @@ class AccessorInfo: public Struct {
};
-// An accessor must have a getter, but can have no setter.
-//
-// When setting a property, V8 searches accessors in prototypes.
-// If an accessor was found and it does not have a setter,
-// the request is ignored.
-//
-// If the accessor in the prototype has the READ_ONLY property attribute, then
-// a new value is added to the derived object when the property is set.
-// This shadows the accessor in the prototype.
-class ExecutableAccessorInfo: public AccessorInfo {
- public:
- DECL_ACCESSORS(getter, Object)
- DECL_ACCESSORS(setter, Object)
- DECL_ACCESSORS(data, Object)
-
- DECLARE_CAST(ExecutableAccessorInfo)
-
- // Dispatched behavior.
- DECLARE_PRINTER(ExecutableAccessorInfo)
- DECLARE_VERIFIER(ExecutableAccessorInfo)
-
- static const int kGetterOffset = AccessorInfo::kSize;
- static const int kSetterOffset = kGetterOffset + kPointerSize;
- static const int kDataOffset = kSetterOffset + kPointerSize;
- static const int kSize = kDataOffset + kPointerSize;
-
- static void ClearSetter(Handle<ExecutableAccessorInfo> info);
-
- private:
- DISALLOW_IMPLICIT_CONSTRUCTORS(ExecutableAccessorInfo);
-};
-
-
// Support for JavaScript accessors: A pair of a getter and a setter. Each
// accessor can either be
// * a pointer to a JavaScript function or proxy: a real accessor
« no previous file with comments | « src/log.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698