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

Unified Diff: runtime/vm/thread.h

Issue 1210033007: Cache some global constants in Thread, to allow access via THR register. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Remove unused define. 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
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread.h
diff --git a/runtime/vm/thread.h b/runtime/vm/thread.h
index 3a8dacda14fe84f0f24d16c59ae1dde5a3da9f3d..e3494d5a12fddd638844bb80acc23d3204e01339 100644
--- a/runtime/vm/thread.h
+++ b/runtime/vm/thread.h
@@ -14,6 +14,9 @@ namespace dart {
class CHA;
class Isolate;
+class RawBool;
+class RawObject;
+
// A VM thread; may be executing Dart code or performing helper tasks like
// garbage collection or compilation. The Thread structure associated with
@@ -53,7 +56,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 +87,35 @@ 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_);
+ }
+
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);
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698