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

Unified Diff: src/objects-inl.h

Issue 1575423002: Move properties from JSObject to JSReceiver (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
« src/factory.cc ('K') | « src/objects.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 6ea9307ceb7d4ac0a8ab3edab3875ab5ce47fca3..54d33f62b12c06fcfa47359fe875d19a6a3f41c7 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1599,7 +1599,7 @@ SIMD128_BOOLEAN_LANE_FNS(Bool8x16, int8_t, 16, INT8, kCharSize)
#undef SIMD128_WRITE_LANE
-ACCESSORS(JSObject, properties, FixedArray, kPropertiesOffset)
+ACCESSORS(JSReceiver, properties, FixedArray, kPropertiesOffset)
Object** FixedArray::GetFirstElementAddress() {
@@ -1969,12 +1969,6 @@ void JSObject::set_elements(FixedArrayBase* value, WriteBarrierMode mode) {
}
-void JSObject::initialize_properties() {
- DCHECK(!GetHeap()->InNewSpace(GetHeap()->empty_fixed_array()));
- WRITE_FIELD(this, kPropertiesOffset, GetHeap()->empty_fixed_array());
-}
-
-
void JSObject::initialize_elements() {
FixedArrayBase* elements = map()->GetInitialElements();
WRITE_FIELD(this, kElementsOffset, elements);
@@ -2315,12 +2309,6 @@ void JSObject::InitializeBody(Map* map, int start_offset,
}
-bool JSObject::HasFastProperties() {
- DCHECK(properties()->IsDictionary() == map()->is_dictionary_map());
- return !properties()->IsDictionary();
-}
-
-
bool Map::TooManyFastProperties(StoreFromKeyed store_mode) {
if (unused_property_fields() != 0) return false;
if (is_prototype_map()) return false;
@@ -6764,13 +6752,6 @@ bool JSObject::HasIndexedInterceptor() {
}
-NameDictionary* JSObject::property_dictionary() {
- DCHECK(!HasFastProperties());
- DCHECK(!IsJSGlobalObject());
- return NameDictionary::cast(properties());
-}
-
-
GlobalDictionary* JSObject::global_dictionary() {
DCHECK(!HasFastProperties());
DCHECK(IsJSGlobalObject());
@@ -7084,6 +7065,25 @@ MaybeHandle<Object> Object::GetPropertyOrElement(Handle<JSReceiver> holder,
}
+void JSReceiver::initialize_properties() {
+ DCHECK(!GetHeap()->InNewSpace(GetHeap()->empty_fixed_array()));
+ WRITE_FIELD(this, kPropertiesOffset, GetHeap()->empty_fixed_array());
+}
+
+
+bool JSReceiver::HasFastProperties() {
+ DCHECK(properties()->IsDictionary() == map()->is_dictionary_map());
+ return !properties()->IsDictionary();
+}
+
+
+NameDictionary* JSReceiver::property_dictionary() {
+ DCHECK(!HasFastProperties());
+ DCHECK(!IsJSGlobalObject());
+ return NameDictionary::cast(properties());
+}
+
+
Maybe<bool> JSReceiver::HasProperty(Handle<JSReceiver> object,
Handle<Name> name) {
LookupIterator it =
« src/factory.cc ('K') | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698