OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |