| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/snapshot.h" | 5 #include "vm/snapshot.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/bootstrap.h" | 8 #include "vm/bootstrap.h" |
| 9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
| 10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
| (...skipping 2019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2030 ASSERT(isolate() != NULL); | 2030 ASSERT(isolate() != NULL); |
| 2031 ASSERT(ClassFinalizer::AllClassesFinalized()); | 2031 ASSERT(ClassFinalizer::AllClassesFinalized()); |
| 2032 ASSERT(isolate() != NULL); | 2032 ASSERT(isolate() != NULL); |
| 2033 ASSERT(heap() != NULL); | 2033 ASSERT(heap() != NULL); |
| 2034 ObjectStore* object_store = isolate()->object_store(); | 2034 ObjectStore* object_store = isolate()->object_store(); |
| 2035 ASSERT(object_store != NULL); | 2035 ASSERT(object_store != NULL); |
| 2036 // Ensure the class table is valid. | 2036 // Ensure the class table is valid. |
| 2037 #if defined(DEBUG) | 2037 #if defined(DEBUG) |
| 2038 isolate()->ValidateClassTable(); | 2038 isolate()->ValidateClassTable(); |
| 2039 #endif | 2039 #endif |
| 2040 ASSERT(isolate()->background_compiler() == NULL); |
| 2040 | 2041 |
| 2041 // Collect all the script objects and their accompanying token stream objects | 2042 // Collect all the script objects and their accompanying token stream objects |
| 2042 // into an array so that we can write it out as part of the VM isolate | 2043 // into an array so that we can write it out as part of the VM isolate |
| 2043 // snapshot. We first count the number of script objects, allocate an array | 2044 // snapshot. We first count the number of script objects, allocate an array |
| 2044 // and then fill it up with the script objects. | 2045 // and then fill it up with the script objects. |
| 2045 ScriptVisitor scripts_counter(thread()); | 2046 ScriptVisitor scripts_counter(thread()); |
| 2046 heap()->IterateOldObjects(&scripts_counter); | 2047 heap()->IterateOldObjects(&scripts_counter); |
| 2047 intptr_t count = scripts_counter.count(); | 2048 intptr_t count = scripts_counter.count(); |
| 2048 scripts_ = Array::New(count, Heap::kOld); | 2049 scripts_ = Array::New(count, Heap::kOld); |
| 2049 ScriptVisitor script_visitor(thread(), &scripts_); | 2050 ScriptVisitor script_visitor(thread(), &scripts_); |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2769 if (setjmp(*jump.Set()) == 0) { | 2770 if (setjmp(*jump.Set()) == 0) { |
| 2770 NoSafepointScope no_safepoint; | 2771 NoSafepointScope no_safepoint; |
| 2771 WriteObject(obj.raw()); | 2772 WriteObject(obj.raw()); |
| 2772 } else { | 2773 } else { |
| 2773 ThrowException(exception_type(), exception_msg()); | 2774 ThrowException(exception_type(), exception_msg()); |
| 2774 } | 2775 } |
| 2775 } | 2776 } |
| 2776 | 2777 |
| 2777 | 2778 |
| 2778 } // namespace dart | 2779 } // namespace dart |
| OLD | NEW |