| 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 "vm/isolate.h" | 5 #include "vm/isolate.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/bigint_store.h" | |
| 10 #include "vm/code_index_table.h" | 9 #include "vm/code_index_table.h" |
| 11 #include "vm/compiler_stats.h" | 10 #include "vm/compiler_stats.h" |
| 12 #include "vm/dart_api_state.h" | 11 #include "vm/dart_api_state.h" |
| 13 #include "vm/dart_entry.h" | 12 #include "vm/dart_entry.h" |
| 14 #include "vm/debugger.h" | 13 #include "vm/debugger.h" |
| 15 #include "vm/debuginfo.h" | 14 #include "vm/debuginfo.h" |
| 16 #include "vm/heap.h" | 15 #include "vm/heap.h" |
| 17 #include "vm/message.h" | 16 #include "vm/message.h" |
| 18 #include "vm/object_store.h" | 17 #include "vm/object_store.h" |
| 19 #include "vm/parser.h" | 18 #include "vm/parser.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 object_store_(NULL), | 93 object_store_(NULL), |
| 95 top_resource_(NULL), | 94 top_resource_(NULL), |
| 96 top_context_(Context::null()), | 95 top_context_(Context::null()), |
| 97 current_zone_(NULL), | 96 current_zone_(NULL), |
| 98 #if defined(DEBUG) | 97 #if defined(DEBUG) |
| 99 no_gc_scope_depth_(0), | 98 no_gc_scope_depth_(0), |
| 100 no_handle_scope_depth_(0), | 99 no_handle_scope_depth_(0), |
| 101 top_handle_scope_(NULL), | 100 top_handle_scope_(NULL), |
| 102 #endif | 101 #endif |
| 103 random_seed_(Random::kDefaultRandomSeed), | 102 random_seed_(Random::kDefaultRandomSeed), |
| 104 bigint_store_(NULL), | |
| 105 top_exit_frame_info_(0), | 103 top_exit_frame_info_(0), |
| 106 init_callback_data_(NULL), | 104 init_callback_data_(NULL), |
| 107 library_tag_handler_(NULL), | 105 library_tag_handler_(NULL), |
| 108 api_state_(NULL), | 106 api_state_(NULL), |
| 109 stub_code_(NULL), | 107 stub_code_(NULL), |
| 110 code_index_table_(NULL), | 108 code_index_table_(NULL), |
| 111 debugger_(NULL), | 109 debugger_(NULL), |
| 112 long_jump_base_(NULL), | 110 long_jump_base_(NULL), |
| 113 timer_list_(), | 111 timer_list_(), |
| 114 ast_node_id_(AstNode::kNoId), | 112 ast_node_id_(AstNode::kNoId), |
| 115 mutex_(new Mutex()), | 113 mutex_(new Mutex()), |
| 116 stack_limit_(0), | 114 stack_limit_(0), |
| 117 saved_stack_limit_(0) { | 115 saved_stack_limit_(0) { |
| 118 } | 116 } |
| 119 | 117 |
| 120 | 118 |
| 121 Isolate::~Isolate() { | 119 Isolate::~Isolate() { |
| 122 delete [] name_; | 120 delete [] name_; |
| 123 delete heap_; | 121 delete heap_; |
| 124 delete object_store_; | 122 delete object_store_; |
| 125 // Do not delete stack resources: top_resource_ and current_zone_. | 123 // Do not delete stack resources: top_resource_ and current_zone_. |
| 126 delete bigint_store_; | |
| 127 delete api_state_; | 124 delete api_state_; |
| 128 delete stub_code_; | 125 delete stub_code_; |
| 129 delete code_index_table_; | 126 delete code_index_table_; |
| 130 delete debugger_; | 127 delete debugger_; |
| 131 delete mutex_; | 128 delete mutex_; |
| 132 mutex_ = NULL; // Fail fast if interrupts are scheduled on a dead isolate. | 129 mutex_ = NULL; // Fail fast if interrupts are scheduled on a dead isolate. |
| 133 delete message_handler_; | 130 delete message_handler_; |
| 134 message_handler_ = NULL; // Fail fast if we send messages to a dead isolate. | 131 message_handler_ = NULL; // Fail fast if we send messages to a dead isolate. |
| 135 } | 132 } |
| 136 | 133 |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 } | 461 } |
| 465 | 462 |
| 466 | 463 |
| 467 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor) { | 464 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor) { |
| 468 if (api_state() != NULL) { | 465 if (api_state() != NULL) { |
| 469 api_state()->VisitWeakHandles(visitor); | 466 api_state()->VisitWeakHandles(visitor); |
| 470 } | 467 } |
| 471 } | 468 } |
| 472 | 469 |
| 473 } // namespace dart | 470 } // namespace dart |
| OLD | NEW |