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

Side by Side Diff: src/objects.cc

Issue 1506683004: Free one bit in Map by removing unused retaining counter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #include "src/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 8801 matching lines...) Expand 10 before | Expand all | Expand 10 after
8812 result->set_bit_field2(map->bit_field2()); 8812 result->set_bit_field2(map->bit_field2());
8813 int new_bit_field3 = map->bit_field3(); 8813 int new_bit_field3 = map->bit_field3();
8814 new_bit_field3 = OwnsDescriptors::update(new_bit_field3, true); 8814 new_bit_field3 = OwnsDescriptors::update(new_bit_field3, true);
8815 new_bit_field3 = NumberOfOwnDescriptorsBits::update(new_bit_field3, 0); 8815 new_bit_field3 = NumberOfOwnDescriptorsBits::update(new_bit_field3, 0);
8816 new_bit_field3 = EnumLengthBits::update(new_bit_field3, 8816 new_bit_field3 = EnumLengthBits::update(new_bit_field3,
8817 kInvalidEnumCacheSentinel); 8817 kInvalidEnumCacheSentinel);
8818 new_bit_field3 = Deprecated::update(new_bit_field3, false); 8818 new_bit_field3 = Deprecated::update(new_bit_field3, false);
8819 if (!map->is_dictionary_map()) { 8819 if (!map->is_dictionary_map()) {
8820 new_bit_field3 = IsUnstable::update(new_bit_field3, false); 8820 new_bit_field3 = IsUnstable::update(new_bit_field3, false);
8821 } 8821 }
8822 new_bit_field3 = Counter::update(new_bit_field3, kRetainingCounterStart); 8822 new_bit_field3 =
8823 ConstructionCounter::update(new_bit_field3, kNoSlackTracking);
8823 result->set_bit_field3(new_bit_field3); 8824 result->set_bit_field3(new_bit_field3);
8824 return result; 8825 return result;
8825 } 8826 }
8826 8827
8827 8828
8828 Handle<Map> Map::Normalize(Handle<Map> fast_map, PropertyNormalizationMode mode, 8829 Handle<Map> Map::Normalize(Handle<Map> fast_map, PropertyNormalizationMode mode,
8829 const char* reason) { 8830 const char* reason) {
8830 DCHECK(!fast_map->is_dictionary_map()); 8831 DCHECK(!fast_map->is_dictionary_map());
8831 8832
8832 Isolate* isolate = fast_map->GetIsolate(); 8833 Isolate* isolate = fast_map->GetIsolate();
(...skipping 3253 matching lines...) Expand 10 before | Expand all | Expand 10 after
12086 12087
12087 // Visitor id might depend on the instance size, recalculate it. 12088 // Visitor id might depend on the instance size, recalculate it.
12088 map->set_visitor_id(Heap::GetStaticVisitorIdForMap(map)); 12089 map->set_visitor_id(Heap::GetStaticVisitorIdForMap(map));
12089 } 12090 }
12090 12091
12091 12092
12092 void Map::CompleteInobjectSlackTracking() { 12093 void Map::CompleteInobjectSlackTracking() {
12093 // Has to be an initial map. 12094 // Has to be an initial map.
12094 DCHECK(GetBackPointer()->IsUndefined()); 12095 DCHECK(GetBackPointer()->IsUndefined());
12095 12096
12096 DCHECK_GE(counter(), kSlackTrackingCounterEnd - 1); 12097 set_construction_counter(kNoSlackTracking);
12097 set_counter(kRetainingCounterStart);
12098 12098
12099 int slack = unused_property_fields(); 12099 int slack = unused_property_fields();
12100 TransitionArray::TraverseTransitionTree(this, &GetMinInobjectSlack, &slack); 12100 TransitionArray::TraverseTransitionTree(this, &GetMinInobjectSlack, &slack);
12101 if (slack != 0) { 12101 if (slack != 0) {
12102 // Resize the initial map and all maps in its transition tree. 12102 // Resize the initial map and all maps in its transition tree.
12103 TransitionArray::TraverseTransitionTree(this, &ShrinkInstanceSize, &slack); 12103 TransitionArray::TraverseTransitionTree(this, &ShrinkInstanceSize, &slack);
12104 } 12104 }
12105 } 12105 }
12106 12106
12107 12107
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after
13258 13258
13259 void Map::StartInobjectSlackTracking() { 13259 void Map::StartInobjectSlackTracking() {
13260 DCHECK(!IsInobjectSlackTrackingInProgress()); 13260 DCHECK(!IsInobjectSlackTrackingInProgress());
13261 13261
13262 // No tracking during the snapshot construction phase. 13262 // No tracking during the snapshot construction phase.
13263 Isolate* isolate = GetIsolate(); 13263 Isolate* isolate = GetIsolate();
13264 if (isolate->serializer_enabled()) return; 13264 if (isolate->serializer_enabled()) return;
13265 13265
13266 if (unused_property_fields() == 0) return; 13266 if (unused_property_fields() == 0) return;
13267 13267
13268 set_counter(Map::kSlackTrackingCounterStart); 13268 set_construction_counter(Map::kSlackTrackingCounterStart);
13269 } 13269 }
13270 13270
13271 13271
13272 void SharedFunctionInfo::ResetForNewContext(int new_ic_age) { 13272 void SharedFunctionInfo::ResetForNewContext(int new_ic_age) {
13273 code()->ClearInlineCaches(); 13273 code()->ClearInlineCaches();
13274 // If we clear ICs, we need to clear the type feedback vector too, since 13274 // If we clear ICs, we need to clear the type feedback vector too, since
13275 // CallICs are synced with a feedback vector slot. 13275 // CallICs are synced with a feedback vector slot.
13276 ClearTypeFeedbackInfo(); 13276 ClearTypeFeedbackInfo();
13277 set_ic_age(new_ic_age); 13277 set_ic_age(new_ic_age);
13278 if (code()->kind() == Code::FUNCTION) { 13278 if (code()->kind() == Code::FUNCTION) {
(...skipping 5815 matching lines...) Expand 10 before | Expand all | Expand 10 after
19094 if (cell->value() != *new_value) { 19094 if (cell->value() != *new_value) {
19095 cell->set_value(*new_value); 19095 cell->set_value(*new_value);
19096 Isolate* isolate = cell->GetIsolate(); 19096 Isolate* isolate = cell->GetIsolate();
19097 cell->dependent_code()->DeoptimizeDependentCodeGroup( 19097 cell->dependent_code()->DeoptimizeDependentCodeGroup(
19098 isolate, DependentCode::kPropertyCellChangedGroup); 19098 isolate, DependentCode::kPropertyCellChangedGroup);
19099 } 19099 }
19100 } 19100 }
19101 19101
19102 } // namespace internal 19102 } // namespace internal
19103 } // namespace v8 19103 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698