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

Side by Side Diff: runtime/vm/profiler_service.cc

Issue 1220193009: Migrate most uses of Isolate::current_zone to Thread::zone. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/os_linux.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/profiler_service.h" 5 #include "vm/profiler_service.h"
6 6
7 #include "vm/growable_array.h" 7 #include "vm/growable_array.h"
8 #include "vm/native_symbol.h" 8 #include "vm/native_symbol.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/os.h" 10 #include "vm/os.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 bool ProfileCode::IsOptimizedDart() const { 245 bool ProfileCode::IsOptimizedDart() const {
246 return !code_.IsNull() && code_.is_optimized(); 246 return !code_.IsNull() && code_.is_optimized();
247 } 247 }
248 248
249 249
250 void ProfileCode::SetName(const char* name) { 250 void ProfileCode::SetName(const char* name) {
251 if (name == NULL) { 251 if (name == NULL) {
252 name_ = NULL; 252 name_ = NULL;
253 } 253 }
254 intptr_t len = strlen(name); 254 intptr_t len = strlen(name);
255 name_ = Isolate::Current()->current_zone()->Alloc<const char>(len + 1); 255 name_ = Thread::Current()->zone()->Alloc<const char>(len + 1);
256 strncpy(const_cast<char*>(name_), name, len); 256 strncpy(const_cast<char*>(name_), name, len);
257 const_cast<char*>(name_)[len] = '\0'; 257 const_cast<char*>(name_)[len] = '\0';
258 } 258 }
259 259
260 260
261 void ProfileCode::GenerateAndSetSymbolName(const char* prefix) { 261 void ProfileCode::GenerateAndSetSymbolName(const char* prefix) {
262 const intptr_t kBuffSize = 512; 262 const intptr_t kBuffSize = 512;
263 char buff[kBuffSize]; 263 char buff[kBuffSize];
264 OS::SNPrint(&buff[0], kBuffSize-1, "%s [%" Px ", %" Px ")", 264 OS::SNPrint(&buff[0], kBuffSize-1, "%s [%" Px ", %" Px ")",
265 prefix, start(), end()); 265 prefix, start(), end());
(...skipping 1754 matching lines...) Expand 10 before | Expand all | Expand 10 after
2020 ASSERT(sample_buffer != NULL); 2020 ASSERT(sample_buffer != NULL);
2021 2021
2022 ClearProfileVisitor clear_profile(isolate); 2022 ClearProfileVisitor clear_profile(isolate);
2023 sample_buffer->VisitSamples(&clear_profile); 2023 sample_buffer->VisitSamples(&clear_profile);
2024 2024
2025 // Enable profile interrupts. 2025 // Enable profile interrupts.
2026 Profiler::BeginExecution(isolate); 2026 Profiler::BeginExecution(isolate);
2027 } 2027 }
2028 2028
2029 } // namespace dart 2029 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/os_linux.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698