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

Unified Diff: runtime/vm/isolate.h

Issue 17503002: Stop unwanted class finalization when using dart:io HttpClient from builtin.dart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 a2e37c5c41d8c468eb6d9935cc5e49f0ecf56d5f..b4a575f342228cec37e1185bcf7e8be70b642445 100644
--- a/runtime/vm/isolate.h
+++ b/runtime/vm/isolate.h
@@ -583,6 +583,21 @@ class Isolate : public BaseIsolate {
static char* GetStatus(const char* request);
+ intptr_t BlockClassFinalization() {
+ ASSERT(defer_finalization_count_ >= 0);
+ return defer_finalization_count_++;
+ }
+
+ intptr_t UnblockClassFinalization() {
+ ASSERT(defer_finalization_count_ > 0);
+ return defer_finalization_count_--;
+ }
+
+ bool AllowClassFinalization() {
+ ASSERT(defer_finalization_count_ >= 0);
+ return defer_finalization_count_ == 0;
+ }
+
private:
Isolate();
@@ -626,6 +641,7 @@ class Isolate : public BaseIsolate {
IsolateRunState running_state_;
GcPrologueCallbacks gc_prologue_callbacks_;
GcEpilogueCallbacks gc_epilogue_callbacks_;
+ intptr_t defer_finalization_count_;
// Deoptimization support.
intptr_t* deopt_cpu_registers_copy_;
« 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