Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: src/heap.cc

Issue 23567002: Assert external strings in external string table. Remove TODOs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/heap-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 7868 matching lines...) Expand 10 before | Expand all | Expand 10 after
7879 } 7879 }
7880 } 7880 }
7881 7881
7882 7882
7883 void ExternalStringTable::CleanUp() { 7883 void ExternalStringTable::CleanUp() {
7884 int last = 0; 7884 int last = 0;
7885 for (int i = 0; i < new_space_strings_.length(); ++i) { 7885 for (int i = 0; i < new_space_strings_.length(); ++i) {
7886 if (new_space_strings_[i] == heap_->the_hole_value()) { 7886 if (new_space_strings_[i] == heap_->the_hole_value()) {
7887 continue; 7887 continue;
7888 } 7888 }
7889 ASSERT(new_space_strings_[i]->IsExternalString());
7889 if (heap_->InNewSpace(new_space_strings_[i])) { 7890 if (heap_->InNewSpace(new_space_strings_[i])) {
7890 new_space_strings_[last++] = new_space_strings_[i]; 7891 new_space_strings_[last++] = new_space_strings_[i];
7891 } else { 7892 } else {
7892 old_space_strings_.Add(new_space_strings_[i]); 7893 old_space_strings_.Add(new_space_strings_[i]);
7893 } 7894 }
7894 } 7895 }
7895 new_space_strings_.Rewind(last); 7896 new_space_strings_.Rewind(last);
7896 new_space_strings_.Trim(); 7897 new_space_strings_.Trim();
7897 7898
7898 last = 0; 7899 last = 0;
7899 for (int i = 0; i < old_space_strings_.length(); ++i) { 7900 for (int i = 0; i < old_space_strings_.length(); ++i) {
7900 if (old_space_strings_[i] == heap_->the_hole_value()) { 7901 if (old_space_strings_[i] == heap_->the_hole_value()) {
7901 continue; 7902 continue;
7902 } 7903 }
7904 ASSERT(old_space_strings_[i]->IsExternalString());
7903 ASSERT(!heap_->InNewSpace(old_space_strings_[i])); 7905 ASSERT(!heap_->InNewSpace(old_space_strings_[i]));
7904 old_space_strings_[last++] = old_space_strings_[i]; 7906 old_space_strings_[last++] = old_space_strings_[i];
7905 } 7907 }
7906 old_space_strings_.Rewind(last); 7908 old_space_strings_.Rewind(last);
7907 old_space_strings_.Trim(); 7909 old_space_strings_.Trim();
7908 #ifdef VERIFY_HEAP 7910 #ifdef VERIFY_HEAP
7909 if (FLAG_verify_heap) { 7911 if (FLAG_verify_heap) {
7910 Verify(); 7912 Verify();
7911 } 7913 }
7912 #endif 7914 #endif
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
8051 if (FLAG_concurrent_recompilation) { 8053 if (FLAG_concurrent_recompilation) {
8052 heap_->relocation_mutex_->Lock(); 8054 heap_->relocation_mutex_->Lock();
8053 #ifdef DEBUG 8055 #ifdef DEBUG
8054 heap_->relocation_mutex_locked_by_optimizer_thread_ = 8056 heap_->relocation_mutex_locked_by_optimizer_thread_ =
8055 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 8057 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
8056 #endif // DEBUG 8058 #endif // DEBUG
8057 } 8059 }
8058 } 8060 }
8059 8061
8060 } } // namespace v8::internal 8062 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698