| 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 1918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1929 if (instructions_snapshot_buffer != NULL) { | 1929 if (instructions_snapshot_buffer != NULL) { |
| 1930 instructions_writer_ = new InstructionsWriter(instructions_snapshot_buffer, | 1930 instructions_writer_ = new InstructionsWriter(instructions_snapshot_buffer, |
| 1931 alloc, | 1931 alloc, |
| 1932 kInitialSize); | 1932 kInitialSize); |
| 1933 } | 1933 } |
| 1934 } | 1934 } |
| 1935 | 1935 |
| 1936 | 1936 |
| 1937 FullSnapshotWriter::~FullSnapshotWriter() { | 1937 FullSnapshotWriter::~FullSnapshotWriter() { |
| 1938 delete forward_list_; | 1938 delete forward_list_; |
| 1939 // We may run Dart code afterwards, restore the symbol table. |
| 1940 isolate()->object_store()->set_symbol_table(symbol_table_); |
| 1939 symbol_table_ = Array::null(); | 1941 symbol_table_ = Array::null(); |
| 1940 scripts_ = Array::null(); | 1942 scripts_ = Array::null(); |
| 1941 } | 1943 } |
| 1942 | 1944 |
| 1943 | 1945 |
| 1944 void FullSnapshotWriter::WriteVmIsolateSnapshot() { | 1946 void FullSnapshotWriter::WriteVmIsolateSnapshot() { |
| 1945 ASSERT(vm_isolate_snapshot_buffer_ != NULL); | 1947 ASSERT(vm_isolate_snapshot_buffer_ != NULL); |
| 1946 SnapshotWriter writer(Snapshot::kFull, | 1948 SnapshotWriter writer(Snapshot::kFull, |
| 1947 thread(), | 1949 thread(), |
| 1948 vm_isolate_snapshot_buffer_, | 1950 vm_isolate_snapshot_buffer_, |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2660 if (setjmp(*jump.Set()) == 0) { | 2662 if (setjmp(*jump.Set()) == 0) { |
| 2661 NoSafepointScope no_safepoint; | 2663 NoSafepointScope no_safepoint; |
| 2662 WriteObject(obj.raw()); | 2664 WriteObject(obj.raw()); |
| 2663 } else { | 2665 } else { |
| 2664 ThrowException(exception_type(), exception_msg()); | 2666 ThrowException(exception_type(), exception_msg()); |
| 2665 } | 2667 } |
| 2666 } | 2668 } |
| 2667 | 2669 |
| 2668 | 2670 |
| 2669 } // namespace dart | 2671 } // namespace dart |
| OLD | NEW |