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

Unified Diff: src/objects-inl.h

Issue 2108203002: Implement immutable prototype chains (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: reverse bitfield arguments Created 4 years, 6 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 49159130df45f3e4f10e3ee8f4dbc6e17dbf368b..b17ceec112e2bb1c07f54587b1da6c3a3483f900 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -4725,6 +4725,13 @@ bool Map::is_migration_target() {
return IsMigrationTarget::decode(bit_field3());
}
+void Map::set_immutable_proto(bool value) {
+ set_bit_field3(ImmutablePrototype::update(bit_field3(), value));
+}
+
+bool Map::is_immutable_proto() {
+ return ImmutablePrototype::decode(bit_field3());
+}
void Map::set_new_target_is_base(bool value) {
set_bit_field3(NewTargetIsBase::update(bit_field3(), value));
@@ -5639,8 +5646,25 @@ ACCESSORS(FunctionTemplateInfo, shared_function_info, Object,
SMI_ACCESSORS(FunctionTemplateInfo, flag, kFlagOffset)
ACCESSORS(ObjectTemplateInfo, constructor, Object, kConstructorOffset)
-ACCESSORS(ObjectTemplateInfo, internal_field_count, Object,
- kInternalFieldCountOffset)
+ACCESSORS(ObjectTemplateInfo, data, Object, kDataOffset)
+int ObjectTemplateInfo::internal_field_count() const {
+ Object* value = data();
+ DCHECK(value->IsSmi());
+ return InternalFieldCount::decode(Smi::cast(value)->value());
+}
+void ObjectTemplateInfo::set_internal_field_count(int count) {
+ return set_data(Smi::FromInt(
+ InternalFieldCount::update(Smi::cast(data())->value(), count)));
+}
+bool ObjectTemplateInfo::immutable_proto() const {
+ Object* value = data();
+ DCHECK(value->IsSmi());
+ return IsImmutablePrototype::decode(Smi::cast(value)->value());
+}
+void ObjectTemplateInfo::set_immutable_proto(bool immutable) {
+ return set_data(Smi::FromInt(
+ IsImmutablePrototype::update(Smi::cast(data())->value(), immutable)));
+}
ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset)
ACCESSORS(AllocationSite, nested_site, Object, kNestedSiteOffset)
« include/v8.h ('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