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

Side by Side 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, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 4707 matching lines...) Expand 10 before | Expand all | Expand 10 after
4718 4718
4719 void Map::set_migration_target(bool value) { 4719 void Map::set_migration_target(bool value) {
4720 set_bit_field3(IsMigrationTarget::update(bit_field3(), value)); 4720 set_bit_field3(IsMigrationTarget::update(bit_field3(), value));
4721 } 4721 }
4722 4722
4723 4723
4724 bool Map::is_migration_target() { 4724 bool Map::is_migration_target() {
4725 return IsMigrationTarget::decode(bit_field3()); 4725 return IsMigrationTarget::decode(bit_field3());
4726 } 4726 }
4727 4727
4728 void Map::set_immutable_proto(bool value) {
4729 set_bit_field3(ImmutablePrototype::update(bit_field3(), value));
4730 }
4731
4732 bool Map::is_immutable_proto() {
4733 return ImmutablePrototype::decode(bit_field3());
4734 }
4728 4735
4729 void Map::set_new_target_is_base(bool value) { 4736 void Map::set_new_target_is_base(bool value) {
4730 set_bit_field3(NewTargetIsBase::update(bit_field3(), value)); 4737 set_bit_field3(NewTargetIsBase::update(bit_field3(), value));
4731 } 4738 }
4732 4739
4733 4740
4734 bool Map::new_target_is_base() { return NewTargetIsBase::decode(bit_field3()); } 4741 bool Map::new_target_is_base() { return NewTargetIsBase::decode(bit_field3()); }
4735 4742
4736 4743
4737 void Map::set_construction_counter(int value) { 4744 void Map::set_construction_counter(int value) {
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
5632 ACCESSORS(FunctionTemplateInfo, instance_call_handler, Object, 5639 ACCESSORS(FunctionTemplateInfo, instance_call_handler, Object,
5633 kInstanceCallHandlerOffset) 5640 kInstanceCallHandlerOffset)
5634 ACCESSORS(FunctionTemplateInfo, access_check_info, Object, 5641 ACCESSORS(FunctionTemplateInfo, access_check_info, Object,
5635 kAccessCheckInfoOffset) 5642 kAccessCheckInfoOffset)
5636 ACCESSORS(FunctionTemplateInfo, shared_function_info, Object, 5643 ACCESSORS(FunctionTemplateInfo, shared_function_info, Object,
5637 kSharedFunctionInfoOffset) 5644 kSharedFunctionInfoOffset)
5638 5645
5639 SMI_ACCESSORS(FunctionTemplateInfo, flag, kFlagOffset) 5646 SMI_ACCESSORS(FunctionTemplateInfo, flag, kFlagOffset)
5640 5647
5641 ACCESSORS(ObjectTemplateInfo, constructor, Object, kConstructorOffset) 5648 ACCESSORS(ObjectTemplateInfo, constructor, Object, kConstructorOffset)
5642 ACCESSORS(ObjectTemplateInfo, internal_field_count, Object, 5649 ACCESSORS(ObjectTemplateInfo, data, Object, kDataOffset)
5643 kInternalFieldCountOffset) 5650 int ObjectTemplateInfo::internal_field_count() const {
5651 Object* value = data();
5652 DCHECK(value->IsSmi());
5653 return InternalFieldCount::decode(Smi::cast(value)->value());
5654 }
5655 void ObjectTemplateInfo::set_internal_field_count(int count) {
5656 return set_data(Smi::FromInt(
5657 InternalFieldCount::update(Smi::cast(data())->value(), count)));
5658 }
5659 bool ObjectTemplateInfo::immutable_proto() const {
5660 Object* value = data();
5661 DCHECK(value->IsSmi());
5662 return IsImmutablePrototype::decode(Smi::cast(value)->value());
5663 }
5664 void ObjectTemplateInfo::set_immutable_proto(bool immutable) {
5665 return set_data(Smi::FromInt(
5666 IsImmutablePrototype::update(Smi::cast(data())->value(), immutable)));
5667 }
5644 5668
5645 ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset) 5669 ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset)
5646 ACCESSORS(AllocationSite, nested_site, Object, kNestedSiteOffset) 5670 ACCESSORS(AllocationSite, nested_site, Object, kNestedSiteOffset)
5647 SMI_ACCESSORS(AllocationSite, pretenure_data, kPretenureDataOffset) 5671 SMI_ACCESSORS(AllocationSite, pretenure_data, kPretenureDataOffset)
5648 SMI_ACCESSORS(AllocationSite, pretenure_create_count, 5672 SMI_ACCESSORS(AllocationSite, pretenure_create_count,
5649 kPretenureCreateCountOffset) 5673 kPretenureCreateCountOffset)
5650 ACCESSORS(AllocationSite, dependent_code, DependentCode, 5674 ACCESSORS(AllocationSite, dependent_code, DependentCode,
5651 kDependentCodeOffset) 5675 kDependentCodeOffset)
5652 ACCESSORS(AllocationSite, weak_next, Object, kWeakNextOffset) 5676 ACCESSORS(AllocationSite, weak_next, Object, kWeakNextOffset)
5653 ACCESSORS(AllocationMemento, allocation_site, Object, kAllocationSiteOffset) 5677 ACCESSORS(AllocationMemento, allocation_site, Object, kAllocationSiteOffset)
(...skipping 2408 matching lines...) Expand 10 before | Expand all | Expand 10 after
8062 #undef WRITE_INT64_FIELD 8086 #undef WRITE_INT64_FIELD
8063 #undef READ_BYTE_FIELD 8087 #undef READ_BYTE_FIELD
8064 #undef WRITE_BYTE_FIELD 8088 #undef WRITE_BYTE_FIELD
8065 #undef NOBARRIER_READ_BYTE_FIELD 8089 #undef NOBARRIER_READ_BYTE_FIELD
8066 #undef NOBARRIER_WRITE_BYTE_FIELD 8090 #undef NOBARRIER_WRITE_BYTE_FIELD
8067 8091
8068 } // namespace internal 8092 } // namespace internal
8069 } // namespace v8 8093 } // namespace v8
8070 8094
8071 #endif // V8_OBJECTS_INL_H_ 8095 #endif // V8_OBJECTS_INL_H_
OLDNEW
« 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