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

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

Issue 14786012: Second step towards loading the core library scripts directly from the sources (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/os_linux.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_OS_ANDROID) 6 #if defined(TARGET_OS_ANDROID)
7 7
8 #include "vm/os.h" 8 #include "vm/os.h"
9 9
10 #include <android/log.h> // NOLINT 10 #include <android/log.h> // NOLINT
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 PerfCodeObserver() { 43 PerfCodeObserver() {
44 Dart_FileOpenCallback file_open = Isolate::file_open_callback(); 44 Dart_FileOpenCallback file_open = Isolate::file_open_callback();
45 if (file_open == NULL) { 45 if (file_open == NULL) {
46 return; 46 return;
47 } 47 }
48 const char* format = "/tmp/perf-%ld.map"; 48 const char* format = "/tmp/perf-%ld.map";
49 intptr_t pid = getpid(); 49 intptr_t pid = getpid();
50 intptr_t len = OS::SNPrint(NULL, 0, format, pid); 50 intptr_t len = OS::SNPrint(NULL, 0, format, pid);
51 char* filename = new char[len + 1]; 51 char* filename = new char[len + 1];
52 OS::SNPrint(filename, len + 1, format, pid); 52 OS::SNPrint(filename, len + 1, format, pid);
53 out_file_ = (*file_open)(filename); 53 out_file_ = (*file_open)(filename, true);
54 } 54 }
55 55
56 ~PerfCodeObserver() { 56 ~PerfCodeObserver() {
57 Dart_FileCloseCallback file_close = Isolate::file_close_callback(); 57 Dart_FileCloseCallback file_close = Isolate::file_close_callback();
58 if (file_close == NULL) { 58 if (file_close == NULL) {
59 return; 59 return;
60 } 60 }
61 ASSERT(out_file_ != NULL); 61 ASSERT(out_file_ != NULL);
62 (*file_close)(out_file_); 62 (*file_close)(out_file_);
63 } 63 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 return; 104 return;
105 } 105 }
106 Dart_FileWriteCallback file_write = Isolate::file_write_callback(); 106 Dart_FileWriteCallback file_write = Isolate::file_write_callback();
107 if (file_write == NULL) { 107 if (file_write == NULL) {
108 return; 108 return;
109 } 109 }
110 if (FLAG_generate_pprof_symbols == NULL) { 110 if (FLAG_generate_pprof_symbols == NULL) {
111 return; 111 return;
112 } 112 }
113 const char* filename = FLAG_generate_pprof_symbols; 113 const char* filename = FLAG_generate_pprof_symbols;
114 void* out_file = (*file_open)(filename); 114 void* out_file = (*file_open)(filename, true);
115 ASSERT(out_file != NULL); 115 ASSERT(out_file != NULL);
116 DebugInfo::ByteBuffer* debug_region = new DebugInfo::ByteBuffer(); 116 DebugInfo::ByteBuffer* debug_region = new DebugInfo::ByteBuffer();
117 ASSERT(debug_region != NULL); 117 ASSERT(debug_region != NULL);
118 pprof_symbol_generator_->WriteToMemory(debug_region); 118 pprof_symbol_generator_->WriteToMemory(debug_region);
119 int buffer_size = debug_region->size(); 119 int buffer_size = debug_region->size();
120 void* buffer = debug_region->data(); 120 void* buffer = debug_region->data();
121 delete debug_region; 121 delete debug_region;
122 if (buffer_size > 0) { 122 if (buffer_size > 0) {
123 ASSERT(buffer != NULL); 123 ASSERT(buffer != NULL);
124 (*file_write)(buffer, buffer_size, out_file); 124 (*file_write)(buffer, buffer_size, out_file);
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 } 452 }
453 453
454 454
455 void OS::Exit(int code) { 455 void OS::Exit(int code) {
456 exit(code); 456 exit(code);
457 } 457 }
458 458
459 } // namespace dart 459 } // namespace dart
460 460
461 #endif // defined(TARGET_OS_ANDROID) 461 #endif // defined(TARGET_OS_ANDROID)
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/os_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698