Chromium Code Reviews| Index: src/objects-inl.h |
| diff --git a/src/objects-inl.h b/src/objects-inl.h |
| index 04fb78e6dd2e8795821cb3bedeb9cad5577ee619..27a63c3ce0b199baceb11386a7d14f03895e22d0 100644 |
| --- a/src/objects-inl.h |
| +++ b/src/objects-inl.h |
| @@ -4715,6 +4715,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)); |
| @@ -5621,8 +5628,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 Smi::cast(value)->value() >> 1; |
|
Toon Verwaest
2016/06/30 15:35:33
You probably want to use BitField to designate the
Dan Ehrenberg
2016/06/30 23:12:41
Done
|
| +} |
| +void ObjectTemplateInfo::set_internal_field_count(int count) { |
| + DCHECK(count << 1 < Smi::kMaxValue); |
| + return set_data(Smi::FromInt((immutable_proto() ? 1 : 0) | (count << 1))); |
| +} |
| +bool ObjectTemplateInfo::immutable_proto() const { |
| + Object* value = data(); |
| + DCHECK(value->IsSmi()); |
| + return Smi::cast(value)->value() & 1; |
| +} |
| +void ObjectTemplateInfo::set_immutable_proto(bool immutable) { |
| + return set_data( |
| + Smi::FromInt((immutable ? 1 : 0) | (internal_field_count() << 1))); |
| +} |
| ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset) |
| ACCESSORS(AllocationSite, nested_site, Object, kNestedSiteOffset) |