| 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 #ifndef V8_DEPENDENCIES_H_ | 5 #ifndef V8_DEPENDENCIES_H_ |
| 6 #define V8_DEPENDENCIES_H_ | 6 #define V8_DEPENDENCIES_H_ |
| 7 | 7 |
| 8 namespace v8 { | 8 namespace v8 { |
| 9 namespace internal { | 9 namespace internal { |
| 10 | 10 |
| 11 // Collects dependencies for this compilation, e.g. assumptions about | 11 // Collects dependencies for this compilation, e.g. assumptions about |
| 12 // stable maps, constant globals, etc. | 12 // stable maps, constant globals, etc. |
| 13 class CompilationDependencies { | 13 class CompilationDependencies { |
| 14 public: | 14 public: |
| 15 CompilationDependencies(Isolate* isolate, Zone* zone) | 15 CompilationDependencies(Isolate* isolate, Zone* zone) |
| 16 : isolate_(isolate), | 16 : isolate_(isolate), |
| 17 zone_(zone), | 17 zone_(zone), |
| 18 object_wrapper_(Handle<Foreign>::null()), | 18 object_wrapper_(Handle<Foreign>::null()), |
| 19 aborted_(false) { | 19 aborted_(false) { |
| 20 std::fill_n(groups_, DependentCode::kGroupCount, nullptr); | 20 std::fill_n(groups_, DependentCode::kGroupCount, nullptr); |
| 21 } | 21 } |
| 22 | 22 |
| 23 void Insert(DependentCode::DependencyGroup group, Handle<HeapObject> handle); | 23 void Insert(DependentCode::DependencyGroup group, Handle<HeapObject> handle); |
| 24 | 24 |
| 25 void AssumeInitialMapCantChange(Handle<Map> map) { | 25 void AssumeInitialMapCantChange(Handle<Map> map) { |
| 26 Insert(DependentCode::kInitialMapChangedGroup, map); | 26 Insert(DependentCode::kInitialMapChangedGroup, map); |
| 27 } | 27 } |
| 28 void AssumeElementsCantBeAdded(Handle<Map> map) { |
| 29 Insert(DependentCode::kElementsCantBeAddedGroup, map); |
| 30 } |
| 28 void AssumeFieldType(Handle<Map> map) { | 31 void AssumeFieldType(Handle<Map> map) { |
| 29 Insert(DependentCode::kFieldTypeGroup, map); | 32 Insert(DependentCode::kFieldTypeGroup, map); |
| 30 } | 33 } |
| 31 void AssumePropertyCell(Handle<PropertyCell> cell) { | 34 void AssumePropertyCell(Handle<PropertyCell> cell) { |
| 32 Insert(DependentCode::kPropertyCellChangedGroup, cell); | 35 Insert(DependentCode::kPropertyCellChangedGroup, cell); |
| 33 } | 36 } |
| 34 void AssumeTenuringDecision(Handle<AllocationSite> site) { | 37 void AssumeTenuringDecision(Handle<AllocationSite> site) { |
| 35 Insert(DependentCode::kAllocationSiteTenuringChangedGroup, site); | 38 Insert(DependentCode::kAllocationSiteTenuringChangedGroup, site); |
| 36 } | 39 } |
| 37 void AssumeTransitionStable(Handle<AllocationSite> site); | 40 void AssumeTransitionStable(Handle<AllocationSite> site); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 55 bool aborted_; | 58 bool aborted_; |
| 56 ZoneList<Handle<HeapObject> >* groups_[DependentCode::kGroupCount]; | 59 ZoneList<Handle<HeapObject> >* groups_[DependentCode::kGroupCount]; |
| 57 | 60 |
| 58 DependentCode* Get(Handle<Object> object); | 61 DependentCode* Get(Handle<Object> object); |
| 59 void Set(Handle<Object> object, Handle<DependentCode> dep); | 62 void Set(Handle<Object> object, Handle<DependentCode> dep); |
| 60 }; | 63 }; |
| 61 } | 64 } |
| 62 } // namespace v8::internal | 65 } // namespace v8::internal |
| 63 | 66 |
| 64 #endif // V8_DEPENDENCIES_H_ | 67 #endif // V8_DEPENDENCIES_H_ |
| OLD | NEW |