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

Unified Diff: runtime/vm/service.cc

Issue 1414493003: Remove some Isolate::current_zone() calls, as it gets the zone from mutator thread not the current … (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: cleanup 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
Index: runtime/vm/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index 42e50a4a108e610df1af186d91eedd4259bedc8f..5e8800a4ea0d59b7403219d0fd2582cbcf50d1f0 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -1101,7 +1101,7 @@ static bool ContainsNonInstance(const Object& obj) {
}
-static RawObject* LookupObjectId(Isolate* isolate,
+static RawObject* LookupObjectId(Thread* thread,
const char* arg,
ObjectIdRing::LookupResult* kind) {
*kind = ObjectIdRing::kValid;
@@ -1113,7 +1113,7 @@ static RawObject* LookupObjectId(Isolate* isolate,
*kind = ObjectIdRing::kInvalid;
return Object::null();
}
- const Integer& obj = Integer::Handle(isolate->current_zone(),
+ const Integer& obj = Integer::Handle(thread->zone(),
Smi::New(static_cast<intptr_t>(value)));
return obj.raw();
} else if (strcmp(arg, "bool-true") == 0) {
@@ -1124,7 +1124,7 @@ static RawObject* LookupObjectId(Isolate* isolate,
return Object::null();
}
- ObjectIdRing* ring = isolate->object_id_ring();
+ ObjectIdRing* ring = thread->isolate()->object_id_ring();
ASSERT(ring != NULL);
intptr_t id = -1;
if (!GetIntegerId(arg, &id)) {
@@ -1238,8 +1238,7 @@ static RawObject* LookupHeapObjectClasses(Isolate* isolate,
return Object::sentinel().raw();
}
const char* encoded_id = parts[3];
- String& id = String::Handle(isolate->current_zone(),
- String::New(encoded_id));
+ String& id = String::Handle(String::New(encoded_id));
id = String::DecodeIRI(id);
if (id.IsNull()) {
return Object::sentinel().raw();
@@ -1399,7 +1398,8 @@ static RawObject* LookupHeapObjectMessage(Isolate* isolate,
static RawObject* LookupHeapObject(Isolate* isolate,
const char* id_original,
ObjectIdRing::LookupResult* result) {
- char* id = Thread::Current()->zone()->MakeCopyOfString(id_original);
+ Thread* thread = Thread::Current();
+ char* id = thread->zone()->MakeCopyOfString(id_original);
// Parse the id by splitting at each '/'.
const int MAX_PARTS = 8;
@@ -1429,9 +1429,9 @@ static RawObject* LookupHeapObject(Isolate* isolate,
if (strcmp(parts[0], "objects") == 0) {
// Object ids look like "objects/1123"
- Object& obj = Object::Handle(isolate->current_zone());
+ Object& obj = Object::Handle(thread->zone());
ObjectIdRing::LookupResult lookup_result;
- obj = LookupObjectId(isolate, parts[1], &lookup_result);
+ obj = LookupObjectId(thread, parts[1], &lookup_result);
if (lookup_result != ObjectIdRing::kValid) {
if (result != NULL) {
*result = lookup_result;
@@ -1779,8 +1779,7 @@ static bool Evaluate(Isolate* isolate, JSONStream* js) {
PrintMissingParamError(js, "expression");
return true;
}
- const String& expr_str =
- String::Handle(isolate->current_zone(), String::New(expr));
+ const String& expr_str = String::Handle(String::New(expr));
ObjectIdRing::LookupResult lookup_result;
Object& obj = Object::Handle(LookupHeapObject(isolate, target_id,
&lookup_result));
@@ -1813,7 +1812,7 @@ static bool Evaluate(Isolate* isolate, JSONStream* js) {
if ((obj.IsInstance() || obj.IsNull()) &&
!ContainsNonInstance(obj)) {
// We don't use Instance::Cast here because it doesn't allow null.
- Instance& instance = Instance::Handle(isolate->current_zone());
+ Instance& instance = Instance::Handle();
instance ^= obj.raw();
const Object& result =
Object::Handle(instance.Evaluate(expr_str,
@@ -1853,8 +1852,7 @@ static bool EvaluateInFrame(Isolate* isolate, JSONStream* js) {
ActivationFrame* frame = stack->FrameAt(framePos);
const char* expr = js->LookupParam("expression");
- const String& expr_str = String::Handle(isolate->current_zone(),
- String::New(expr));
+ const String& expr_str = String::Handle(String::New(expr));
const Object& result = Object::Handle(frame->Evaluate(expr_str));
result.PrintJSON(js, true);
« runtime/vm/object.cc ('K') | « runtime/vm/object.cc ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698