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::AssumeMapNotDeprecated(Handle<Map> map) { |
| 110 DCHECK(!map->is_deprecated()); |
| 111 // Do nothing if the map cannot be deprecated. |
| 112 if (map->CanBeDeprecated()) { |
| 113 Insert(DependentCode::kTransitionGroup, map); |
| 114 } |
| 115 } |
| 116 |
| 117 |
109 void CompilationDependencies::AssumeMapStable(Handle<Map> map) { | 118 void CompilationDependencies::AssumeMapStable(Handle<Map> map) { |
110 DCHECK(map->is_stable()); | 119 DCHECK(map->is_stable()); |
111 // Do nothing if the map cannot transition. | 120 // Do nothing if the map cannot transition. |
112 if (map->CanTransition()) { | 121 if (map->CanTransition()) { |
113 Insert(DependentCode::kPrototypeCheckGroup, map); | 122 Insert(DependentCode::kPrototypeCheckGroup, map); |
114 } | 123 } |
115 } | 124 } |
116 | 125 |
117 | 126 |
118 void CompilationDependencies::AssumeTransitionStable( | 127 void CompilationDependencies::AssumeTransitionStable( |
119 Handle<AllocationSite> site) { | 128 Handle<AllocationSite> site) { |
120 // Do nothing if the object doesn't have any useful element transitions left. | 129 // Do nothing if the object doesn't have any useful element transitions left. |
121 ElementsKind kind = | 130 ElementsKind kind = |
122 site->SitePointsToLiteral() | 131 site->SitePointsToLiteral() |
123 ? JSObject::cast(site->transition_info())->GetElementsKind() | 132 ? JSObject::cast(site->transition_info())->GetElementsKind() |
124 : site->GetElementsKind(); | 133 : site->GetElementsKind(); |
125 if (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) { | 134 if (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) { |
126 Insert(DependentCode::kAllocationSiteTransitionChangedGroup, site); | 135 Insert(DependentCode::kAllocationSiteTransitionChangedGroup, site); |
127 } | 136 } |
128 } | 137 } |
129 } // namespace internal | 138 } // namespace internal |
130 } // namespace v8 | 139 } // namespace v8 |
OLD | NEW |