Chromium Code Reviews| Index: runtime/vm/object.cc |
| =================================================================== |
| --- runtime/vm/object.cc (revision 38227) |
| +++ runtime/vm/object.cc (working copy) |
| @@ -12693,6 +12693,23 @@ |
| } |
| +RawUnhandledException* UnhandledException::New(Heap::Space space) { |
| + ASSERT(Object::unhandled_exception_class() != Class::null()); |
| + UnhandledException& result = UnhandledException::Handle(); |
| + { |
| + RawObject* raw = Object::Allocate(UnhandledException::kClassId, |
| + UnhandledException::InstanceSize(), |
| + space); |
| + NoGCScope no_gc; |
| + result ^= raw; |
| + } |
| + const Instance& null_object = Instance::Handle(); |
| + result.set_exception(null_object); |
| + result.set_stacktrace(null_object); |
|
siva
2014/07/16 01:00:13
Can we use Object::null_instance() here instead of
Florian Schneider
2014/07/16 11:15:42
Done.
|
| + return result.raw(); |
| +} |
| + |
| + |
| void UnhandledException::set_exception(const Instance& exception) const { |
| StorePointer(&raw_ptr()->exception_, exception.raw()); |
| } |