Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1036)

Unified Diff: runtime/vm/snapshot.cc

Issue 388963003: Avoid allocating an exception object in the snapshot reader. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.cc
===================================================================
--- runtime/vm/snapshot.cc (revision 38187)
+++ runtime/vm/snapshot.cc (working copy)
@@ -167,8 +167,6 @@
RawObject* SnapshotReader::ReadObject() {
- const Instance& null_object = Instance::Handle();
- *ErrorHandle() = UnhandledException::New(null_object, null_object);
// Setup for long jump in case there is an exception while reading.
LongJumpScope jump;
if (setjmp(*jump.Set()) == 0) {
@@ -724,6 +722,8 @@
// into dart code or allocating any code.
// We do a longjmp at this point to unwind out of the entire
// read part and return the error object back.
+ const Instance& null_object = Instance::Handle();
+ *ErrorHandle() = UnhandledException::New(null_object, null_object);
siva 2014/07/14 16:20:03 TryAllocate just failed which means the heap is fu
Florian Schneider 2014/07/14 17:02:40 Good point. I'll try that instead.
const Instance& exception =
Instance::Handle(object_store()->out_of_memory());
ErrorHandle()->set_exception(exception);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698