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

Unified Diff: runtime/vm/snapshot.cc

Issue 108383007: Replaces LongJump with LongJumpScope. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 12 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 | « runtime/vm/parser_test.cc ('k') | 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 31435)
+++ runtime/vm/snapshot.cc (working copy)
@@ -167,12 +167,10 @@
RawObject* SnapshotReader::ReadObject() {
- // Setup for long jump in case there is an exception while reading.
- LongJump* base = isolate()->long_jump_base();
- LongJump jump;
- isolate()->set_long_jump_base(&jump);
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) {
Object& obj = Object::Handle(ReadObjectImpl());
for (intptr_t i = 0; i < backward_references_.length(); i++) {
@@ -181,13 +179,11 @@
backward_references_[i]->set_state(kIsDeserialized);
}
}
- isolate()->set_long_jump_base(base);
return obj.raw();
} else {
// An error occurred while reading, return the error object.
const Error& err = Error::Handle(isolate()->object_store()->sticky_error());
isolate()->object_store()->clear_sticky_error();
- isolate()->set_long_jump_base(base);
return err.raw();
}
}
@@ -1082,9 +1078,7 @@
// Setup for long jump in case there is an exception while writing
// the snapshot.
- LongJump* base = isolate->long_jump_base();
- LongJump jump;
- isolate->set_long_jump_base(&jump);
+ LongJumpScope jump;
if (setjmp(*jump.Set()) == 0) {
NoGCScope no_gc;
@@ -1101,10 +1095,7 @@
FillHeader(kind());
UnmarkAll();
-
- isolate->set_long_jump_base(base);
} else {
- isolate->set_long_jump_base(base);
ThrowException(exception_type(), exception_msg());
}
}
@@ -1475,9 +1466,7 @@
// Setup for long jump in case there is an exception while writing
// the snapshot.
- LongJump* base = isolate->long_jump_base();
- LongJump jump;
- isolate->set_long_jump_base(&jump);
+ LongJumpScope jump;
if (setjmp(*jump.Set()) == 0) {
// Write out the library object.
NoGCScope no_gc;
@@ -1485,9 +1474,7 @@
WriteObject(lib.raw());
FillHeader(kind());
UnmarkAll();
- isolate->set_long_jump_base(base);
} else {
- isolate->set_long_jump_base(base);
ThrowException(exception_type(), exception_msg());
}
}
@@ -1512,16 +1499,12 @@
// Setup for long jump in case there is an exception while writing
// the message.
- LongJump* base = isolate->long_jump_base();
- LongJump jump;
- isolate->set_long_jump_base(&jump);
+ LongJumpScope jump;
if (setjmp(*jump.Set()) == 0) {
NoGCScope no_gc;
WriteObject(obj.raw());
UnmarkAll();
- isolate->set_long_jump_base(base);
} else {
- isolate->set_long_jump_base(base);
ThrowException(exception_type(), exception_msg());
}
}
« no previous file with comments | « runtime/vm/parser_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698