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

Unified Diff: runtime/vm/snapshot.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/report.cc ('k') | runtime/vm/thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.cc
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
index 4b92acda84b71f86da0891b60c6008beba3d49a4..0b06c916f4d730542cc8341615ebc9f380ff7872 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -303,20 +303,21 @@ intptr_t SnapshotReader::NextAvailableObjectId() const {
void SnapshotReader::SetReadException(const char* msg) {
- Isolate* isolate = Isolate::Current();
- const String& error_str = String::Handle(isolate, String::New(msg));
- const Array& args = Array::Handle(isolate, Array::New(1));
+ Thread* thread = Thread::Current();
+ Zone* zone = thread->zone();
+ const String& error_str = String::Handle(zone, String::New(msg));
+ const Array& args = Array::Handle(zone, Array::New(1));
args.SetAt(0, error_str);
- Object& result = Object::Handle(isolate);
- const Library& library = Library::Handle(isolate, Library::CoreLibrary());
+ Object& result = Object::Handle(zone);
+ const Library& library = Library::Handle(zone, Library::CoreLibrary());
result = DartLibraryCalls::InstanceCreate(library,
Symbols::ArgumentError(),
Symbols::Dot(),
args);
- const Stacktrace& stacktrace = Stacktrace::Handle(isolate);
+ const Stacktrace& stacktrace = Stacktrace::Handle(zone);
const UnhandledException& error = UnhandledException::Handle(
- isolate, UnhandledException::New(Instance::Cast(result), stacktrace));
- isolate->long_jump_base()->Jump(1, error);
+ zone, UnhandledException::New(Instance::Cast(result), stacktrace));
+ thread->long_jump_base()->Jump(1, error);
}
@@ -1065,7 +1066,7 @@ RawObject* SnapshotReader::AllocateUninitialized(intptr_t class_id,
// read part and return the error object back.
const UnhandledException& error = UnhandledException::Handle(
object_store()->preallocated_unhandled_exception());
- Isolate::Current()->long_jump_base()->Jump(1, error);
+ Thread::Current()->long_jump_base()->Jump(1, error);
}
VerifiedMemory::Accept(address, size);
@@ -2178,7 +2179,7 @@ void SnapshotWriter::SetWriteException(Exceptions::ExceptionType type,
set_exception_type(type);
set_exception_msg(msg);
// The more specific error is set up in SnapshotWriter::ThrowException().
- isolate()->long_jump_base()->
+ thread()->long_jump_base()->
Jump(1, Object::snapshot_writer_error());
}
« no previous file with comments | « runtime/vm/report.cc ('k') | runtime/vm/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698