| 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 1895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |