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

Unified Diff: runtime/vm/isolate.h

Issue 1427583009: 1. Get rid of SwitchIsolateScope as it is not clear when this should be used and there is also a bu… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.h
diff --git a/runtime/vm/isolate.h b/runtime/vm/isolate.h
index 35ca9e4867e6e9d549a6e6d04ed8235bb86004ad..5d5762c4dbeec5519d6daeca198573267d0c716e 100644
--- a/runtime/vm/isolate.h
+++ b/runtime/vm/isolate.h
@@ -923,48 +923,6 @@ class StartIsolateScope {
DISALLOW_COPY_AND_ASSIGN(StartIsolateScope);
};
-// When we need to temporarily become another isolate, we use the
-// SwitchIsolateScope. It is not permitted to run dart code while in
-// a SwitchIsolateScope.
-class SwitchIsolateScope {
- public:
- explicit SwitchIsolateScope(Isolate* new_isolate)
- : new_isolate_(new_isolate),
- saved_isolate_(Isolate::Current()),
- saved_stack_limit_(saved_isolate_
- ? saved_isolate_->saved_stack_limit() : 0) {
- // TODO(koda): Audit users; why would these two ever be equal?
- if (saved_isolate_ != new_isolate_) {
- if (new_isolate_ == NULL) {
- Thread::ExitIsolate();
- } else {
- Thread::EnterIsolate(new_isolate_);
- // Don't allow dart code to execute.
- new_isolate_->SetStackLimit(~static_cast<uword>(0));
- }
- }
- }
-
- ~SwitchIsolateScope() {
- if (saved_isolate_ != new_isolate_) {
- if (new_isolate_ != NULL) {
- Thread::ExitIsolate();
- }
- if (saved_isolate_ != NULL) {
- Thread::EnterIsolate(saved_isolate_);
- saved_isolate_->SetStackLimit(saved_stack_limit_);
- }
- }
- }
-
- private:
- Isolate* new_isolate_;
- Isolate* saved_isolate_;
- uword saved_stack_limit_;
-
- DISALLOW_COPY_AND_ASSIGN(SwitchIsolateScope);
-};
-
class IsolateSpawnState {
public:
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698