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

Unified Diff: runtime/vm/thread.h

Issue 1225933002: Remove fixed contant pool entries by caching some global constants in Thread (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: added helper methods to Thread Created 5 years, 5 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
Index: runtime/vm/thread.h
diff --git a/runtime/vm/thread.h b/runtime/vm/thread.h
index 3a8dacda14fe84f0f24d16c59ae1dde5a3da9f3d..3fc45025cf5b2f83da7271b312f6933c2e22d8d1 100644
--- a/runtime/vm/thread.h
+++ b/runtime/vm/thread.h
@@ -14,6 +14,10 @@ namespace dart {
class CHA;
class Isolate;
+class RawBool;
+class RawObject;
+class Object;
+
// A VM thread; may be executing Dart code or performing helper tasks like
// garbage collection or compilation. The Thread structure associated with
@@ -53,7 +57,8 @@ class Thread {
#endif
// Called at VM startup.
- static void InitOnce();
+ static void InitOnceBeforeIsolate();
+ static void InitOnceAfterObjectAndStubCode();
// The topmost zone used for allocation in this thread.
Zone* zone() {
@@ -83,14 +88,38 @@ class Thread {
return OFFSET_OF(Thread, store_buffer_block_);
}
+ static intptr_t object_null_offset() {
+ return OFFSET_OF(Thread, object_null_);
+ }
+
+ static intptr_t bool_true_offset() {
+ return OFFSET_OF(Thread, bool_true_);
+ }
+
+ static intptr_t bool_false_offset() {
+ return OFFSET_OF(Thread, bool_false_);
+ }
+
+ static intptr_t update_store_buffer_entry_point_offset() {
+ return OFFSET_OF(Thread, update_store_buffer_entry_point_);
+ }
+
+ static bool CanLoadFromThread(const Object& object);
+ static intptr_t OffsetFromThread(const Object& object);
+
private:
static ThreadLocalKey thread_key_;
Isolate* isolate_;
StoreBufferBlock* store_buffer_block_;
+ RawObject* object_null_;
+ RawBool* bool_true_;
+ RawBool* bool_false_;
+ uword update_store_buffer_entry_point_;
+
+ explicit Thread(bool init_vm_constants = true);
- Thread()
- : isolate_(NULL), store_buffer_block_(NULL) {}
+ void InitVMConstants();
static void SetCurrent(Thread* current);

Powered by Google App Engine
This is Rietveld 408576698