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

Unified Diff: runtime/vm/object.cc

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/object.h ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index aa1aac6319890ba3e63a236a9cbd33827415942c..61101e2e47ec73def41ddc3160338c5dec0723f1 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -6917,8 +6917,7 @@ RawPcDescriptors* PcDescriptors::New(intptr_t num_descriptors) {
const char* PcDescriptors::KindAsStr(intptr_t index) const {
switch (DescriptorKind(index)) {
- case PcDescriptors::kDeoptBefore: return "deopt-before ";
- case PcDescriptors::kDeoptAfter: return "deopt-after ";
+ case PcDescriptors::kDeopt: return "deopt ";
case PcDescriptors::kEntryPatch: return "entry-patch ";
case PcDescriptors::kPatchCode: return "patch ";
case PcDescriptors::kLazyDeoptJump: return "lazy-deopt ";
@@ -6999,10 +6998,19 @@ void PcDescriptors::Verify(const Function& function) const {
PcDescriptors::Kind kind = DescriptorKind(i);
// 'deopt_id' is set for kDeopt and kIcCall and must be unique for one kind.
intptr_t deopt_id = Isolate::kNoDeoptId;
- if ((DescriptorKind(i) == PcDescriptors::kDeoptBefore) ||
- (DescriptorKind(i) == PcDescriptors::kIcCall)) {
- deopt_id = DeoptId(i);
+ if ((DescriptorKind(i) != PcDescriptors::kDeopt) ||
+ (DescriptorKind(i) != PcDescriptors::kIcCall)) {
+ continue;
+ }
+
+ deopt_id = DeoptId(i);
+ if (Isolate::IsDeoptAfter(deopt_id)) {
+ // TODO(vegorov): some instructions contain multiple calls and have
+ // multiple "after" targets recorded. Right now it is benign but might
+ // lead to issues in the future. Fix that and enable verification.
+ continue;
}
+
for (intptr_t k = i + 1; k < Length(); k++) {
if (kind == DescriptorKind(k)) {
if (deopt_id != Isolate::kNoDeoptId) {
@@ -7744,18 +7752,6 @@ uword Code::GetPcForDeoptId(intptr_t deopt_id, PcDescriptors::Kind kind) const {
}
-uword Code::GetDeoptBeforePcAtDeoptId(intptr_t deopt_id) const {
- ASSERT(!is_optimized());
- return GetPcForDeoptId(deopt_id, PcDescriptors::kDeoptBefore);
-}
-
-
-uword Code::GetDeoptAfterPcAtDeoptId(intptr_t deopt_id) const {
- ASSERT(!is_optimized());
- return GetPcForDeoptId(deopt_id, PcDescriptors::kDeoptAfter);
-}
-
-
const char* Code::ToCString() const {
const char* kFormat = "Code entry:%p";
intptr_t len = OS::SNPrint(NULL, 0, kFormat, EntryPoint()) + 1;
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698