OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/compilation-dependencies.h" | 5 #include "src/compilation-dependencies.h" |
6 | 6 |
7 #include "src/factory.h" | 7 #include "src/factory.h" |
8 #include "src/handles-inl.h" | 8 #include "src/handles-inl.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 static_cast<DependentCode::DependencyGroup>(i); | 99 static_cast<DependentCode::DependencyGroup>(i); |
100 for (int j = 0; j < group_objects->length(); j++) { | 100 for (int j = 0; j < group_objects->length(); j++) { |
101 DependentCode* dependent_code = Get(group_objects->at(j)); | 101 DependentCode* dependent_code = Get(group_objects->at(j)); |
102 dependent_code->RemoveCompilationDependencies(group, *object_wrapper_); | 102 dependent_code->RemoveCompilationDependencies(group, *object_wrapper_); |
103 } | 103 } |
104 groups_[i] = nullptr; // Zone-allocated, no need to delete. | 104 groups_[i] = nullptr; // Zone-allocated, no need to delete. |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 | 108 |
| 109 void CompilationDependencies::AssumeMapStable(Handle<Map> map) { |
| 110 DCHECK(map->is_stable()); |
| 111 // Do nothing if the map cannot transition. |
| 112 if (map->CanTransition()) { |
| 113 Insert(DependentCode::kPrototypeCheckGroup, map); |
| 114 } |
| 115 } |
| 116 |
| 117 |
109 void CompilationDependencies::AssumeTransitionStable( | 118 void CompilationDependencies::AssumeTransitionStable( |
110 Handle<AllocationSite> site) { | 119 Handle<AllocationSite> site) { |
111 // Do nothing if the object doesn't have any useful element transitions left. | 120 // Do nothing if the object doesn't have any useful element transitions left. |
112 ElementsKind kind = | 121 ElementsKind kind = |
113 site->SitePointsToLiteral() | 122 site->SitePointsToLiteral() |
114 ? JSObject::cast(site->transition_info())->GetElementsKind() | 123 ? JSObject::cast(site->transition_info())->GetElementsKind() |
115 : site->GetElementsKind(); | 124 : site->GetElementsKind(); |
116 if (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) { | 125 if (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) { |
117 Insert(DependentCode::kAllocationSiteTransitionChangedGroup, site); | 126 Insert(DependentCode::kAllocationSiteTransitionChangedGroup, site); |
118 } | 127 } |
119 } | 128 } |
120 } // namespace internal | 129 } // namespace internal |
121 } // namespace v8 | 130 } // namespace v8 |
OLD | NEW |