OLD | NEW |
---|---|
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "vm/isolate.h" | 5 #include "vm/isolate.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 | 8 |
9 #include "vm/assert.h" | 9 #include "vm/assert.h" |
10 #include "vm/bigint_store.h" | 10 #include "vm/bigint_store.h" |
11 #include "vm/code_index_table.h" | 11 #include "vm/code_index_table.h" |
12 #include "vm/compiler_stats.h" | 12 #include "vm/compiler_stats.h" |
13 #include "vm/dart_api_state.h" | 13 #include "vm/dart_api_state.h" |
14 #include "vm/debugger.h" | |
14 #include "vm/debuginfo.h" | 15 #include "vm/debuginfo.h" |
15 #include "vm/heap.h" | 16 #include "vm/heap.h" |
16 #include "vm/message_queue.h" | 17 #include "vm/message_queue.h" |
17 #include "vm/object_store.h" | 18 #include "vm/object_store.h" |
18 #include "vm/parser.h" | 19 #include "vm/parser.h" |
19 #include "vm/port.h" | 20 #include "vm/port.h" |
20 #include "vm/random.h" | 21 #include "vm/random.h" |
21 #include "vm/stack_frame.h" | 22 #include "vm/stack_frame.h" |
22 #include "vm/stub_code.h" | 23 #include "vm/stub_code.h" |
23 #include "vm/thread.h" | 24 #include "vm/thread.h" |
(...skipping 24 matching lines...) Expand all Loading... | |
48 top_handle_scope_(NULL), | 49 top_handle_scope_(NULL), |
49 #endif | 50 #endif |
50 random_seed_(Random::kDefaultRandomSeed), | 51 random_seed_(Random::kDefaultRandomSeed), |
51 bigint_store_(NULL), | 52 bigint_store_(NULL), |
52 top_exit_frame_info_(0), | 53 top_exit_frame_info_(0), |
53 init_callback_data_(NULL), | 54 init_callback_data_(NULL), |
54 library_tag_handler_(NULL), | 55 library_tag_handler_(NULL), |
55 api_state_(NULL), | 56 api_state_(NULL), |
56 stub_code_(NULL), | 57 stub_code_(NULL), |
57 code_index_table_(NULL), | 58 code_index_table_(NULL), |
59 debugger_(NULL), | |
58 long_jump_base_(NULL), | 60 long_jump_base_(NULL), |
59 timer_list_(), | 61 timer_list_(), |
60 stack_limit_(0), | 62 stack_limit_(0), |
61 stack_limit_on_overflow_exception_(0), | 63 stack_limit_on_overflow_exception_(0), |
62 ast_node_id_(AstNode::kNoId) { | 64 ast_node_id_(AstNode::kNoId) { |
63 } | 65 } |
64 | 66 |
65 | 67 |
66 Isolate::~Isolate() { | 68 Isolate::~Isolate() { |
67 delete message_queue_; | 69 delete message_queue_; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 ApiState* state = new ApiState(); | 121 ApiState* state = new ApiState(); |
120 ASSERT(state != NULL); | 122 ASSERT(state != NULL); |
121 result->set_api_state(state); | 123 result->set_api_state(state); |
122 | 124 |
123 // Initialize stack top and limit in case we are running the isolate in the | 125 // Initialize stack top and limit in case we are running the isolate in the |
124 // main thread. | 126 // main thread. |
125 // TODO(5411455): Need to figure out how to set the stack limit for the | 127 // TODO(5411455): Need to figure out how to set the stack limit for the |
126 // main thread. | 128 // main thread. |
127 result->SetStackLimitFromCurrentTOS(reinterpret_cast<uword>(&result)); | 129 result->SetStackLimitFromCurrentTOS(reinterpret_cast<uword>(&result)); |
128 | 130 |
131 result->debugger_ = new Debugger(); | |
132 | |
129 return result; | 133 return result; |
130 } | 134 } |
131 | 135 |
132 | 136 |
133 // TODO(5411455): Use flag to override default value and Validate the | 137 // TODO(5411455): Use flag to override default value and Validate the |
134 // stack size by querying OS. | 138 // stack size by querying OS. |
135 uword Isolate::GetSpecifiedStackSize() { | 139 uword Isolate::GetSpecifiedStackSize() { |
136 uword stack_size = Isolate::kDefaultStackSize - Isolate::kStackSizeBuffer; | 140 uword stack_size = Isolate::kDefaultStackSize - Isolate::kStackSizeBuffer; |
137 return stack_size; | 141 return stack_size; |
138 } | 142 } |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
286 api_state()->VisitObjectPointers(visitor); | 290 api_state()->VisitObjectPointers(visitor); |
287 } | 291 } |
288 | 292 |
289 // Visit all objects in the code index table. | 293 // Visit all objects in the code index table. |
290 if (code_index_table() != NULL) { | 294 if (code_index_table() != NULL) { |
291 code_index_table()->VisitObjectPointers(visitor); | 295 code_index_table()->VisitObjectPointers(visitor); |
292 } | 296 } |
293 | 297 |
294 // Visit the top context which is stored in the isolate. | 298 // Visit the top context which is stored in the isolate. |
295 visitor->VisitPointer(reinterpret_cast<RawObject**>(&top_context_)); | 299 visitor->VisitPointer(reinterpret_cast<RawObject**>(&top_context_)); |
300 | |
siva
2011/11/30 00:00:47
// Visit objects in the debugger.
hausner
2011/11/30 01:17:05
Done.
| |
301 debugger()->VisitObjectPointers(visitor); | |
296 } | 302 } |
297 | 303 |
298 } // namespace dart | 304 } // namespace dart |
OLD | NEW |