| 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 "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 | 6 |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
| (...skipping 2423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2434 DART_EXPORT void Dart_InitPprofSupport() { | 2434 DART_EXPORT void Dart_InitPprofSupport() { |
| 2435 DebugInfo* pprof_symbol_generator = DebugInfo::NewGenerator(); | 2435 DebugInfo* pprof_symbol_generator = DebugInfo::NewGenerator(); |
| 2436 ASSERT(pprof_symbol_generator != NULL); | 2436 ASSERT(pprof_symbol_generator != NULL); |
| 2437 Dart::set_pprof_symbol_generator(pprof_symbol_generator); | 2437 Dart::set_pprof_symbol_generator(pprof_symbol_generator); |
| 2438 } | 2438 } |
| 2439 | 2439 |
| 2440 | 2440 |
| 2441 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size) { | 2441 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size) { |
| 2442 DebugInfo* pprof_symbol_generator = Dart::pprof_symbol_generator(); | 2442 DebugInfo* pprof_symbol_generator = Dart::pprof_symbol_generator(); |
| 2443 if (pprof_symbol_generator != NULL) { | 2443 if (pprof_symbol_generator != NULL) { |
| 2444 ByteArray* debug_region = new ByteArray(); | 2444 DebugInfo::ByteBuffer* debug_region = new DebugInfo::ByteBuffer(); |
| 2445 ASSERT(debug_region != NULL); | 2445 ASSERT(debug_region != NULL); |
| 2446 pprof_symbol_generator->WriteToMemory(debug_region); | 2446 pprof_symbol_generator->WriteToMemory(debug_region); |
| 2447 *buffer_size = debug_region->size(); | 2447 *buffer_size = debug_region->size(); |
| 2448 if (*buffer_size != 0) { | 2448 if (*buffer_size != 0) { |
| 2449 *buffer = reinterpret_cast<void*>(Api::Allocate(*buffer_size)); | 2449 *buffer = reinterpret_cast<void*>(Api::Allocate(*buffer_size)); |
| 2450 memmove(*buffer, debug_region->data(), *buffer_size); | 2450 memmove(*buffer, debug_region->data(), *buffer_size); |
| 2451 } else { | 2451 } else { |
| 2452 *buffer = NULL; | 2452 *buffer = NULL; |
| 2453 } | 2453 } |
| 2454 delete debug_region; | 2454 delete debug_region; |
| 2455 } else { | 2455 } else { |
| 2456 *buffer = NULL; | 2456 *buffer = NULL; |
| 2457 *buffer_size = 0; | 2457 *buffer_size = 0; |
| 2458 } | 2458 } |
| 2459 } | 2459 } |
| 2460 | 2460 |
| 2461 | 2461 |
| 2462 } // namespace dart | 2462 } // namespace dart |
| OLD | NEW |