| 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" |
| 11 #include "vm/dart_api_impl.h" | 11 #include "vm/dart_api_impl.h" |
| 12 #include "vm/dart_api_message.h" | 12 #include "vm/dart_api_message.h" |
| 13 #include "vm/dart_api_state.h" | 13 #include "vm/dart_api_state.h" |
| 14 #include "vm/dart_entry.h" | 14 #include "vm/dart_entry.h" |
| 15 #include "vm/debuginfo.h" | 15 #include "vm/debuginfo.h" |
| 16 #include "vm/exceptions.h" | 16 #include "vm/exceptions.h" |
| 17 #include "vm/flags.h" |
| 17 #include "vm/growable_array.h" | 18 #include "vm/growable_array.h" |
| 18 #include "vm/message.h" | 19 #include "vm/message.h" |
| 19 #include "vm/native_entry.h" | 20 #include "vm/native_entry.h" |
| 20 #include "vm/native_message_handler.h" | 21 #include "vm/native_message_handler.h" |
| 21 #include "vm/object.h" | 22 #include "vm/object.h" |
| 22 #include "vm/object_store.h" | 23 #include "vm/object_store.h" |
| 23 #include "vm/port.h" | 24 #include "vm/port.h" |
| 24 #include "vm/resolver.h" | 25 #include "vm/resolver.h" |
| 25 #include "vm/stack_frame.h" | 26 #include "vm/stack_frame.h" |
| 26 #include "vm/timer.h" | 27 #include "vm/timer.h" |
| 27 #include "vm/verifier.h" | 28 #include "vm/verifier.h" |
| 28 | 29 |
| 29 namespace dart { | 30 namespace dart { |
| 30 | 31 |
| 32 DECLARE_FLAG(bool, print_class_table); |
| 33 |
| 31 ThreadLocalKey Api::api_native_key_ = Thread::kUnsetThreadLocalKey; | 34 ThreadLocalKey Api::api_native_key_ = Thread::kUnsetThreadLocalKey; |
| 32 | 35 |
| 33 const char* CanonicalFunction(const char* func) { | 36 const char* CanonicalFunction(const char* func) { |
| 34 if (strncmp(func, "dart::", 6) == 0) { | 37 if (strncmp(func, "dart::", 6) == 0) { |
| 35 return func + 6; | 38 return func + 6; |
| 36 } else { | 39 } else { |
| 37 return func; | 40 return func; |
| 38 } | 41 } |
| 39 } | 42 } |
| 40 | 43 |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 | 766 |
| 764 | 767 |
| 765 DART_EXPORT Dart_Handle Dart_RunLoop() { | 768 DART_EXPORT Dart_Handle Dart_RunLoop() { |
| 766 Isolate* isolate = Isolate::Current(); | 769 Isolate* isolate = Isolate::Current(); |
| 767 DARTSCOPE(isolate); | 770 DARTSCOPE(isolate); |
| 768 const Object& obj = Object::Handle(isolate->StandardRunLoop()); | 771 const Object& obj = Object::Handle(isolate->StandardRunLoop()); |
| 769 if (obj.IsError()) { | 772 if (obj.IsError()) { |
| 770 return Api::NewLocalHandle(obj); | 773 return Api::NewLocalHandle(obj); |
| 771 } | 774 } |
| 772 ASSERT(obj.IsNull()); | 775 ASSERT(obj.IsNull()); |
| 776 if (FLAG_print_class_table) { |
| 777 isolate->class_table()->Print(); |
| 778 } |
| 773 return Api::Success(); | 779 return Api::Success(); |
| 774 } | 780 } |
| 775 | 781 |
| 776 | 782 |
| 777 static RawInstance* DeserializeMessage(void* data) { | 783 static RawInstance* DeserializeMessage(void* data) { |
| 778 // Create a snapshot object using the buffer. | 784 // Create a snapshot object using the buffer. |
| 779 const Snapshot* snapshot = Snapshot::SetupFromBuffer(data); | 785 const Snapshot* snapshot = Snapshot::SetupFromBuffer(data); |
| 780 ASSERT(snapshot->IsMessageSnapshot()); | 786 ASSERT(snapshot->IsMessageSnapshot()); |
| 781 | 787 |
| 782 // Read object back from the snapshot. | 788 // Read object back from the snapshot. |
| (...skipping 2475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3258 *buffer = NULL; | 3264 *buffer = NULL; |
| 3259 } | 3265 } |
| 3260 delete debug_region; | 3266 delete debug_region; |
| 3261 } else { | 3267 } else { |
| 3262 *buffer = NULL; | 3268 *buffer = NULL; |
| 3263 *buffer_size = 0; | 3269 *buffer_size = 0; |
| 3264 } | 3270 } |
| 3265 } | 3271 } |
| 3266 | 3272 |
| 3267 } // namespace dart | 3273 } // namespace dart |
| OLD | NEW |