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 | |
6221 void Heap::ExternalStringTable::CleanUp() { | 6220 void Heap::ExternalStringTable::CleanUp() { |
6222 int last = 0; | 6221 int last = 0; |
6223 for (int i = 0; i < new_space_strings_.length(); ++i) { | 6222 for (int i = 0; i < new_space_strings_.length(); ++i) { |
6224 if (new_space_strings_[i] == heap_->the_hole_value()) { | 6223 if (new_space_strings_[i] == heap_->the_hole_value()) { |
6225 continue; | 6224 continue; |
6226 } | 6225 } |
6227 DCHECK(new_space_strings_[i]->IsExternalString()); | 6226 DCHECK(new_space_strings_[i]->IsExternalString()); |
6228 if (heap_->InNewSpace(new_space_strings_[i])) { | 6227 if (heap_->InNewSpace(new_space_strings_[i])) { |
6229 new_space_strings_[last++] = new_space_strings_[i]; | 6228 new_space_strings_[last++] = new_space_strings_[i]; |
6230 } else { | 6229 } else { |
(...skipping 14 matching lines...) Expand all Loading... |
6245 } | 6244 } |
6246 old_space_strings_.Rewind(last); | 6245 old_space_strings_.Rewind(last); |
6247 old_space_strings_.Trim(); | 6246 old_space_strings_.Trim(); |
6248 #ifdef VERIFY_HEAP | 6247 #ifdef VERIFY_HEAP |
6249 if (FLAG_verify_heap) { | 6248 if (FLAG_verify_heap) { |
6250 Verify(); | 6249 Verify(); |
6251 } | 6250 } |
6252 #endif | 6251 #endif |
6253 } | 6252 } |
6254 | 6253 |
6255 | |
6256 void Heap::ExternalStringTable::TearDown() { | 6254 void Heap::ExternalStringTable::TearDown() { |
6257 for (int i = 0; i < new_space_strings_.length(); ++i) { | 6255 for (int i = 0; i < new_space_strings_.length(); ++i) { |
6258 heap_->FinalizeExternalString(ExternalString::cast(new_space_strings_[i])); | 6256 heap_->FinalizeExternalString(ExternalString::cast(new_space_strings_[i])); |
6259 } | 6257 } |
6260 new_space_strings_.Free(); | 6258 new_space_strings_.Free(); |
6261 for (int i = 0; i < old_space_strings_.length(); ++i) { | 6259 for (int i = 0; i < old_space_strings_.length(); ++i) { |
6262 heap_->FinalizeExternalString(ExternalString::cast(old_space_strings_[i])); | 6260 heap_->FinalizeExternalString(ExternalString::cast(old_space_strings_[i])); |
6263 } | 6261 } |
6264 old_space_strings_.Free(); | 6262 old_space_strings_.Free(); |
6265 } | 6263 } |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6434 } | 6432 } |
6435 | 6433 |
6436 | 6434 |
6437 // static | 6435 // static |
6438 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6436 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6439 return StaticVisitorBase::GetVisitorId(map); | 6437 return StaticVisitorBase::GetVisitorId(map); |
6440 } | 6438 } |
6441 | 6439 |
6442 } // namespace internal | 6440 } // namespace internal |
6443 } // namespace v8 | 6441 } // namespace v8 |
OLD | NEW |