Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: vm/isolate.cc

Issue 8673002: - Refactor the isolate callback mechanism to also include creation of the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 top_context_(Context::null()), 43 top_context_(Context::null()),
44 current_zone_(NULL), 44 current_zone_(NULL),
45 #if defined(DEBUG) 45 #if defined(DEBUG)
46 no_gc_scope_depth_(0), 46 no_gc_scope_depth_(0),
47 no_handle_scope_depth_(0), 47 no_handle_scope_depth_(0),
48 top_handle_scope_(NULL), 48 top_handle_scope_(NULL),
49 #endif 49 #endif
50 random_seed_(Random::kDefaultRandomSeed), 50 random_seed_(Random::kDefaultRandomSeed),
51 bigint_store_(NULL), 51 bigint_store_(NULL),
52 top_exit_frame_info_(0), 52 top_exit_frame_info_(0),
53 init_callback_data_(NULL),
54 library_tag_handler_(NULL), 53 library_tag_handler_(NULL),
55 api_state_(NULL), 54 api_state_(NULL),
56 stub_code_(NULL), 55 stub_code_(NULL),
57 code_index_table_(NULL), 56 code_index_table_(NULL),
58 long_jump_base_(NULL), 57 long_jump_base_(NULL),
59 timer_list_(), 58 timer_list_(),
60 stack_limit_(0), 59 stack_limit_(0),
61 stack_limit_on_overflow_exception_(0), 60 stack_limit_on_overflow_exception_(0),
62 ast_node_id_(AstNode::kNoId) { 61 ast_node_id_(AstNode::kNoId) {
63 } 62 }
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 if (FLAG_generate_gdb_symbols) { 215 if (FLAG_generate_gdb_symbols) {
217 DebugInfo::UnregisterAllSections(); 216 DebugInfo::UnregisterAllSections();
218 } 217 }
219 218
220 // TODO(5411455): For now just make sure there are no current isolates 219 // TODO(5411455): For now just make sure there are no current isolates
221 // as we are shutting down the isolate. 220 // as we are shutting down the isolate.
222 SetCurrent(NULL); 221 SetCurrent(NULL);
223 } 222 }
224 223
225 224
226 Dart_IsolateInitCallback Isolate::init_callback_ = NULL; 225 Dart_IsolateCreateAndInitCallback Isolate::create_init_callback_ = NULL;
227 226
228 227
229 void Isolate::SetInitCallback(Dart_IsolateInitCallback callback) { 228 void Isolate::SetCreateAndInitCallback(Dart_IsolateCreateAndInitCallback cb) {
230 init_callback_ = callback; 229 create_init_callback_ = cb;
231 } 230 }
232 231
233 232
234 Dart_IsolateInitCallback Isolate::InitCallback() { 233 Dart_IsolateCreateAndInitCallback Isolate::CreateAndInitCallback() {
235 return init_callback_; 234 return create_init_callback_;
236 } 235 }
237 236
238 237
239 void Isolate::StandardRunLoop() { 238 void Isolate::StandardRunLoop() {
240 ASSERT(long_jump_base() != NULL); 239 ASSERT(long_jump_base() != NULL);
241 ASSERT(post_message_callback() == &StandardPostMessageCallback); 240 ASSERT(post_message_callback() == &StandardPostMessageCallback);
242 ASSERT(close_port_callback() == &StandardClosePortCallback); 241 ASSERT(close_port_callback() == &StandardClosePortCallback);
243 242
244 while (active_ports() > 0) { 243 while (active_ports() > 0) {
245 ASSERT(this == Isolate::Current()); 244 ASSERT(this == Isolate::Current());
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 // Visit all objects in the code index table. 288 // Visit all objects in the code index table.
290 if (code_index_table() != NULL) { 289 if (code_index_table() != NULL) {
291 code_index_table()->VisitObjectPointers(visitor); 290 code_index_table()->VisitObjectPointers(visitor);
292 } 291 }
293 292
294 // Visit the top context which is stored in the isolate. 293 // Visit the top context which is stored in the isolate.
295 visitor->VisitPointer(reinterpret_cast<RawObject**>(&top_context_)); 294 visitor->VisitPointer(reinterpret_cast<RawObject**>(&top_context_));
296 } 295 }
297 296
298 } // namespace dart 297 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698