| OLD | NEW |
| 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 #include "src/vm/process_handle.h" | 5 #include "src/vm/process_handle.h" |
| 6 | 6 |
| 7 #include "src/vm/heap.h" | 7 #include "src/vm/heap.h" |
| 8 #include "src/vm/natives.h" | 8 #include "src/vm/natives.h" |
| 9 #include "src/vm/object.h" | 9 #include "src/vm/object.h" |
| 10 #include "src/vm/process.h" | 10 #include "src/vm/process.h" |
| 11 #include "src/vm/scheduler.h" | 11 #include "src/vm/scheduler.h" |
| 12 #include "src/vm/spinlock.h" | 12 #include "src/vm/spinlock.h" |
| 13 | 13 |
| 14 namespace fletch { | 14 namespace dartino { |
| 15 | 15 |
| 16 ProcessHandle* ProcessHandle::FromDartObject(Object* o) { | 16 ProcessHandle* ProcessHandle::FromDartObject(Object* o) { |
| 17 Instance* dart_pid = Instance::cast(o); | 17 Instance* dart_pid = Instance::cast(o); |
| 18 uword handle_address = Smi::cast(dart_pid->GetInstanceField(0))->value() << 2; | 18 uword handle_address = Smi::cast(dart_pid->GetInstanceField(0))->value() << 2; |
| 19 return reinterpret_cast<ProcessHandle*>(handle_address); | 19 return reinterpret_cast<ProcessHandle*>(handle_address); |
| 20 } | 20 } |
| 21 | 21 |
| 22 void ProcessHandle::InitializeDartObject(Object* o) { | 22 void ProcessHandle::InitializeDartObject(Object* o) { |
| 23 Instance* dart_pid = Instance::cast(o); | 23 Instance* dart_pid = Instance::cast(o); |
| 24 uword address = reinterpret_cast<uword>(this); | 24 uword address = reinterpret_cast<uword>(this); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 handle_process->SendSignal(signal); | 108 handle_process->SendSignal(signal); |
| 109 process->program()->scheduler()->SignalProcess(handle_process); | 109 process->program()->scheduler()->SignalProcess(handle_process); |
| 110 } else { | 110 } else { |
| 111 delete signal; | 111 delete signal; |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 return process->program()->null_object(); | 114 return process->program()->null_object(); |
| 115 } | 115 } |
| 116 END_NATIVE() | 116 END_NATIVE() |
| 117 | 117 |
| 118 } // namespace fletch | 118 } // namespace dartino |
| OLD | NEW |