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" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 top_exit_frame_info_(0), | 55 top_exit_frame_info_(0), |
56 init_callback_data_(NULL), | 56 init_callback_data_(NULL), |
57 library_tag_handler_(NULL), | 57 library_tag_handler_(NULL), |
58 api_state_(NULL), | 58 api_state_(NULL), |
59 stub_code_(NULL), | 59 stub_code_(NULL), |
60 code_index_table_(NULL), | 60 code_index_table_(NULL), |
61 debugger_(NULL), | 61 debugger_(NULL), |
62 long_jump_base_(NULL), | 62 long_jump_base_(NULL), |
63 timer_list_(), | 63 timer_list_(), |
64 stack_limit_(0), | 64 stack_limit_(0), |
65 stack_limit_on_overflow_exception_(0), | |
66 ast_node_id_(AstNode::kNoId) { | 65 ast_node_id_(AstNode::kNoId) { |
67 } | 66 } |
68 | 67 |
69 | 68 |
70 Isolate::~Isolate() { | 69 Isolate::~Isolate() { |
71 delete message_queue_; | 70 delete message_queue_; |
72 delete heap_; | 71 delete heap_; |
73 delete object_store_; | 72 delete object_store_; |
74 // Do not delete stack resources: top_resource_ and current_zone_. | 73 // Do not delete stack resources: top_resource_ and current_zone_. |
75 delete bigint_store_; | 74 delete bigint_store_; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 } | 144 } |
146 | 145 |
147 | 146 |
148 void Isolate::SetStackLimitFromCurrentTOS(uword stack_top_value) { | 147 void Isolate::SetStackLimitFromCurrentTOS(uword stack_top_value) { |
149 SetStackLimit(stack_top_value - GetSpecifiedStackSize()); | 148 SetStackLimit(stack_top_value - GetSpecifiedStackSize()); |
150 } | 149 } |
151 | 150 |
152 | 151 |
153 void Isolate::SetStackLimit(uword limit) { | 152 void Isolate::SetStackLimit(uword limit) { |
154 stack_limit_ = limit; | 153 stack_limit_ = limit; |
155 stack_limit_on_overflow_exception_ = limit - kStackSizeBuffer; | |
156 } | 154 } |
157 | 155 |
158 | 156 |
159 static int MostCalledFunctionFirst(const Function* const* a, | 157 static int MostCalledFunctionFirst(const Function* const* a, |
160 const Function* const* b) { | 158 const Function* const* b) { |
161 if ((*a)->invocation_counter() > (*b)->invocation_counter()) { | 159 if ((*a)->invocation_counter() > (*b)->invocation_counter()) { |
162 return -1; | 160 return -1; |
163 } else if ((*a)->invocation_counter() < (*b)->invocation_counter()) { | 161 } else if ((*a)->invocation_counter() < (*b)->invocation_counter()) { |
164 return 1; | 162 return 1; |
165 } else { | 163 } else { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 } | 303 } |
306 | 304 |
307 // Visit the top context which is stored in the isolate. | 305 // Visit the top context which is stored in the isolate. |
308 visitor->VisitPointer(reinterpret_cast<RawObject**>(&top_context_)); | 306 visitor->VisitPointer(reinterpret_cast<RawObject**>(&top_context_)); |
309 | 307 |
310 // Visit objects in the debugger. | 308 // Visit objects in the debugger. |
311 debugger()->VisitObjectPointers(visitor); | 309 debugger()->VisitObjectPointers(visitor); |
312 } | 310 } |
313 | 311 |
314 } // namespace dart | 312 } // namespace dart |
OLD | NEW |