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_native_api.h" | 5 #include "include/dart_native_api.h" |
6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
7 #include "vm/bootstrap_natives.h" | 7 #include "vm/bootstrap_natives.h" |
8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
9 #include "vm/dart.h" | 9 #include "vm/dart.h" |
10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 GET_NON_NULL_NATIVE_ARGUMENT(Instance, message, arguments->NativeArgAt(3)); | 219 GET_NON_NULL_NATIVE_ARGUMENT(Instance, message, arguments->NativeArgAt(3)); |
220 GET_NON_NULL_NATIVE_ARGUMENT(Bool, paused, arguments->NativeArgAt(4)); | 220 GET_NON_NULL_NATIVE_ARGUMENT(Bool, paused, arguments->NativeArgAt(4)); |
221 GET_NATIVE_ARGUMENT(Bool, fatalErrors, arguments->NativeArgAt(5)); | 221 GET_NATIVE_ARGUMENT(Bool, fatalErrors, arguments->NativeArgAt(5)); |
222 GET_NATIVE_ARGUMENT(SendPort, onExit, arguments->NativeArgAt(6)); | 222 GET_NATIVE_ARGUMENT(SendPort, onExit, arguments->NativeArgAt(6)); |
223 GET_NATIVE_ARGUMENT(SendPort, onError, arguments->NativeArgAt(7)); | 223 GET_NATIVE_ARGUMENT(SendPort, onError, arguments->NativeArgAt(7)); |
224 GET_NATIVE_ARGUMENT(String, packageRoot, arguments->NativeArgAt(8)); | 224 GET_NATIVE_ARGUMENT(String, packageRoot, arguments->NativeArgAt(8)); |
225 GET_NATIVE_ARGUMENT(String, packageConfig, arguments->NativeArgAt(9)); | 225 GET_NATIVE_ARGUMENT(String, packageConfig, arguments->NativeArgAt(9)); |
226 | 226 |
227 if (closure.IsClosure()) { | 227 if (closure.IsClosure()) { |
228 Function& func = Function::Handle(); | 228 Function& func = Function::Handle(); |
229 func = Closure::function(closure); | 229 func = Closure::Cast(closure).function(); |
230 if (func.IsImplicitClosureFunction() && func.is_static()) { | 230 if (func.IsImplicitClosureFunction() && func.is_static()) { |
231 #if defined(DEBUG) | 231 #if defined(DEBUG) |
232 Context& ctx = Context::Handle(); | 232 Context& ctx = Context::Handle(); |
233 ctx = Closure::context(closure); | 233 ctx = Closure::Cast(closure).context(); |
234 ASSERT(ctx.num_variables() == 0); | 234 ASSERT(ctx.num_variables() == 0); |
235 #endif | 235 #endif |
236 // Get the parent function so that we get the right function name. | 236 // Get the parent function so that we get the right function name. |
237 func = func.parent_function(); | 237 func = func.parent_function(); |
238 | 238 |
239 const char* utf8_package_root = | 239 const char* utf8_package_root = |
240 packageRoot.IsNull() ? NULL : String2UTF8(packageRoot); | 240 packageRoot.IsNull() ? NULL : String2UTF8(packageRoot); |
241 const char* utf8_package_config = | 241 const char* utf8_package_config = |
242 packageConfig.IsNull() ? NULL : String2UTF8(packageConfig); | 242 packageConfig.IsNull() ? NULL : String2UTF8(packageConfig); |
243 | 243 |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 MessageWriter writer(&data, &allocator, false); | 445 MessageWriter writer(&data, &allocator, false); |
446 writer.WriteMessage(msg); | 446 writer.WriteMessage(msg); |
447 | 447 |
448 PortMap::PostMessage(new Message(port.Id(), | 448 PortMap::PostMessage(new Message(port.Id(), |
449 data, writer.BytesWritten(), | 449 data, writer.BytesWritten(), |
450 Message::kOOBPriority)); | 450 Message::kOOBPriority)); |
451 return Object::null(); | 451 return Object::null(); |
452 } | 452 } |
453 | 453 |
454 } // namespace dart | 454 } // namespace dart |
OLD | NEW |