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

Unified Diff: runtime/vm/isolate.cc

Issue 3004563003: Refactor Isolate name format, storage and log (Closed)
Patch Set: Make Dart_DebugName unique again Created 3 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/isolate.h ('k') | runtime/vm/json_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 472188815767f86838873e44f3d70fddd2201d95..439911ef91064489347617644135057fea60e800 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -759,7 +759,6 @@ Isolate::Isolate(const Dart_IsolateFlags& api_flags)
background_compiler_disabled_depth_(0),
background_compiler_(NULL),
#if !defined(PRODUCT)
- debugger_name_(NULL),
debugger_(NULL),
last_resume_timestamp_(OS::GetCurrentTimeMillis()),
last_allocationprofile_accumulator_reset_timestamp_(0),
@@ -830,7 +829,6 @@ Isolate::Isolate(const Dart_IsolateFlags& api_flags)
Isolate::~Isolate() {
#if !defined(PRODUCT)
- free(debugger_name_);
delete debugger_;
if (FLAG_support_service) {
delete object_id_ring_;
@@ -981,12 +979,10 @@ void Isolate::ScheduleMessageInterrupts() {
}
}
-#if !defined(PRODUCT)
-void Isolate::set_debugger_name(const char* name) {
- free(debugger_name_);
- debugger_name_ = strdup(name);
+void Isolate::set_name(const char* name) {
+ free(name_);
+ name_ = strdup(name);
}
-#endif // !defined(PRODUCT)
int64_t Isolate::UptimeMicros() const {
return OS::GetCurrentMonotonicMicros() - start_time_micros_;
@@ -1022,14 +1018,10 @@ RawError* Isolate::PausePostRequest() {
void Isolate::BuildName(const char* name_prefix) {
ASSERT(name_ == NULL);
if (name_prefix == NULL) {
- name_prefix = "isolate";
- }
- NOT_IN_PRODUCT(set_debugger_name(name_prefix));
- if (ServiceIsolate::NameEquals(name_prefix)) {
+ name_ = OS::SCreate(NULL, "isolate-%" Pd64 "", main_port());
+ } else {
name_ = strdup(name_prefix);
- return;
}
- name_ = OS::SCreate(NULL, "%s-%" Pd64 "", name_prefix, main_port());
}
void Isolate::DoneLoading() {
@@ -1907,7 +1899,7 @@ void Isolate::PrintJSON(JSONStream* stream, bool ref) {
jsobj.AddFixedServiceId(ISOLATE_SERVICE_ID_FORMAT_STRING,
static_cast<int64_t>(main_port()));
- jsobj.AddProperty("name", debugger_name());
+ jsobj.AddProperty("name", name());
jsobj.AddPropertyF("number", "%" Pd64 "", static_cast<int64_t>(main_port()));
if (ref) {
return;
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/json_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698