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

Unified Diff: runtime/vm/thread.h

Issue 1390153004: Move deopt_id and related helpers/definitions from Isolate to Thread (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 4b9b9c9c6ba36d48000881410b6b9c330c8835f3..0dccea56de27e2b0e45d9c9b7c14a1a2404b8517 100644
--- a/runtime/vm/thread.h
+++ b/runtime/vm/thread.h
@@ -312,6 +312,35 @@ LEAF_RUNTIME_ENTRY_LIST(DEFINE_OFFSET_METHOD)
class Log* log() const;
+ static const intptr_t kNoDeoptId = -1;
+ static const intptr_t kDeoptIdStep = 2;
+ static const intptr_t kDeoptIdBeforeOffset = 0;
+ static const intptr_t kDeoptIdAfterOffset = 1;
+ intptr_t deopt_id() const { return deopt_id_; }
+ void set_deopt_id(int value) {
+ ASSERT(value >= 0);
+ deopt_id_ = value;
+ }
+ intptr_t GetNextDeoptId() {
+ ASSERT(deopt_id_ != kNoDeoptId);
+ const intptr_t id = deopt_id_;
+ deopt_id_ += kDeoptIdStep;
+ return id;
+ }
+
+ static intptr_t ToDeoptAfter(intptr_t deopt_id) {
+ ASSERT(IsDeoptBefore(deopt_id));
+ return deopt_id + kDeoptIdAfterOffset;
+ }
+
+ static bool IsDeoptBefore(intptr_t deopt_id) {
+ return (deopt_id % kDeoptIdStep) == kDeoptIdBeforeOffset;
+ }
+
+ static bool IsDeoptAfter(intptr_t deopt_id) {
+ return (deopt_id % kDeoptIdStep) == kDeoptIdAfterOffset;
+ }
+
LongJumpScope* long_jump_base() const { return state_.long_jump_base; }
void set_long_jump_base(LongJumpScope* value) {
state_.long_jump_base = value;
@@ -382,6 +411,7 @@ LEAF_RUNTIME_ENTRY_LIST(DEFINE_OFFSET_METHOD)
Mutex timeline_block_lock_;
StoreBufferBlock* store_buffer_block_;
class Log* log_;
+ intptr_t deopt_id_; // Compilation specific counter.
uword vm_tag_;
#define DECLARE_MEMBERS(type_name, member_name, expr, default_init_value) \
type_name member_name;

Powered by Google App Engine
This is Rietveld 408576698