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

Side by Side Diff: runtime/vm/dart.cc

Issue 2224543002: Revert "Clear isolate callback data before running shutdowncallback" (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/dart.h" 5 #include "vm/dart.h"
6 6
7 #include "vm/become.h" 7 #include "vm/become.h"
8 #include "vm/clustered_snapshot.h" 8 #include "vm/clustered_snapshot.h"
9 #include "vm/code_observers.h" 9 #include "vm/code_observers.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 #endif 662 #endif
663 } 663 }
664 664
665 return buffer.Steal(); 665 return buffer.Steal();
666 } 666 }
667 667
668 668
669 void Dart::RunShutdownCallback() { 669 void Dart::RunShutdownCallback() {
670 Isolate* isolate = Isolate::Current(); 670 Isolate* isolate = Isolate::Current();
671 void* callback_data = isolate->init_callback_data(); 671 void* callback_data = isolate->init_callback_data();
672 // Clear the data from the isolate so future accesses will see NULL.
673 isolate->set_init_callback_data(NULL);
674 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback(); 672 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback();
675 if (callback != NULL) { 673 if (callback != NULL) {
676 (callback)(callback_data); 674 (callback)(callback_data);
677 } 675 }
678 } 676 }
679 677
680 678
681 void Dart::ShutdownIsolate(Isolate* isolate) { 679 void Dart::ShutdownIsolate(Isolate* isolate) {
682 ASSERT(Isolate::Current() == NULL); 680 ASSERT(Isolate::Current() == NULL);
683 // We need to enter the isolate in order to shut it down. 681 // We need to enter the isolate in order to shut it down.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 return predefined_handles_->handles_.IsValidScopedHandle(address); 720 return predefined_handles_->handles_.IsValidScopedHandle(address);
723 } 721 }
724 722
725 723
726 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { 724 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) {
727 ASSERT(predefined_handles_ != NULL); 725 ASSERT(predefined_handles_ != NULL);
728 return predefined_handles_->api_handles_.IsValidHandle(handle); 726 return predefined_handles_->api_handles_.IsValidHandle(handle);
729 } 727 }
730 728
731 } // namespace dart 729 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698