| 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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 | 363 |
| 364 | 364 |
| 365 void SnapshotReader::SetReadException(const char* msg) { | 365 void SnapshotReader::SetReadException(const char* msg) { |
| 366 const String& error_str = String::Handle(zone(), String::New(msg)); | 366 const String& error_str = String::Handle(zone(), String::New(msg)); |
| 367 const Array& args = Array::Handle(zone(), Array::New(1)); | 367 const Array& args = Array::Handle(zone(), Array::New(1)); |
| 368 args.SetAt(0, error_str); | 368 args.SetAt(0, error_str); |
| 369 Object& result = Object::Handle(zone()); | 369 Object& result = Object::Handle(zone()); |
| 370 const Library& library = Library::Handle(zone(), Library::CoreLibrary()); | 370 const Library& library = Library::Handle(zone(), Library::CoreLibrary()); |
| 371 result = DartLibraryCalls::InstanceCreate(library, Symbols::ArgumentError(), | 371 result = DartLibraryCalls::InstanceCreate(library, Symbols::ArgumentError(), |
| 372 Symbols::Dot(), args); | 372 Symbols::Dot(), args); |
| 373 const Stacktrace& stacktrace = Stacktrace::Handle(zone()); | 373 const StackTrace& stacktrace = StackTrace::Handle(zone()); |
| 374 const UnhandledException& error = UnhandledException::Handle( | 374 const UnhandledException& error = UnhandledException::Handle( |
| 375 zone(), UnhandledException::New(Instance::Cast(result), stacktrace)); | 375 zone(), UnhandledException::New(Instance::Cast(result), stacktrace)); |
| 376 thread()->long_jump_base()->Jump(1, error); | 376 thread()->long_jump_base()->Jump(1, error); |
| 377 } | 377 } |
| 378 | 378 |
| 379 | 379 |
| 380 RawObject* SnapshotReader::VmIsolateSnapshotObject(intptr_t index) const { | 380 RawObject* SnapshotReader::VmIsolateSnapshotObject(intptr_t index) const { |
| 381 return Object::vm_isolate_snapshot_object_table().At(index); | 381 return Object::vm_isolate_snapshot_object_table().At(index); |
| 382 } | 382 } |
| 383 | 383 |
| (...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1956 if (setjmp(*jump.Set()) == 0) { | 1956 if (setjmp(*jump.Set()) == 0) { |
| 1957 NoSafepointScope no_safepoint; | 1957 NoSafepointScope no_safepoint; |
| 1958 WriteObject(obj.raw()); | 1958 WriteObject(obj.raw()); |
| 1959 } else { | 1959 } else { |
| 1960 ThrowException(exception_type(), exception_msg()); | 1960 ThrowException(exception_type(), exception_msg()); |
| 1961 } | 1961 } |
| 1962 } | 1962 } |
| 1963 | 1963 |
| 1964 | 1964 |
| 1965 } // namespace dart | 1965 } // namespace dart |
| OLD | NEW |