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

Unified Diff: runtime/vm/thread.h

Issue 1473403003: Move ApiLocalScope out of class ApiState into class Thread so that the API local handles and zone e… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: self-code-review Created 5 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/thread.h
diff --git a/runtime/vm/thread.h b/runtime/vm/thread.h
index 07360ea8dcc6f431300ec52acfbc1c34355be7a5..9ba406bcb064d985c08903c0f4a7d1179e460051 100644
--- a/runtime/vm/thread.h
+++ b/runtime/vm/thread.h
@@ -5,6 +5,7 @@
#ifndef VM_THREAD_H_
#define VM_THREAD_H_
+#include "include/dart_api.h"
#include "vm/globals.h"
#include "vm/handles.h"
#include "vm/os_thread.h"
@@ -14,6 +15,7 @@
namespace dart {
class AbstractType;
+class ApiLocalScope;
class Array;
class CHA;
class Class;
@@ -136,6 +138,18 @@ class Thread : public BaseThread {
// The topmost zone used for allocation in this thread.
Zone* zone() const { return zone_; }
+ // The reusable api local scope for this thread.
+ ApiLocalScope* api_reusable_scope() const { return api_reusable_scope_; }
+ void set_api_reusable_scope(ApiLocalScope* value) {
+ ASSERT(value == NULL || api_reusable_scope_ == NULL);
+ api_reusable_scope_ = value;
+ }
+
+ // The api local scope for this thread, this where all local handles
+ // are allocated.
+ ApiLocalScope* api_top_scope() const { return api_top_scope_; }
+ void set_api_top_scope(ApiLocalScope* value) { api_top_scope_ = value; }
+
// The isolate that this thread is operating on, or NULL if none.
Isolate* isolate() const { return isolate_; }
static intptr_t isolate_offset() {
@@ -362,7 +376,14 @@ LEAF_RUNTIME_ENTRY_LIST(DEFINE_OFFSET_METHOD)
RawGrowableObjectArray* pending_functions();
+ // Visit all object pointers.
void VisitObjectPointers(ObjectPointerVisitor* visitor);
+
+ bool IsValidLocalHandle(Dart_Handle object) const;
+ int CountLocalHandles() const;
+ int ZoneSizeInBytes() const;
+ void UnwindScopes(uword stack_marker);
+
void InitVMConstants();
private:
@@ -372,6 +393,8 @@ LEAF_RUNTIME_ENTRY_LIST(DEFINE_OFFSET_METHOD)
Isolate* isolate_;
Heap* heap_;
Zone* zone_;
+ ApiLocalScope* api_reusable_scope_;
+ ApiLocalScope* api_top_scope_;
uword top_exit_frame_info_;
StackResource* top_resource_;
LongJumpScope* long_jump_base_;

Powered by Google App Engine
This is Rietveld 408576698