| 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/bigint_operations.h" | 8 #include "vm/bigint_operations.h" |
| 9 #include "vm/bootstrap.h" | 9 #include "vm/bootstrap.h" |
| 10 #include "vm/class_finalizer.h" |
| 10 #include "vm/exceptions.h" | 11 #include "vm/exceptions.h" |
| 11 #include "vm/heap.h" | 12 #include "vm/heap.h" |
| 12 #include "vm/longjump.h" | 13 #include "vm/longjump.h" |
| 13 #include "vm/object.h" | 14 #include "vm/object.h" |
| 14 #include "vm/object_store.h" | 15 #include "vm/object_store.h" |
| 15 #include "vm/snapshot_ids.h" | 16 #include "vm/snapshot_ids.h" |
| 16 #include "vm/symbols.h" | 17 #include "vm/symbols.h" |
| 17 | 18 |
| 18 namespace dart { | 19 namespace dart { |
| 19 | 20 |
| (...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 } | 941 } |
| 941 UNREACHABLE(); | 942 UNREACHABLE(); |
| 942 } | 943 } |
| 943 | 944 |
| 944 | 945 |
| 945 void FullSnapshotWriter::WriteFullSnapshot() { | 946 void FullSnapshotWriter::WriteFullSnapshot() { |
| 946 Isolate* isolate = Isolate::Current(); | 947 Isolate* isolate = Isolate::Current(); |
| 947 ASSERT(isolate != NULL); | 948 ASSERT(isolate != NULL); |
| 948 ObjectStore* object_store = isolate->object_store(); | 949 ObjectStore* object_store = isolate->object_store(); |
| 949 ASSERT(object_store != NULL); | 950 ASSERT(object_store != NULL); |
| 951 ASSERT(ClassFinalizer::AllClassesFinalized()); |
| 950 | 952 |
| 951 // Setup for long jump in case there is an exception while writing | 953 // Setup for long jump in case there is an exception while writing |
| 952 // the snapshot. | 954 // the snapshot. |
| 953 LongJump* base = isolate->long_jump_base(); | 955 LongJump* base = isolate->long_jump_base(); |
| 954 LongJump jump; | 956 LongJump jump; |
| 955 isolate->set_long_jump_base(&jump); | 957 isolate->set_long_jump_base(&jump); |
| 956 // TODO(6726): Allocate these constant strings once in the VM isolate. | 958 // TODO(6726): Allocate these constant strings once in the VM isolate. |
| 957 *ErrorHandle() = LanguageError::New( | 959 *ErrorHandle() = LanguageError::New( |
| 958 String::Handle(String::New("Error while writing full snapshot"))); | 960 String::Handle(String::New("Error while writing full snapshot"))); |
| 959 if (setjmp(*jump.Set()) == 0) { | 961 if (setjmp(*jump.Set()) == 0) { |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1312 UnmarkAll(); | 1314 UnmarkAll(); |
| 1313 isolate->set_long_jump_base(base); | 1315 isolate->set_long_jump_base(base); |
| 1314 } else { | 1316 } else { |
| 1315 isolate->set_long_jump_base(base); | 1317 isolate->set_long_jump_base(base); |
| 1316 ThrowException(exception_type(), exception_msg()); | 1318 ThrowException(exception_type(), exception_msg()); |
| 1317 } | 1319 } |
| 1318 } | 1320 } |
| 1319 | 1321 |
| 1320 | 1322 |
| 1321 } // namespace dart | 1323 } // namespace dart |
| OLD | NEW |