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

Unified Diff: runtime/vm/snapshot.cc

Issue 1410643008: Get rid of deprecated methods accessing mutator_thread_ instead of current thread (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/snapshot.h ('k') | runtime/vm/stack_frame.cc » ('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 870b2ad8a14136a588e1b7ce81fadf02e7b02092..59c4b35c7cd2733ba7c57c3743fcdb958f1eaf19 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -573,8 +573,8 @@ Object* SnapshotReader::GetBackRef(intptr_t id) {
class HeapLocker : public StackResource {
public:
- HeapLocker(Isolate* isolate, PageSpace* page_space)
- : StackResource(isolate), page_space_(page_space) {
+ HeapLocker(Thread* thread, PageSpace* page_space)
+ : StackResource(thread), page_space_(page_space) {
page_space_->AcquireDataLock();
}
~HeapLocker() {
@@ -588,7 +588,8 @@ class HeapLocker : public StackResource {
RawApiError* SnapshotReader::ReadFullSnapshot() {
ASSERT(kind_ == Snapshot::kFull);
- Isolate* isolate = Isolate::Current();
+ Thread* thread = Thread::Current();
+ Isolate* isolate = thread->isolate();
ASSERT(isolate != NULL);
ObjectStore* object_store = isolate->object_store();
ASSERT(object_store != NULL);
@@ -605,7 +606,7 @@ RawApiError* SnapshotReader::ReadFullSnapshot() {
// size for the full snapshot being read.
{
NoSafepointScope no_safepoint;
- HeapLocker hl(isolate, old_space());
+ HeapLocker hl(thread, old_space());
// Read in all the objects stored in the object store.
RawObject** toobj = snapshot_code() ? object_store->to()
@@ -1472,7 +1473,8 @@ VmIsolateSnapshotReader::~VmIsolateSnapshotReader() {
RawApiError* VmIsolateSnapshotReader::ReadVmIsolateSnapshot() {
ASSERT(kind() == Snapshot::kFull);
- Isolate* isolate = Isolate::Current();
+ Thread* thread = Thread::Current();
+ Isolate* isolate = thread->isolate();
ASSERT(isolate != NULL);
ASSERT(isolate == Dart::vm_isolate());
ObjectStore* object_store = isolate->object_store();
@@ -1488,7 +1490,7 @@ RawApiError* VmIsolateSnapshotReader::ReadVmIsolateSnapshot() {
{
NoSafepointScope no_safepoint;
- HeapLocker hl(isolate, old_space());
+ HeapLocker hl(thread, old_space());
// Read in the symbol table.
object_store->symbol_table_ = reinterpret_cast<RawArray*>(ReadObject());
« no previous file with comments | « runtime/vm/snapshot.h ('k') | runtime/vm/stack_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698