OLD | NEW |
1 // Copyright (c) 2014, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.h" | 5 #include "src/vm/process.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include "src/shared/assert.h" | 9 #include "src/shared/assert.h" |
10 #include "src/shared/bytecodes.h" | 10 #include "src/shared/bytecodes.h" |
11 #include "src/shared/flags.h" | 11 #include "src/shared/flags.h" |
12 #include "src/shared/names.h" | 12 #include "src/shared/names.h" |
13 #include "src/shared/selectors.h" | 13 #include "src/shared/selectors.h" |
14 | 14 |
15 #include "src/vm/event_handler.h" | 15 #include "src/vm/event_handler.h" |
16 #include "src/vm/frame.h" | 16 #include "src/vm/frame.h" |
17 #include "src/vm/heap_validator.h" | 17 #include "src/vm/heap_validator.h" |
18 #include "src/vm/mark_sweep.h" | 18 #include "src/vm/mark_sweep.h" |
19 #include "src/vm/native_interpreter.h" | 19 #include "src/vm/native_interpreter.h" |
20 #include "src/vm/natives.h" | 20 #include "src/vm/natives.h" |
21 #include "src/vm/object_memory.h" | 21 #include "src/vm/object_memory.h" |
22 #include "src/vm/port.h" | 22 #include "src/vm/port.h" |
23 #include "src/vm/process_queue.h" | 23 #include "src/vm/process_queue.h" |
24 #include "src/vm/remembered_set.h" | 24 #include "src/vm/remembered_set.h" |
25 #include "src/vm/session.h" | 25 #include "src/vm/session.h" |
26 | 26 |
27 namespace fletch { | 27 namespace dartino { |
28 | 28 |
29 static uword kPreemptMarker = 1 << 0; | 29 static uword kPreemptMarker = 1 << 0; |
30 static uword kDebugInterruptMarker = 1 << 1; | 30 static uword kDebugInterruptMarker = 1 << 1; |
31 static uword kMaxStackMarker = ~static_cast<uword>((1 << 2) - 1); | 31 static uword kMaxStackMarker = ~static_cast<uword>((1 << 2) - 1); |
32 | 32 |
33 Process::Process(Program* program, Process* parent) | 33 Process::Process(Program* program, Process* parent) |
34 : native_stack_(NULL), | 34 : native_stack_(NULL), |
35 coroutine_(NULL), | 35 coroutine_(NULL), |
36 stack_limit_(0), | 36 stack_limit_(0), |
37 program_(program), | 37 program_(program), |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 } | 199 } |
200 | 200 |
201 Object* Process::NewArray(int length) { | 201 Object* Process::NewArray(int length) { |
202 RegisterProcessAllocation(); | 202 RegisterProcessAllocation(); |
203 Class* array_class = program()->array_class(); | 203 Class* array_class = program()->array_class(); |
204 Object* null = program()->null_object(); | 204 Object* null = program()->null_object(); |
205 Object* result = heap()->CreateArray(array_class, length, null); | 205 Object* result = heap()->CreateArray(array_class, length, null); |
206 return result; | 206 return result; |
207 } | 207 } |
208 | 208 |
209 Object* Process::NewDouble(fletch_double value) { | 209 Object* Process::NewDouble(dartino_double value) { |
210 RegisterProcessAllocation(); | 210 RegisterProcessAllocation(); |
211 Class* double_class = program()->double_class(); | 211 Class* double_class = program()->double_class(); |
212 Object* result = heap()->CreateDouble(double_class, value); | 212 Object* result = heap()->CreateDouble(double_class, value); |
213 return result; | 213 return result; |
214 } | 214 } |
215 | 215 |
216 Object* Process::NewInteger(int64 value) { | 216 Object* Process::NewInteger(int64 value) { |
217 RegisterProcessAllocation(); | 217 RegisterProcessAllocation(); |
218 Class* large_integer_class = program()->large_integer_class(); | 218 Class* large_integer_class = program()->large_integer_class(); |
219 Object* result = | 219 Object* result = |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 while (queue != NULL) { | 633 while (queue != NULL) { |
634 Instance* channel = queue->port()->channel(); | 634 Instance* channel = queue->port()->channel(); |
635 if (channel != NULL) return channel; | 635 if (channel != NULL) return channel; |
636 mailbox->AdvanceCurrentMessage(); | 636 mailbox->AdvanceCurrentMessage(); |
637 queue = mailbox->CurrentMessage(); | 637 queue = mailbox->CurrentMessage(); |
638 } | 638 } |
639 return process->program()->null_object(); | 639 return process->program()->null_object(); |
640 } | 640 } |
641 END_NATIVE() | 641 END_NATIVE() |
642 | 642 |
643 } // namespace fletch | 643 } // namespace dartino |
OLD | NEW |