| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <string.h> | 6 #include <string.h> |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "include/dart_api.h" | 9 #include "include/dart_api.h" |
| 10 | 10 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 i += 1; | 86 i += 1; |
| 87 } | 87 } |
| 88 | 88 |
| 89 return 0; | 89 return 0; |
| 90 } | 90 } |
| 91 | 91 |
| 92 | 92 |
| 93 static void DumpPprofSymbolInfo() { | 93 static void DumpPprofSymbolInfo() { |
| 94 if (generate_pprof_symbols_filename != NULL) { | 94 if (generate_pprof_symbols_filename != NULL) { |
| 95 Dart_EnterScope(); | 95 Dart_EnterScope(); |
| 96 File* pprof_file = File::OpenFile(generate_pprof_symbols_filename, true); | 96 File* pprof_file = File::Open(generate_pprof_symbols_filename, true); |
| 97 ASSERT(pprof_file != NULL); | 97 ASSERT(pprof_file != NULL); |
| 98 void* buffer; | 98 void* buffer; |
| 99 int buffer_size; | 99 int buffer_size; |
| 100 Dart_GetPprofSymbolInfo(&buffer, &buffer_size); | 100 Dart_GetPprofSymbolInfo(&buffer, &buffer_size); |
| 101 if (buffer_size > 0) { | 101 if (buffer_size > 0) { |
| 102 ASSERT(buffer != NULL); | 102 ASSERT(buffer != NULL); |
| 103 pprof_file->WriteFully(buffer, buffer_size); | 103 pprof_file->WriteFully(buffer, buffer_size); |
| 104 } | 104 } |
| 105 delete pprof_file; // Closes the file. | 105 delete pprof_file; // Closes the file. |
| 106 Dart_ExitScope(); | 106 Dart_ExitScope(); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 return 255; // Indicates we encountered an error. | 261 return 255; // Indicates we encountered an error. |
| 262 } | 262 } |
| 263 free(canonical_script_name); | 263 free(canonical_script_name); |
| 264 Dart_ExitScope(); | 264 Dart_ExitScope(); |
| 265 // Dump symbol information for the profiler. | 265 // Dump symbol information for the profiler. |
| 266 DumpPprofSymbolInfo(); | 266 DumpPprofSymbolInfo(); |
| 267 // Shutdown the isolate. | 267 // Shutdown the isolate. |
| 268 Dart_ShutdownIsolate(); | 268 Dart_ShutdownIsolate(); |
| 269 return 0; | 269 return 0; |
| 270 } | 270 } |
| OLD | NEW |