| OLD | NEW |
| 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 <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 #include "include/dart_debugger_api.h" | 10 #include "include/dart_debugger_api.h" |
| 11 | 11 |
| 12 #include "bin/builtin.h" | 12 #include "bin/builtin.h" |
| 13 #include "bin/dartutils.h" | 13 #include "bin/dartutils.h" |
| 14 #include "bin/eventhandler.h" | 14 #include "bin/eventhandler.h" |
| 15 #include "bin/file.h" | 15 #include "bin/file.h" |
| 16 #include "bin/platform.h" | 16 #include "bin/platform.h" |
| 17 #include "bin/process.h" | |
| 18 #include "platform/globals.h" | 17 #include "platform/globals.h" |
| 19 | 18 |
| 20 // snapshot_buffer points to a snapshot if we link in a snapshot otherwise | 19 // snapshot_buffer points to a snapshot if we link in a snapshot otherwise |
| 21 // it is initialized to NULL. | 20 // it is initialized to NULL. |
| 22 extern const uint8_t* snapshot_buffer; | 21 extern const uint8_t* snapshot_buffer; |
| 23 | 22 |
| 24 | 23 |
| 25 // Global state that stores a pointer to the application script file. | 24 // Global state that stores a pointer to the application script file. |
| 26 static char* canonical_script_name = NULL; | 25 static char* canonical_script_name = NULL; |
| 27 | 26 |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 free(canonical_script_name); | 564 free(canonical_script_name); |
| 566 return 255; // Indicates we encountered an error. | 565 return 255; // Indicates we encountered an error. |
| 567 } | 566 } |
| 568 free(canonical_script_name); | 567 free(canonical_script_name); |
| 569 Dart_ExitScope(); | 568 Dart_ExitScope(); |
| 570 // Dump symbol information for the profiler. | 569 // Dump symbol information for the profiler. |
| 571 DumpPprofSymbolInfo(); | 570 DumpPprofSymbolInfo(); |
| 572 // Shutdown the isolate. | 571 // Shutdown the isolate. |
| 573 Dart_ShutdownIsolate(); | 572 Dart_ShutdownIsolate(); |
| 574 // Terminate event handler. | 573 // Terminate event handler. |
| 575 // TODO(ager): This does not actually terminate any resources of the | |
| 576 // eventhandler. The only thing it currently terminates is the | |
| 577 // global thread-pool. In order to properly terminate the event | |
| 578 // handlers we need to be able to tell when an isolate dies so we | |
| 579 // can stop the thread for the event loop in that isolate. | |
| 580 EventHandler::Terminate(); | 574 EventHandler::Terminate(); |
| 581 // Terminate process exit-code handler. | 575 |
| 582 Process::TerminateExitCodeHandler(); | |
| 583 return 0; | 576 return 0; |
| 584 } | 577 } |
| OLD | NEW |