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 "platform/assert.h" | 5 #include "platform/assert.h" |
6 #include "vm/bootstrap_natives.h" | 6 #include "vm/bootstrap_natives.h" |
7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
8 #include "vm/dart.h" | 8 #include "vm/dart.h" |
9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 char* chars = reinterpret_cast<char*>( | 251 char* chars = reinterpret_cast<char*>( |
252 Isolate::Current()->current_zone()->Allocate(len)); | 252 Isolate::Current()->current_zone()->Allocate(len)); |
253 OS::SNPrint(chars, len, kFormat, script_name, class_name, func_name); | 253 OS::SNPrint(chars, len, kFormat, script_name, class_name, func_name); |
254 return chars; | 254 return chars; |
255 } | 255 } |
256 | 256 |
257 | 257 |
258 DEFINE_NATIVE_ENTRY(IsolateNatives_start, 2) { | 258 DEFINE_NATIVE_ENTRY(IsolateNatives_start, 2) { |
259 Isolate* preserved_isolate = Isolate::Current(); | 259 Isolate* preserved_isolate = Isolate::Current(); |
260 GET_NATIVE_ARGUMENT(Instance, runnable, arguments->At(0)); | 260 GET_NATIVE_ARGUMENT(Instance, runnable, arguments->At(0)); |
| 261 // arguments->At(1) unused. |
261 const Class& runnable_class = Class::Handle(runnable.clazz()); | 262 const Class& runnable_class = Class::Handle(runnable.clazz()); |
262 const char* class_name = String::Handle(runnable_class.Name()).ToCString(); | 263 const char* class_name = String::Handle(runnable_class.Name()).ToCString(); |
263 const Library& library = Library::Handle(runnable_class.library()); | 264 const Library& library = Library::Handle(runnable_class.library()); |
264 ASSERT(!library.IsNull()); | 265 ASSERT(!library.IsNull()); |
265 const char* library_url = String::Handle(library.url()).ToCString(); | 266 const char* library_url = String::Handle(library.url()).ToCString(); |
266 intptr_t port_id = 0; | 267 intptr_t port_id = 0; |
267 LongJump jump; | 268 LongJump jump; |
268 bool init_successful = true; | 269 bool init_successful = true; |
269 Isolate* spawned_isolate = NULL; | 270 Isolate* spawned_isolate = NULL; |
270 void* callback_data = preserved_isolate->init_callback_data(); | 271 void* callback_data = preserved_isolate->init_callback_data(); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 // TODO(iposva): Allow for arbitrary messages to be sent. | 353 // TODO(iposva): Allow for arbitrary messages to be sent. |
353 GET_NATIVE_ARGUMENT(Instance, obj, arguments->At(2)); | 354 GET_NATIVE_ARGUMENT(Instance, obj, arguments->At(2)); |
354 uint8_t* data = SerializeObject(obj); | 355 uint8_t* data = SerializeObject(obj); |
355 | 356 |
356 // TODO(turnidge): Throw an exception when the return value is false? | 357 // TODO(turnidge): Throw an exception when the return value is false? |
357 PortMap::PostMessage(new Message( | 358 PortMap::PostMessage(new Message( |
358 send_id.Value(), reply_id.Value(), data, Message::kNormalPriority)); | 359 send_id.Value(), reply_id.Value(), data, Message::kNormalPriority)); |
359 } | 360 } |
360 | 361 |
361 } // namespace dart | 362 } // namespace dart |
OLD | NEW |