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 } | |
31 void AssumeFieldType(Handle<Map> map) { | 28 void AssumeFieldType(Handle<Map> map) { |
32 Insert(DependentCode::kFieldTypeGroup, map); | 29 Insert(DependentCode::kFieldTypeGroup, map); |
33 } | 30 } |
34 void AssumePropertyCell(Handle<PropertyCell> cell) { | 31 void AssumePropertyCell(Handle<PropertyCell> cell) { |
35 Insert(DependentCode::kPropertyCellChangedGroup, cell); | 32 Insert(DependentCode::kPropertyCellChangedGroup, cell); |
36 } | 33 } |
37 void AssumeTenuringDecision(Handle<AllocationSite> site) { | 34 void AssumeTenuringDecision(Handle<AllocationSite> site) { |
38 Insert(DependentCode::kAllocationSiteTenuringChangedGroup, site); | 35 Insert(DependentCode::kAllocationSiteTenuringChangedGroup, site); |
39 } | 36 } |
40 void AssumeTransitionStable(Handle<AllocationSite> site); | 37 void AssumeTransitionStable(Handle<AllocationSite> site); |
(...skipping 17 matching lines...) Expand all Loading... |
58 bool aborted_; | 55 bool aborted_; |
59 ZoneList<Handle<HeapObject> >* groups_[DependentCode::kGroupCount]; | 56 ZoneList<Handle<HeapObject> >* groups_[DependentCode::kGroupCount]; |
60 | 57 |
61 DependentCode* Get(Handle<Object> object); | 58 DependentCode* Get(Handle<Object> object); |
62 void Set(Handle<Object> object, Handle<DependentCode> dep); | 59 void Set(Handle<Object> object, Handle<DependentCode> dep); |
63 }; | 60 }; |
64 } | 61 } |
65 } // namespace v8::internal | 62 } // namespace v8::internal |
66 | 63 |
67 #endif // V8_DEPENDENCIES_H_ | 64 #endif // V8_DEPENDENCIES_H_ |
OLD | NEW |