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

Unified Diff: runtime/vm/thread.cc

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, 3 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/thread.h ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread.cc
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc
index a52c1bc5b8837ba33a4f283bf04bc685704f49f0..d0c4651276dc2b59a7941342c24150a42cca4032 100644
--- a/runtime/vm/thread.cc
+++ b/runtime/vm/thread.cc
@@ -10,6 +10,7 @@
#include "vm/object.h"
#include "vm/os_thread.h"
#include "vm/profiler.h"
+#include "vm/runtime_entry.h"
#include "vm/stub_code.h"
#include "vm/thread_interrupter.h"
#include "vm/thread_registry.h"
@@ -108,10 +109,22 @@ Thread::Thread(bool init_vm_constants)
heap_(NULL),
store_buffer_block_(NULL) {
ClearState();
+
#define DEFAULT_INIT(type_name, member_name, init_expr, default_init_value) \
member_name = default_init_value;
CACHED_CONSTANTS_LIST(DEFAULT_INIT)
#undef DEFAULT_INIT
+
+#define DEFAULT_INIT(name) \
+ name##_entry_point_ = 0;
+RUNTIME_ENTRY_LIST(DEFAULT_INIT)
+#undef DEFAULT_INIT
+
+#define DEFAULT_INIT(returntype, name, ...) \
+ name##_entry_point_ = 0;
+LEAF_RUNTIME_ENTRY_LIST(DEFAULT_INIT)
+#undef DEFAULT_INIT
+
if (init_vm_constants) {
InitVMConstants();
}
@@ -130,6 +143,18 @@ CACHED_VM_OBJECTS_LIST(ASSERT_VM_HEAP)
member_name = (init_expr);
CACHED_CONSTANTS_LIST(INIT_VALUE)
#undef INIT_VALUE
+
+#define INIT_VALUE(name) \
+ ASSERT(name##_entry_point_ == 0); \
+ name##_entry_point_ = k##name##RuntimeEntry.GetEntryPoint();
+RUNTIME_ENTRY_LIST(INIT_VALUE)
+#undef INIT_VALUE
+
+#define INIT_VALUE(returntype, name, ...) \
+ ASSERT(name##_entry_point_ == 0); \
+ name##_entry_point_ = k##name##RuntimeEntry.GetEntryPoint();
+LEAF_RUNTIME_ENTRY_LIST(INIT_VALUE)
+#undef INIT_VALUE
}
@@ -326,4 +351,23 @@ CACHED_VM_OBJECTS_LIST(COMPUTE_OFFSET)
return -1;
}
+intptr_t Thread::OffsetFromThread(const RuntimeEntry* runtime_entry) {
+#define COMPUTE_OFFSET(name) \
+ if (runtime_entry->function() == k##name##RuntimeEntry.function()) { \
+ return Thread::name##_entry_point_offset(); \
+ }
+RUNTIME_ENTRY_LIST(COMPUTE_OFFSET)
+#undef COMPUTE_OFFSET
+
+#define COMPUTE_OFFSET(returntype, name, ...) \
+ if (runtime_entry->function() == k##name##RuntimeEntry.function()) { \
+ return Thread::name##_entry_point_offset(); \
+ }
+LEAF_RUNTIME_ENTRY_LIST(COMPUTE_OFFSET)
+#undef COMPUTE_OFFSET
+
+ UNREACHABLE();
+ return -1;
+}
+
} // namespace dart
« no previous file with comments | « runtime/vm/thread.h ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698