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

Side by Side Diff: vm/isolate.cc

Issue 11026011: Add isolate event handler setup in order to be able to propagate isolate (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 2 months 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
« vm/debugger.h ('K') | « vm/debugger_api_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "lib/mirrors.h" 9 #include "lib/mirrors.h"
10 #include "vm/compiler_stats.h" 10 #include "vm/compiler_stats.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 result->set_api_state(state); 227 result->set_api_state(state);
228 228
229 // Initialize stack top and limit in case we are running the isolate in the 229 // Initialize stack top and limit in case we are running the isolate in the
230 // main thread. 230 // main thread.
231 // TODO(5411455): Need to figure out how to set the stack limit for the 231 // TODO(5411455): Need to figure out how to set the stack limit for the
232 // main thread. 232 // main thread.
233 result->SetStackLimitFromCurrentTOS(reinterpret_cast<uword>(&result)); 233 result->SetStackLimitFromCurrentTOS(reinterpret_cast<uword>(&result));
234 result->set_main_port(PortMap::CreatePort(result->message_handler())); 234 result->set_main_port(PortMap::CreatePort(result->message_handler()));
235 result->BuildName(name_prefix); 235 result->BuildName(name_prefix);
236 236
237 // Signal isolate creation event.
238 Debugger::SignalIsolateEvent(Debugger::kIsolateCreated);
239
237 result->debugger_ = new Debugger(); 240 result->debugger_ = new Debugger();
238 result->debugger_->Initialize(result); 241 result->debugger_->Initialize(result);
239 if (FLAG_trace_isolates) { 242 if (FLAG_trace_isolates) {
240 if (name_prefix == NULL || strcmp(name_prefix, "vm-isolate") != 0) { 243 if (name_prefix == NULL || strcmp(name_prefix, "vm-isolate") != 0) {
241 OS::Print("[+] Starting isolate:\n" 244 OS::Print("[+] Starting isolate:\n"
242 "\tisolate: %s\n", result->name()); 245 "\tisolate: %s\n", result->name());
243 } 246 }
244 } 247 }
245 return result; 248 return result;
246 } 249 }
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 407
405 // Clean up debugger resources. Shutting down the debugger 408 // Clean up debugger resources. Shutting down the debugger
406 // requires a handle zone. We must set up a temporary zone because 409 // requires a handle zone. We must set up a temporary zone because
407 // Isolate::Shutdown is called without a zone. 410 // Isolate::Shutdown is called without a zone.
408 { 411 {
409 Zone zone(this); 412 Zone zone(this);
410 HandleScope handle_scope(this); 413 HandleScope handle_scope(this);
411 debugger_->Shutdown(); 414 debugger_->Shutdown();
412 } 415 }
413 416
417 // Signal isolate shutdown event.
418 Debugger::SignalIsolateEvent(Debugger::kIsolateShutdown);
419
414 // Close all the ports owned by this isolate. 420 // Close all the ports owned by this isolate.
415 PortMap::ClosePorts(message_handler()); 421 PortMap::ClosePorts(message_handler());
416 422
417 // Fail fast if anybody tries to post any more messsages to this isolate. 423 // Fail fast if anybody tries to post any more messsages to this isolate.
418 delete message_handler(); 424 delete message_handler();
419 set_message_handler(NULL); 425 set_message_handler(NULL);
420 426
421 // Finalize any weak persistent handles with a non-null referent. 427 // Finalize any weak persistent handles with a non-null referent.
422 FinalizeWeakPersistentHandlesVisitor visitor; 428 FinalizeWeakPersistentHandlesVisitor visitor;
423 api_state()->weak_persistent_handles().VisitHandles(&visitor); 429 api_state()->weak_persistent_handles().VisitHandles(&visitor);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 497
492 498
493 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor, 499 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor,
494 bool visit_prologue_weak_handles) { 500 bool visit_prologue_weak_handles) {
495 if (api_state() != NULL) { 501 if (api_state() != NULL) {
496 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles); 502 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles);
497 } 503 }
498 } 504 }
499 505
500 } // namespace dart 506 } // namespace dart
OLDNEW
« vm/debugger.h ('K') | « vm/debugger_api_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698