OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/heap/heap.h" | 5 #include "src/heap/heap.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/ast/scopeinfo.h" | 9 #include "src/ast/scopeinfo.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 6199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6210 | 6210 |
6211 void KeyedLookupCache::Clear() { | 6211 void KeyedLookupCache::Clear() { |
6212 for (int index = 0; index < kLength; index++) keys_[index].map = NULL; | 6212 for (int index = 0; index < kLength; index++) keys_[index].map = NULL; |
6213 } | 6213 } |
6214 | 6214 |
6215 | 6215 |
6216 void DescriptorLookupCache::Clear() { | 6216 void DescriptorLookupCache::Clear() { |
6217 for (int index = 0; index < kLength; index++) keys_[index].source = NULL; | 6217 for (int index = 0; index < kLength; index++) keys_[index].source = NULL; |
6218 } | 6218 } |
6219 | 6219 |
| 6220 |
6220 void Heap::ExternalStringTable::CleanUp() { | 6221 void Heap::ExternalStringTable::CleanUp() { |
6221 int last = 0; | 6222 int last = 0; |
6222 for (int i = 0; i < new_space_strings_.length(); ++i) { | 6223 for (int i = 0; i < new_space_strings_.length(); ++i) { |
6223 if (new_space_strings_[i] == heap_->the_hole_value()) { | 6224 if (new_space_strings_[i] == heap_->the_hole_value()) { |
6224 continue; | 6225 continue; |
6225 } | 6226 } |
6226 DCHECK(new_space_strings_[i]->IsExternalString()); | 6227 DCHECK(new_space_strings_[i]->IsExternalString()); |
6227 if (heap_->InNewSpace(new_space_strings_[i])) { | 6228 if (heap_->InNewSpace(new_space_strings_[i])) { |
6228 new_space_strings_[last++] = new_space_strings_[i]; | 6229 new_space_strings_[last++] = new_space_strings_[i]; |
6229 } else { | 6230 } else { |
(...skipping 14 matching lines...) Expand all Loading... |
6244 } | 6245 } |
6245 old_space_strings_.Rewind(last); | 6246 old_space_strings_.Rewind(last); |
6246 old_space_strings_.Trim(); | 6247 old_space_strings_.Trim(); |
6247 #ifdef VERIFY_HEAP | 6248 #ifdef VERIFY_HEAP |
6248 if (FLAG_verify_heap) { | 6249 if (FLAG_verify_heap) { |
6249 Verify(); | 6250 Verify(); |
6250 } | 6251 } |
6251 #endif | 6252 #endif |
6252 } | 6253 } |
6253 | 6254 |
| 6255 |
6254 void Heap::ExternalStringTable::TearDown() { | 6256 void Heap::ExternalStringTable::TearDown() { |
6255 for (int i = 0; i < new_space_strings_.length(); ++i) { | 6257 for (int i = 0; i < new_space_strings_.length(); ++i) { |
6256 heap_->FinalizeExternalString(ExternalString::cast(new_space_strings_[i])); | 6258 heap_->FinalizeExternalString(ExternalString::cast(new_space_strings_[i])); |
6257 } | 6259 } |
6258 new_space_strings_.Free(); | 6260 new_space_strings_.Free(); |
6259 for (int i = 0; i < old_space_strings_.length(); ++i) { | 6261 for (int i = 0; i < old_space_strings_.length(); ++i) { |
6260 heap_->FinalizeExternalString(ExternalString::cast(old_space_strings_[i])); | 6262 heap_->FinalizeExternalString(ExternalString::cast(old_space_strings_[i])); |
6261 } | 6263 } |
6262 old_space_strings_.Free(); | 6264 old_space_strings_.Free(); |
6263 } | 6265 } |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6432 } | 6434 } |
6433 | 6435 |
6434 | 6436 |
6435 // static | 6437 // static |
6436 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6438 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6437 return StaticVisitorBase::GetVisitorId(map); | 6439 return StaticVisitorBase::GetVisitorId(map); |
6438 } | 6440 } |
6439 | 6441 |
6440 } // namespace internal | 6442 } // namespace internal |
6441 } // namespace v8 | 6443 } // namespace v8 |
OLD | NEW |