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

Unified Diff: src/objects-inl.h

Issue 1033653002: Move prototype metadata from internal properties to prototype maps (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 11294011a0557ee339603308c9adb65891e41b44..54b26af3e30358fba88487806eec2ef0b709c940 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -4559,9 +4559,7 @@ void Map::set_unused_property_fields(int value) {
}
-byte Map::bit_field() {
- return READ_BYTE_FIELD(this, kBitFieldOffset);
-}
+byte Map::bit_field() const { return READ_BYTE_FIELD(this, kBitFieldOffset); }
void Map::set_bit_field(byte value) {
@@ -4569,9 +4567,7 @@ void Map::set_bit_field(byte value) {
}
-byte Map::bit_field2() {
- return READ_BYTE_FIELD(this, kBitField2Offset);
-}
+byte Map::bit_field2() const { return READ_BYTE_FIELD(this, kBitField2Offset); }
void Map::set_bit_field2(byte value) {
@@ -4634,7 +4630,7 @@ void Map::set_is_prototype_map(bool value) {
set_bit_field2(IsPrototypeMapBits::update(bit_field2(), value));
}
-bool Map::is_prototype_map() {
+bool Map::is_prototype_map() const {
return IsPrototypeMapBits::decode(bit_field2());
}
@@ -5328,7 +5324,7 @@ void Map::set_bit_field3(uint32_t bits) {
}
-uint32_t Map::bit_field3() {
+uint32_t Map::bit_field3() const {
return READ_UINT32_FIELD(this, kBitField3Offset);
}
@@ -5370,7 +5366,19 @@ Map* Map::ElementsTransitionMap() {
}
-ACCESSORS(Map, raw_transitions, Object, kTransitionsOffset)
+ACCESSORS(Map, raw_transitions, Object, kTransitionsOrPrototypeInfoOffset)
+
+
+Object* Map::prototype_info() const {
+ DCHECK(is_prototype_map());
+ return READ_FIELD(this, Map::kTransitionsOrPrototypeInfoOffset);
+}
+void Map::set_prototype_info(Object* value, WriteBarrierMode mode) {
+ DCHECK(is_prototype_map());
+ WRITE_FIELD(this, Map::kTransitionsOrPrototypeInfoOffset, value);
+ CONDITIONAL_WRITE_BARRIER(
+ GetHeap(), this, Map::kTransitionsOrPrototypeInfoOffset, value, mode);
+}
void Map::SetBackPointer(Object* value, WriteBarrierMode mode) {
@@ -5430,6 +5438,10 @@ ACCESSORS(ExecutableAccessorInfo, data, Object, kDataOffset)
ACCESSORS(Box, value, Object, kValueOffset)
+ACCESSORS(PrototypeInfo, prototype_object, JSObject, kPrototypeObjectOffset)
+ACCESSORS(PrototypeInfo, prototype_users, Object, kPrototypeUsersOffset)
+ACCESSORS(PrototypeInfo, validity_cell, Object, kValidityCellOffset)
+
ACCESSORS(AccessorPair, getter, Object, kGetterOffset)
ACCESSORS(AccessorPair, setter, Object, kSetterOffset)
« src/objects.cc ('K') | « src/objects-debug.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698