OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 | 532 |
533 #ifdef DEBUG | 533 #ifdef DEBUG |
534 // Helper class for verifying the symbol table. | 534 // Helper class for verifying the symbol table. |
535 class SymbolTableVerifier : public ObjectVisitor { | 535 class SymbolTableVerifier : public ObjectVisitor { |
536 public: | 536 public: |
537 void VisitPointers(Object** start, Object** end) { | 537 void VisitPointers(Object** start, Object** end) { |
538 // Visit all HeapObject pointers in [start, end). | 538 // Visit all HeapObject pointers in [start, end). |
539 for (Object** p = start; p < end; p++) { | 539 for (Object** p = start; p < end; p++) { |
540 if ((*p)->IsHeapObject()) { | 540 if ((*p)->IsHeapObject()) { |
541 // Check that the symbol is actually a symbol. | 541 // Check that the symbol is actually a symbol. |
542 ASSERT((*p)->IsNull() || (*p)->IsUndefined() || (*p)->IsSymbol()); | 542 ASSERT((*p)->IsTheHole() || (*p)->IsUndefined() || (*p)->IsSymbol()); |
543 } | 543 } |
544 } | 544 } |
545 } | 545 } |
546 }; | 546 }; |
547 #endif // DEBUG | 547 #endif // DEBUG |
548 | 548 |
549 | 549 |
550 static void VerifySymbolTable() { | 550 static void VerifySymbolTable() { |
551 #ifdef DEBUG | 551 #ifdef DEBUG |
552 SymbolTableVerifier verifier; | 552 SymbolTableVerifier verifier; |
(...skipping 5782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6335 delete caches_[i]; | 6335 delete caches_[i]; |
6336 caches_[i] = NULL; | 6336 caches_[i] = NULL; |
6337 } | 6337 } |
6338 } | 6338 } |
6339 } | 6339 } |
6340 | 6340 |
6341 | 6341 |
6342 void ExternalStringTable::CleanUp() { | 6342 void ExternalStringTable::CleanUp() { |
6343 int last = 0; | 6343 int last = 0; |
6344 for (int i = 0; i < new_space_strings_.length(); ++i) { | 6344 for (int i = 0; i < new_space_strings_.length(); ++i) { |
6345 if (new_space_strings_[i] == heap_->raw_unchecked_null_value()) continue; | 6345 if (new_space_strings_[i] == heap_->raw_unchecked_the_hole_value()) { |
| 6346 continue; |
| 6347 } |
6346 if (heap_->InNewSpace(new_space_strings_[i])) { | 6348 if (heap_->InNewSpace(new_space_strings_[i])) { |
6347 new_space_strings_[last++] = new_space_strings_[i]; | 6349 new_space_strings_[last++] = new_space_strings_[i]; |
6348 } else { | 6350 } else { |
6349 old_space_strings_.Add(new_space_strings_[i]); | 6351 old_space_strings_.Add(new_space_strings_[i]); |
6350 } | 6352 } |
6351 } | 6353 } |
6352 new_space_strings_.Rewind(last); | 6354 new_space_strings_.Rewind(last); |
6353 last = 0; | 6355 last = 0; |
6354 for (int i = 0; i < old_space_strings_.length(); ++i) { | 6356 for (int i = 0; i < old_space_strings_.length(); ++i) { |
6355 if (old_space_strings_[i] == heap_->raw_unchecked_null_value()) continue; | 6357 if (old_space_strings_[i] == heap_->raw_unchecked_the_hole_value()) { |
| 6358 continue; |
| 6359 } |
6356 ASSERT(!heap_->InNewSpace(old_space_strings_[i])); | 6360 ASSERT(!heap_->InNewSpace(old_space_strings_[i])); |
6357 old_space_strings_[last++] = old_space_strings_[i]; | 6361 old_space_strings_[last++] = old_space_strings_[i]; |
6358 } | 6362 } |
6359 old_space_strings_.Rewind(last); | 6363 old_space_strings_.Rewind(last); |
6360 if (FLAG_verify_heap) { | 6364 if (FLAG_verify_heap) { |
6361 Verify(); | 6365 Verify(); |
6362 } | 6366 } |
6363 } | 6367 } |
6364 | 6368 |
6365 | 6369 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6411 isolate_->heap()->store_buffer()->Compact(); | 6415 isolate_->heap()->store_buffer()->Compact(); |
6412 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); | 6416 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); |
6413 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { | 6417 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { |
6414 next = chunk->next_chunk(); | 6418 next = chunk->next_chunk(); |
6415 isolate_->memory_allocator()->Free(chunk); | 6419 isolate_->memory_allocator()->Free(chunk); |
6416 } | 6420 } |
6417 chunks_queued_for_free_ = NULL; | 6421 chunks_queued_for_free_ = NULL; |
6418 } | 6422 } |
6419 | 6423 |
6420 } } // namespace v8::internal | 6424 } } // namespace v8::internal |
OLD | NEW |