| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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/global-handles.h" | 5 #include "src/global-handles.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/cancelable-task.h" | 8 #include "src/cancelable-task.h" |
| 9 #include "src/objects-inl.h" | 9 #include "src/objects-inl.h" |
| 10 #include "src/v8.h" | 10 #include "src/v8.h" |
| (...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 | 938 |
| 939 DISABLE_CFI_PERF | 939 DISABLE_CFI_PERF |
| 940 void GlobalHandles::IterateAllRoots(RootVisitor* v) { | 940 void GlobalHandles::IterateAllRoots(RootVisitor* v) { |
| 941 for (NodeIterator it(this); !it.done(); it.Advance()) { | 941 for (NodeIterator it(this); !it.done(); it.Advance()) { |
| 942 if (it.node()->IsRetainer()) { | 942 if (it.node()->IsRetainer()) { |
| 943 v->VisitRootPointer(Root::kGlobalHandles, it.node()->location()); | 943 v->VisitRootPointer(Root::kGlobalHandles, it.node()->location()); |
| 944 } | 944 } |
| 945 } | 945 } |
| 946 } | 946 } |
| 947 | 947 |
| 948 DISABLE_CFI_PERF |
| 949 void GlobalHandles::IterateAllNewSpaceRoots(RootVisitor* v) { |
| 950 for (int i = 0; i < new_space_nodes_.length(); ++i) { |
| 951 Node* node = new_space_nodes_[i]; |
| 952 if (node->IsRetainer()) { |
| 953 v->VisitRootPointer(Root::kGlobalHandles, node->location()); |
| 954 } |
| 955 } |
| 956 } |
| 948 | 957 |
| 949 DISABLE_CFI_PERF | 958 DISABLE_CFI_PERF |
| 950 void GlobalHandles::ApplyPersistentHandleVisitor( | 959 void GlobalHandles::ApplyPersistentHandleVisitor( |
| 951 v8::PersistentHandleVisitor* visitor, GlobalHandles::Node* node) { | 960 v8::PersistentHandleVisitor* visitor, GlobalHandles::Node* node) { |
| 952 v8::Value* value = ToApi<v8::Value>(Handle<Object>(node->location())); | 961 v8::Value* value = ToApi<v8::Value>(Handle<Object>(node->location())); |
| 953 visitor->VisitPersistentHandle( | 962 visitor->VisitPersistentHandle( |
| 954 reinterpret_cast<v8::Persistent<v8::Value>*>(&value), | 963 reinterpret_cast<v8::Persistent<v8::Value>*>(&value), |
| 955 node->wrapper_class_id()); | 964 node->wrapper_class_id()); |
| 956 } | 965 } |
| 957 | 966 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1135 blocks_[block][offset] = object; | 1144 blocks_[block][offset] = object; |
| 1136 if (isolate->heap()->InNewSpace(object)) { | 1145 if (isolate->heap()->InNewSpace(object)) { |
| 1137 new_space_indices_.Add(size_); | 1146 new_space_indices_.Add(size_); |
| 1138 } | 1147 } |
| 1139 *index = size_++; | 1148 *index = size_++; |
| 1140 } | 1149 } |
| 1141 | 1150 |
| 1142 | 1151 |
| 1143 } // namespace internal | 1152 } // namespace internal |
| 1144 } // namespace v8 | 1153 } // namespace v8 |
| OLD | NEW |