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

Unified Diff: runtime/vm/thread.h

Issue 1315893004: Load runtime entries from the Thread instead of the ObjectPool. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 904d751bc42c733944e4978ee9ce079fd6d8f7aa..9643c334f1ae15cc7632b0c4f63077ac913dd44a 100644
--- a/runtime/vm/thread.h
+++ b/runtime/vm/thread.h
@@ -8,6 +8,7 @@
#include "vm/globals.h"
#include "vm/os_thread.h"
#include "vm/store_buffer.h"
+#include "vm/runtime_entry_list.h"
namespace dart {
@@ -19,11 +20,11 @@ class LongJumpScope;
class Object;
class RawBool;
class RawObject;
+class RuntimeEntry;
class StackResource;
class TimelineEventBlock;
class Zone;
-
// List of VM-global objects/addresses cached in each Thread object.
#define CACHED_VM_OBJECTS_LIST(V) \
V(RawObject*, object_null_, Object::null(), NULL) \
@@ -32,11 +33,11 @@ class Zone;
#define CACHED_ADDRESSES_LIST(V) \
V(uword, update_store_buffer_entry_point_, \
- StubCode::UpdateStoreBuffer_entry()->EntryPoint(), 0)
+ StubCode::UpdateStoreBuffer_entry()->EntryPoint(), 0) \
#define CACHED_CONSTANTS_LIST(V) \
CACHED_VM_OBJECTS_LIST(V) \
- CACHED_ADDRESSES_LIST(V)
+ CACHED_ADDRESSES_LIST(V) \
struct InterruptedThreadState {
ThreadId tid;
@@ -226,8 +227,23 @@ class Thread {
CACHED_CONSTANTS_LIST(DEFINE_OFFSET_METHOD)
#undef DEFINE_OFFSET_METHOD
+#define DEFINE_OFFSET_METHOD(name) \
+ static intptr_t name##_entry_point_offset() { \
+ return OFFSET_OF(Thread, name##_entry_point_); \
+ }
+RUNTIME_ENTRY_LIST(DEFINE_OFFSET_METHOD)
+#undef DEFINE_OFFSET_METHOD
+
+#define DEFINE_OFFSET_METHOD(returntype, name, ...) \
+ static intptr_t name##_entry_point_offset() { \
+ return OFFSET_OF(Thread, name##_entry_point_); \
+ }
+LEAF_RUNTIME_ENTRY_LIST(DEFINE_OFFSET_METHOD)
+#undef DEFINE_OFFSET_METHOD
+
static bool CanLoadFromThread(const Object& object);
static intptr_t OffsetFromThread(const Object& object);
+ static intptr_t OffsetFromThread(const RuntimeEntry* runtime_entry);
TimelineEventBlock* timeline_block() const {
return state_.timeline_block;
@@ -267,6 +283,16 @@ CACHED_CONSTANTS_LIST(DEFINE_OFFSET_METHOD)
CACHED_CONSTANTS_LIST(DECLARE_MEMBERS)
#undef DECLARE_MEMBERS
+#define DECLARE_MEMBERS(name) \
+ uword name##_entry_point_;
+RUNTIME_ENTRY_LIST(DECLARE_MEMBERS)
+#undef DECLARE_MEMBERS
+
+#define DECLARE_MEMBERS(returntype, name, ...) \
+ uword name##_entry_point_;
+LEAF_RUNTIME_ENTRY_LIST(DECLARE_MEMBERS)
+#undef DECLARE_MEMBERS
+
explicit Thread(bool init_vm_constants = true);
void InitVMConstants();

Powered by Google App Engine
This is Rietveld 408576698