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

Side by Side Diff: src/debug.cc

Issue 7650010: Avoid some crashes when running without snapshots. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Address review comments Created 9 years, 4 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.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 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 1895 matching lines...) Expand 10 before | Expand all | Expand 10 after
1906 heap->CollectAllGarbage(Heap::kMakeHeapIterableMask); 1906 heap->CollectAllGarbage(Heap::kMakeHeapIterableMask);
1907 1907
1908 ASSERT(script_cache_ == NULL); 1908 ASSERT(script_cache_ == NULL);
1909 script_cache_ = new ScriptCache(); 1909 script_cache_ = new ScriptCache();
1910 1910
1911 // Scan heap for Script objects. 1911 // Scan heap for Script objects.
1912 int count = 0; 1912 int count = 0;
1913 HeapIterator iterator; 1913 HeapIterator iterator;
1914 AssertNoAllocation no_allocation; 1914 AssertNoAllocation no_allocation;
1915 1915
1916 for (HeapObject* obj = iterator.Next(); obj != NULL; obj = iterator.Next()) { 1916 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
1917 if (obj->IsScript() && Script::cast(obj)->HasValidSource()) { 1917 if (obj->IsScript() && Script::cast(obj)->HasValidSource()) {
1918 script_cache_->Add(Handle<Script>(Script::cast(obj))); 1918 script_cache_->Add(Handle<Script>(Script::cast(obj)));
1919 count++; 1919 count++;
1920 } 1920 }
1921 } 1921 }
1922 } 1922 }
1923 1923
1924 1924
1925 void Debug::DestroyScriptCache() { 1925 void Debug::DestroyScriptCache() {
1926 // Get rid of the script cache if it was created. 1926 // Get rid of the script cache if it was created.
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after
3130 { 3130 {
3131 Locker locker; 3131 Locker locker;
3132 Isolate::Current()->debugger()->CallMessageDispatchHandler(); 3132 Isolate::Current()->debugger()->CallMessageDispatchHandler();
3133 } 3133 }
3134 } 3134 }
3135 } 3135 }
3136 3136
3137 #endif // ENABLE_DEBUGGER_SUPPORT 3137 #endif // ENABLE_DEBUGGER_SUPPORT
3138 3138
3139 } } // namespace v8::internal 3139 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698