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

Side by Side Diff: runtime/vm/timeline.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/symbols.cc ('k') | no next file » | 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 <cstdlib> 5 #include <cstdlib>
6 6
7 #include "vm/isolate.h" 7 #include "vm/isolate.h"
8 #include "vm/json_stream.h" 8 #include "vm/json_stream.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/thread.h" 10 #include "vm/thread.h"
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 return; 364 return;
365 } 365 }
366 366
367 JSONStream js; 367 JSONStream js;
368 PrintJSON(&js); 368 PrintJSON(&js);
369 369
370 const char* format = "%s/dart-timeline-%" Pd "-%" Pd ".json"; 370 const char* format = "%s/dart-timeline-%" Pd "-%" Pd ".json";
371 intptr_t pid = OS::ProcessId(); 371 intptr_t pid = OS::ProcessId();
372 intptr_t len = OS::SNPrint(NULL, 0, format, 372 intptr_t len = OS::SNPrint(NULL, 0, format,
373 directory, pid, isolate->main_port()); 373 directory, pid, isolate->main_port());
374 char* filename = isolate->current_zone()->Alloc<char>(len + 1); 374 char* filename = Thread::Current()->zone()->Alloc<char>(len + 1);
375 OS::SNPrint(filename, len + 1, format, 375 OS::SNPrint(filename, len + 1, format,
376 directory, pid, isolate->main_port()); 376 directory, pid, isolate->main_port());
377 void* file = (*file_open)(filename, true); 377 void* file = (*file_open)(filename, true);
378 if (file == NULL) { 378 if (file == NULL) {
379 OS::Print("Failed to write timeline file: %s\n", filename); 379 OS::Print("Failed to write timeline file: %s\n", filename);
380 return; 380 return;
381 } 381 }
382 (*file_write)(js.buffer()->buf(), js.buffer()->length(), file); 382 (*file_write)(js.buffer()->buf(), js.buffer()->length(), file);
383 (*file_close)(file); 383 (*file_close)(file);
384 } 384 }
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 return event; 508 return event;
509 } 509 }
510 510
511 511
512 void TimelineEventStreamingRecorder::CompleteEvent(TimelineEvent* event) { 512 void TimelineEventStreamingRecorder::CompleteEvent(TimelineEvent* event) {
513 StreamEvent(event); 513 StreamEvent(event);
514 delete event; 514 delete event;
515 } 515 }
516 516
517 } // namespace dart 517 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/symbols.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698