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 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 if (isolate == NULL) { | 946 if (isolate == NULL) { |
947 FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC); | 947 FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC); |
948 } | 948 } |
949 Isolate* iso = reinterpret_cast<Isolate*>(isolate); | 949 Isolate* iso = reinterpret_cast<Isolate*>(isolate); |
950 iso->ScheduleInterrupts(Isolate::kApiInterrupt); | 950 iso->ScheduleInterrupts(Isolate::kApiInterrupt); |
951 } | 951 } |
952 | 952 |
953 | 953 |
954 // --- Messages and Ports --- | 954 // --- Messages and Ports --- |
955 | 955 |
956 | |
957 DART_EXPORT void Dart_SetMessageNotifyCallback( | 956 DART_EXPORT void Dart_SetMessageNotifyCallback( |
958 Dart_MessageNotifyCallback message_notify_callback) { | 957 Dart_MessageNotifyCallback message_notify_callback) { |
959 Isolate* isolate = Isolate::Current(); | 958 Isolate* isolate = Isolate::Current(); |
960 CHECK_ISOLATE(isolate); | 959 CHECK_ISOLATE(isolate); |
961 isolate->set_message_notify_callback(message_notify_callback); | 960 isolate->set_message_notify_callback(message_notify_callback); |
962 } | 961 } |
963 | 962 |
964 | 963 |
965 struct RunLoopData { | 964 struct RunLoopData { |
966 Monitor* monitor; | 965 Monitor* monitor; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 | 1074 |
1076 DART_EXPORT Dart_Port Dart_NewNativePort(const char* name, | 1075 DART_EXPORT Dart_Port Dart_NewNativePort(const char* name, |
1077 Dart_NativeMessageHandler handler, | 1076 Dart_NativeMessageHandler handler, |
1078 bool handle_concurrently) { | 1077 bool handle_concurrently) { |
1079 if (name == NULL) { | 1078 if (name == NULL) { |
1080 name = "<UnnamedNativePort>"; | 1079 name = "<UnnamedNativePort>"; |
1081 } | 1080 } |
1082 if (handler == NULL) { | 1081 if (handler == NULL) { |
1083 OS::PrintErr("%s expects argument 'handler' to be non-null.\n", | 1082 OS::PrintErr("%s expects argument 'handler' to be non-null.\n", |
1084 CURRENT_FUNC); | 1083 CURRENT_FUNC); |
1085 return kIllegalPort; | 1084 return ILLEGAL_PORT; |
1086 } | 1085 } |
1087 // Start the native port without a current isolate. | 1086 // Start the native port without a current isolate. |
1088 IsolateSaver saver(Isolate::Current()); | 1087 IsolateSaver saver(Isolate::Current()); |
1089 Isolate::SetCurrent(NULL); | 1088 Isolate::SetCurrent(NULL); |
1090 | 1089 |
1091 NativeMessageHandler* nmh = new NativeMessageHandler(name, handler); | 1090 NativeMessageHandler* nmh = new NativeMessageHandler(name, handler); |
1092 Dart_Port port_id = PortMap::CreatePort(nmh); | 1091 Dart_Port port_id = PortMap::CreatePort(nmh); |
1093 nmh->Run(Dart::thread_pool(), NULL, NULL, 0); | 1092 nmh->Run(Dart::thread_pool(), NULL, NULL, 0); |
1094 return port_id; | 1093 return port_id; |
1095 } | 1094 } |
(...skipping 3072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4168 *buffer_size = 0; | 4167 *buffer_size = 0; |
4169 } | 4168 } |
4170 } | 4169 } |
4171 | 4170 |
4172 | 4171 |
4173 DART_EXPORT void Dart_InitFlowGraphPrinting(FileWriterFunction function) { | 4172 DART_EXPORT void Dart_InitFlowGraphPrinting(FileWriterFunction function) { |
4174 Dart::set_flow_graph_writer(function); | 4173 Dart::set_flow_graph_writer(function); |
4175 } | 4174 } |
4176 | 4175 |
4177 } // namespace dart | 4176 } // namespace dart |
OLD | NEW |