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

Unified Diff: runtime/vm/parser.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/longjump_test.cc ('k') | runtime/vm/parser_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 31435)
+++ runtime/vm/parser.cc (working copy)
@@ -717,9 +717,7 @@
ASSERT(!func.IsNull());
Isolate* isolate = Isolate::Current();
StackZone zone(isolate);
- LongJump* base = isolate->long_jump_base();
- LongJump jump;
- isolate->set_long_jump_base(&jump);
+ LongJumpScope jump;
if (setjmp(*jump.Set()) == 0) {
const Script& script = Script::Handle(isolate, func.script());
const Class& owner = Class::Handle(isolate, func.Owner());
@@ -743,20 +741,17 @@
*(param[i].default_value));
const Object* metadata = param[i].metadata;
if ((metadata != NULL) && (*metadata).IsError()) {
- isolate->set_long_jump_base(base);
return metadata->raw(); // Error evaluating the metadata.
}
param_descriptor.SetAt(j + kParameterMetadataOffset,
(param[i].metadata == NULL) ? Object::null_instance() :
*(param[i].metadata));
}
- isolate->set_long_jump_base(base);
return param_descriptor.raw();
} else {
Error& error = Error::Handle();
error = isolate->object_store()->sticky_error();
isolate->object_store()->clear_sticky_error();
- isolate->set_long_jump_base(base);
return error.raw();
}
UNREACHABLE();
@@ -856,9 +851,7 @@
RawObject* Parser::ParseMetadata(const Class& cls, intptr_t token_pos) {
Isolate* isolate = Isolate::Current();
StackZone zone(isolate);
- LongJump* base = isolate->long_jump_base();
- LongJump jump;
- isolate->set_long_jump_base(&jump);
+ LongJumpScope jump;
if (setjmp(*jump.Set()) == 0) {
const Script& script = Script::Handle(cls.script());
const Library& lib = Library::Handle(cls.library());
@@ -867,13 +860,11 @@
parser.set_parsing_metadata(true);
RawObject* metadata = parser.EvaluateMetadata();
- isolate->set_long_jump_base(base);
return metadata;
} else {
Error& error = Error::Handle();
error = isolate->object_store()->sticky_error();
isolate->object_store()->clear_sticky_error();
- isolate->set_long_jump_base(base);
return error.raw();
}
UNREACHABLE();
« no previous file with comments | « runtime/vm/longjump_test.cc ('k') | runtime/vm/parser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698