OLD | NEW |
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 <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
(...skipping 6604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6615 result->set_bit_field2(map->bit_field2()); | 6615 result->set_bit_field2(map->bit_field2()); |
6616 int new_bit_field3 = map->bit_field3(); | 6616 int new_bit_field3 = map->bit_field3(); |
6617 new_bit_field3 = OwnsDescriptors::update(new_bit_field3, true); | 6617 new_bit_field3 = OwnsDescriptors::update(new_bit_field3, true); |
6618 new_bit_field3 = NumberOfOwnDescriptorsBits::update(new_bit_field3, 0); | 6618 new_bit_field3 = NumberOfOwnDescriptorsBits::update(new_bit_field3, 0); |
6619 new_bit_field3 = EnumLengthBits::update(new_bit_field3, | 6619 new_bit_field3 = EnumLengthBits::update(new_bit_field3, |
6620 kInvalidEnumCacheSentinel); | 6620 kInvalidEnumCacheSentinel); |
6621 new_bit_field3 = Deprecated::update(new_bit_field3, false); | 6621 new_bit_field3 = Deprecated::update(new_bit_field3, false); |
6622 if (!map->is_dictionary_map()) { | 6622 if (!map->is_dictionary_map()) { |
6623 new_bit_field3 = IsUnstable::update(new_bit_field3, false); | 6623 new_bit_field3 = IsUnstable::update(new_bit_field3, false); |
6624 } | 6624 } |
6625 new_bit_field3 = ConstructionCount::update(new_bit_field3, | 6625 new_bit_field3 = Counter::update(new_bit_field3, kRetainingCounterStart); |
6626 JSFunction::kNoSlackTracking); | |
6627 result->set_bit_field3(new_bit_field3); | 6626 result->set_bit_field3(new_bit_field3); |
6628 return result; | 6627 return result; |
6629 } | 6628 } |
6630 | 6629 |
6631 | 6630 |
6632 Handle<Map> Map::Normalize(Handle<Map> fast_map, PropertyNormalizationMode mode, | 6631 Handle<Map> Map::Normalize(Handle<Map> fast_map, PropertyNormalizationMode mode, |
6633 const char* reason) { | 6632 const char* reason) { |
6634 DCHECK(!fast_map->is_dictionary_map()); | 6633 DCHECK(!fast_map->is_dictionary_map()); |
6635 | 6634 |
6636 Isolate* isolate = fast_map->GetIsolate(); | 6635 Isolate* isolate = fast_map->GetIsolate(); |
(...skipping 3618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10255 USE(ignore); | 10254 USE(ignore); |
10256 return true; // Return true if there was no DCHECK. | 10255 return true; // Return true if there was no DCHECK. |
10257 } | 10256 } |
10258 | 10257 |
10259 | 10258 |
10260 void JSFunction::StartInobjectSlackTracking() { | 10259 void JSFunction::StartInobjectSlackTracking() { |
10261 DCHECK(has_initial_map() && !IsInobjectSlackTrackingInProgress()); | 10260 DCHECK(has_initial_map() && !IsInobjectSlackTrackingInProgress()); |
10262 | 10261 |
10263 Map* map = initial_map(); | 10262 Map* map = initial_map(); |
10264 | 10263 |
10265 // Only initiate the tracking the first time. | |
10266 if (map->done_inobject_slack_tracking()) return; | |
10267 map->set_done_inobject_slack_tracking(true); | |
10268 | |
10269 // No tracking during the snapshot construction phase. | 10264 // No tracking during the snapshot construction phase. |
10270 Isolate* isolate = GetIsolate(); | 10265 Isolate* isolate = GetIsolate(); |
10271 if (isolate->serializer_enabled()) return; | 10266 if (isolate->serializer_enabled()) return; |
10272 | 10267 |
10273 if (map->unused_property_fields() == 0) return; | 10268 if (map->unused_property_fields() == 0) return; |
10274 | 10269 |
10275 map->set_construction_count(kGenerousAllocationCount); | 10270 map->set_counter(Map::kSlackTrackingCounterStart); |
10276 } | 10271 } |
10277 | 10272 |
10278 | 10273 |
10279 void SharedFunctionInfo::ResetForNewContext(int new_ic_age) { | 10274 void SharedFunctionInfo::ResetForNewContext(int new_ic_age) { |
10280 code()->ClearInlineCaches(); | 10275 code()->ClearInlineCaches(); |
10281 // If we clear ICs, we need to clear the type feedback vector too, since | 10276 // If we clear ICs, we need to clear the type feedback vector too, since |
10282 // CallICs are synced with a feedback vector slot. | 10277 // CallICs are synced with a feedback vector slot. |
10283 ClearTypeFeedbackInfo(); | 10278 ClearTypeFeedbackInfo(); |
10284 set_ic_age(new_ic_age); | 10279 set_ic_age(new_ic_age); |
10285 if (code()->kind() == Code::FUNCTION) { | 10280 if (code()->kind() == Code::FUNCTION) { |
(...skipping 26 matching lines...) Expand all Loading... |
10312 | 10307 |
10313 // Visitor id might depend on the instance size, recalculate it. | 10308 // Visitor id might depend on the instance size, recalculate it. |
10314 map->set_visitor_id(StaticVisitorBase::GetVisitorId(map)); | 10309 map->set_visitor_id(StaticVisitorBase::GetVisitorId(map)); |
10315 } | 10310 } |
10316 | 10311 |
10317 | 10312 |
10318 void JSFunction::CompleteInobjectSlackTracking() { | 10313 void JSFunction::CompleteInobjectSlackTracking() { |
10319 DCHECK(has_initial_map()); | 10314 DCHECK(has_initial_map()); |
10320 Map* map = initial_map(); | 10315 Map* map = initial_map(); |
10321 | 10316 |
10322 DCHECK(map->done_inobject_slack_tracking()); | 10317 DCHECK(map->counter() >= Map::kSlackTrackingCounterEnd - 1); |
10323 map->set_construction_count(kNoSlackTracking); | 10318 map->set_counter(Map::kRetainingCounterStart); |
10324 | 10319 |
10325 int slack = map->unused_property_fields(); | 10320 int slack = map->unused_property_fields(); |
10326 map->TraverseTransitionTree(&GetMinInobjectSlack, &slack); | 10321 map->TraverseTransitionTree(&GetMinInobjectSlack, &slack); |
10327 if (slack != 0) { | 10322 if (slack != 0) { |
10328 // Resize the initial map and all maps in its transition tree. | 10323 // Resize the initial map and all maps in its transition tree. |
10329 map->TraverseTransitionTree(&ShrinkInstanceSize, &slack); | 10324 map->TraverseTransitionTree(&ShrinkInstanceSize, &slack); |
10330 } | 10325 } |
10331 } | 10326 } |
10332 | 10327 |
10333 | 10328 |
(...skipping 6562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16896 Handle<DependentCode> codes = | 16891 Handle<DependentCode> codes = |
16897 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 16892 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), |
16898 DependentCode::kPropertyCellChangedGroup, | 16893 DependentCode::kPropertyCellChangedGroup, |
16899 info->object_wrapper()); | 16894 info->object_wrapper()); |
16900 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 16895 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
16901 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16896 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
16902 cell, info->zone()); | 16897 cell, info->zone()); |
16903 } | 16898 } |
16904 | 16899 |
16905 } } // namespace v8::internal | 16900 } } // namespace v8::internal |
OLD | NEW |