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

Unified Diff: runtime/vm/isolate.h

Issue 12457034: Ensure that all goto instructions have deoptimization target. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Delete UNREACHABLE Created 7 years, 8 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/intermediate_language_x64.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.h
diff --git a/runtime/vm/isolate.h b/runtime/vm/isolate.h
index 9dcea6b0fd2a45f8cc95a7772e3ed0766a622a78..8731a122203a8f20a454e68d20214c7bc1c55f95 100644
--- a/runtime/vm/isolate.h
+++ b/runtime/vm/isolate.h
@@ -279,6 +279,9 @@ class Isolate : public BaseIsolate {
void set_spawn_data(uword value) { spawn_data_ = value; }
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);
@@ -286,7 +289,22 @@ class Isolate : public BaseIsolate {
}
intptr_t GetNextDeoptId() {
ASSERT(deopt_id_ != kNoDeoptId);
- return deopt_id_++;
+ 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;
}
RawArray* ic_data_array() const { return ic_data_array_; }
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698