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

Unified Diff: runtime/vm/parser.cc

Issue 1299653003: Migrate LongJumpScope to Thread. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Assert current isolate. Created 5 years, 4 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/object.cc ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 7a95d110aaf46eb7c17464529ec70827f89561df..457e235d9c48184708acb23a5fd5eb6e827b57de 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -446,7 +446,7 @@ void Parser::SetPosition(intptr_t position) {
void Parser::ParseCompilationUnit(const Library& library,
const Script& script) {
Thread* thread = Thread::Current();
- ASSERT(thread->isolate()->long_jump_base()->IsSafeToJump());
+ ASSERT(thread->long_jump_base()->IsSafeToJump());
CSTAT_TIMER_SCOPE(thread->isolate(), parser_timer);
VMTagScope tagScope(thread, VMTag::kCompileTopLevelTagId);
Parser parser(script, library, 0);
@@ -772,19 +772,23 @@ struct TopLevel {
void Parser::ParseClass(const Class& cls) {
if (!cls.is_synthesized_class()) {
- Isolate* isolate = Isolate::Current();
+ Thread* thread = Thread::Current();
+ Isolate* isolate = thread->isolate();
+ Zone* zone = thread->zone();
CSTAT_TIMER_SCOPE(isolate, parser_timer);
- ASSERT(isolate->long_jump_base()->IsSafeToJump());
- const Script& script = Script::Handle(isolate, cls.script());
- const Library& lib = Library::Handle(isolate, cls.library());
+ ASSERT(thread->long_jump_base()->IsSafeToJump());
+ const Script& script = Script::Handle(zone, cls.script());
+ const Library& lib = Library::Handle(zone, cls.library());
Parser parser(script, lib, cls.token_pos());
parser.ParseClassDefinition(cls);
} else if (cls.is_enum_class()) {
- Isolate* isolate = Isolate::Current();
+ Thread* thread = Thread::Current();
+ Isolate* isolate = thread->isolate();
+ Zone* zone = thread->zone();
CSTAT_TIMER_SCOPE(isolate, parser_timer);
- ASSERT(isolate->long_jump_base()->IsSafeToJump());
- const Script& script = Script::Handle(isolate, cls.script());
- const Library& lib = Library::Handle(isolate, cls.library());
+ ASSERT(thread->long_jump_base()->IsSafeToJump());
+ const Script& script = Script::Handle(zone, cls.script());
+ const Library& lib = Library::Handle(zone, cls.library());
Parser parser(script, lib, cls.token_pos());
parser.ParseEnumDefinition(cls);
}
@@ -881,7 +885,7 @@ void Parser::ParseFunction(ParsedFunction* parsed_function) {
VMTagScope tagScope(thread, VMTag::kCompileParseFunctionTagId,
FLAG_profile_vm);
- ASSERT(isolate->long_jump_base()->IsSafeToJump());
+ ASSERT(thread->long_jump_base()->IsSafeToJump());
ASSERT(parsed_function != NULL);
const Function& func = parsed_function->function();
const Script& script = Script::Handle(zone, func.script());
@@ -12038,7 +12042,7 @@ RawObject* Parser::EvaluateConstConstructorCall(
if (result.IsUnhandledException()) {
return result.raw();
} else {
- I->long_jump_base()->Jump(1, Error::Cast(result));
+ thread()->long_jump_base()->Jump(1, Error::Cast(result));
UNREACHABLE();
return Object::null();
}
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698