OLD | NEW |
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 4736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4747 | 4747 |
4748 | 4748 |
4749 void Map::set_new_target_is_base(bool value) { | 4749 void Map::set_new_target_is_base(bool value) { |
4750 set_bit_field3(NewTargetIsBase::update(bit_field3(), value)); | 4750 set_bit_field3(NewTargetIsBase::update(bit_field3(), value)); |
4751 } | 4751 } |
4752 | 4752 |
4753 | 4753 |
4754 bool Map::new_target_is_base() { return NewTargetIsBase::decode(bit_field3()); } | 4754 bool Map::new_target_is_base() { return NewTargetIsBase::decode(bit_field3()); } |
4755 | 4755 |
4756 | 4756 |
4757 void Map::set_counter(int value) { | 4757 void Map::set_construction_counter(int value) { |
4758 set_bit_field3(Counter::update(bit_field3(), value)); | 4758 set_bit_field3(ConstructionCounter::update(bit_field3(), value)); |
4759 } | 4759 } |
4760 | 4760 |
4761 | 4761 |
4762 int Map::counter() { return Counter::decode(bit_field3()); } | 4762 int Map::construction_counter() { |
| 4763 return ConstructionCounter::decode(bit_field3()); |
| 4764 } |
4763 | 4765 |
4764 | 4766 |
4765 void Map::mark_unstable() { | 4767 void Map::mark_unstable() { |
4766 set_bit_field3(IsUnstable::update(bit_field3(), true)); | 4768 set_bit_field3(IsUnstable::update(bit_field3(), true)); |
4767 } | 4769 } |
4768 | 4770 |
4769 | 4771 |
4770 bool Map::is_stable() { | 4772 bool Map::is_stable() { |
4771 return !IsUnstable::decode(bit_field3()); | 4773 return !IsUnstable::decode(bit_field3()); |
4772 } | 4774 } |
(...skipping 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6155 | 6157 |
6156 | 6158 |
6157 void JSFunction::CompleteInobjectSlackTrackingIfActive() { | 6159 void JSFunction::CompleteInobjectSlackTrackingIfActive() { |
6158 if (has_initial_map() && initial_map()->IsInobjectSlackTrackingInProgress()) { | 6160 if (has_initial_map() && initial_map()->IsInobjectSlackTrackingInProgress()) { |
6159 initial_map()->CompleteInobjectSlackTracking(); | 6161 initial_map()->CompleteInobjectSlackTracking(); |
6160 } | 6162 } |
6161 } | 6163 } |
6162 | 6164 |
6163 | 6165 |
6164 bool Map::IsInobjectSlackTrackingInProgress() { | 6166 bool Map::IsInobjectSlackTrackingInProgress() { |
6165 return counter() >= Map::kSlackTrackingCounterEnd; | 6167 return construction_counter() != Map::kNoSlackTracking; |
6166 } | 6168 } |
6167 | 6169 |
6168 | 6170 |
6169 void Map::InobjectSlackTrackingStep() { | 6171 void Map::InobjectSlackTrackingStep() { |
6170 if (!IsInobjectSlackTrackingInProgress()) return; | 6172 if (!IsInobjectSlackTrackingInProgress()) return; |
6171 int counter = this->counter(); | 6173 int counter = construction_counter(); |
6172 set_counter(counter - 1); | 6174 set_construction_counter(counter - 1); |
6173 if (counter == kSlackTrackingCounterEnd) { | 6175 if (counter == kSlackTrackingCounterEnd) { |
6174 CompleteInobjectSlackTracking(); | 6176 CompleteInobjectSlackTracking(); |
6175 } | 6177 } |
6176 } | 6178 } |
6177 | 6179 |
6178 | 6180 |
6179 Code* JSFunction::code() { | 6181 Code* JSFunction::code() { |
6180 return Code::cast( | 6182 return Code::cast( |
6181 Code::GetObjectFromEntryAddress(FIELD_ADDR(this, kCodeEntryOffset))); | 6183 Code::GetObjectFromEntryAddress(FIELD_ADDR(this, kCodeEntryOffset))); |
6182 } | 6184 } |
(...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7863 #undef WRITE_INT64_FIELD | 7865 #undef WRITE_INT64_FIELD |
7864 #undef READ_BYTE_FIELD | 7866 #undef READ_BYTE_FIELD |
7865 #undef WRITE_BYTE_FIELD | 7867 #undef WRITE_BYTE_FIELD |
7866 #undef NOBARRIER_READ_BYTE_FIELD | 7868 #undef NOBARRIER_READ_BYTE_FIELD |
7867 #undef NOBARRIER_WRITE_BYTE_FIELD | 7869 #undef NOBARRIER_WRITE_BYTE_FIELD |
7868 | 7870 |
7869 } // namespace internal | 7871 } // namespace internal |
7870 } // namespace v8 | 7872 } // namespace v8 |
7871 | 7873 |
7872 #endif // V8_OBJECTS_INL_H_ | 7874 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |