Chromium Code Reviews| 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 "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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 578 | 578 |
| 579 // --- Isolates --- | 579 // --- Isolates --- |
| 580 | 580 |
| 581 | 581 |
| 582 DART_EXPORT Dart_Isolate Dart_CreateIsolate(const char* name_prefix, | 582 DART_EXPORT Dart_Isolate Dart_CreateIsolate(const char* name_prefix, |
| 583 const uint8_t* snapshot, | 583 const uint8_t* snapshot, |
| 584 void* callback_data, | 584 void* callback_data, |
| 585 char** error) { | 585 char** error) { |
| 586 Isolate* isolate = Dart::CreateIsolate(name_prefix); | 586 Isolate* isolate = Dart::CreateIsolate(name_prefix); |
| 587 assert(isolate != NULL); | 587 assert(isolate != NULL); |
| 588 DARTSCOPE_NOCHECKS(isolate); | 588 { |
| 589 const Error& error_obj = | 589 DARTSCOPE_NOCHECKS(isolate); |
| 590 Error::Handle(Dart::InitializeIsolate(snapshot, callback_data)); | 590 const Error& error_obj = |
| 591 if (error_obj.IsNull()) { | 591 Error::Handle(Dart::InitializeIsolate(snapshot, callback_data)); |
| 592 START_TIMER(time_total_runtime); | 592 if (error_obj.IsNull()) { |
| 593 return reinterpret_cast<Dart_Isolate>(isolate); | 593 START_TIMER(time_total_runtime); |
| 594 } else { | 594 return reinterpret_cast<Dart_Isolate>(isolate); |
| 595 *error = strdup(error_obj.ToErrorCString()); | 595 } else { |
|
siva
2012/03/12 20:09:39
We could even get rid of this else and
do:
}
*
| |
| 596 Dart::ShutdownIsolate(); | 596 *error = strdup(error_obj.ToErrorCString()); |
| 597 return reinterpret_cast<Dart_Isolate>(NULL); | 597 } |
| 598 } | 598 } |
| 599 Dart::ShutdownIsolate(); | |
| 600 return reinterpret_cast<Dart_Isolate>(NULL); | |
| 599 } | 601 } |
| 600 | 602 |
| 601 | 603 |
| 602 DART_EXPORT void Dart_ShutdownIsolate() { | 604 DART_EXPORT void Dart_ShutdownIsolate() { |
| 603 CHECK_ISOLATE(Isolate::Current()); | 605 CHECK_ISOLATE(Isolate::Current()); |
| 604 STOP_TIMER(time_total_runtime); | 606 STOP_TIMER(time_total_runtime); |
| 605 Dart::ShutdownIsolate(); | 607 Dart::ShutdownIsolate(); |
| 606 } | 608 } |
| 607 | 609 |
| 608 | 610 |
| (...skipping 2477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3086 *buffer = NULL; | 3088 *buffer = NULL; |
| 3087 } | 3089 } |
| 3088 delete debug_region; | 3090 delete debug_region; |
| 3089 } else { | 3091 } else { |
| 3090 *buffer = NULL; | 3092 *buffer = NULL; |
| 3091 *buffer_size = 0; | 3093 *buffer_size = 0; |
| 3092 } | 3094 } |
| 3093 } | 3095 } |
| 3094 | 3096 |
| 3095 } // namespace dart | 3097 } // namespace dart |
| OLD | NEW |