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 | |
118 void CompilationDependencies::AssumeTransitionStable( | 109 void CompilationDependencies::AssumeTransitionStable( |
119 Handle<AllocationSite> site) { | 110 Handle<AllocationSite> site) { |
120 // Do nothing if the object doesn't have any useful element transitions left. | 111 // Do nothing if the object doesn't have any useful element transitions left. |
121 ElementsKind kind = | 112 ElementsKind kind = |
122 site->SitePointsToLiteral() | 113 site->SitePointsToLiteral() |
123 ? JSObject::cast(site->transition_info())->GetElementsKind() | 114 ? JSObject::cast(site->transition_info())->GetElementsKind() |
124 : site->GetElementsKind(); | 115 : site->GetElementsKind(); |
125 if (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) { | 116 if (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) { |
126 Insert(DependentCode::kAllocationSiteTransitionChangedGroup, site); | 117 Insert(DependentCode::kAllocationSiteTransitionChangedGroup, site); |
127 } | 118 } |
128 } | 119 } |
129 } // namespace internal | 120 } // namespace internal |
130 } // namespace v8 | 121 } // namespace v8 |
OLD | NEW |