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

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: IsImmutableProto 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
« no previous file with comments | « src/objects-debug.cc ('k') | src/objects-printer.cc » ('j') | 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 e1df2b662ddc83e9d4c1a661dec9cbab8f9bf626..a466f5d6e3f6a9f0b3fe8ad97f5e1fedcaeefe67 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -4680,6 +4680,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));
@@ -5586,8 +5593,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)
« no previous file with comments | « src/objects-debug.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698