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

Unified Diff: runtime/vm/il_printer.cc

Issue 2912903002: Reapply "Fix misoptimization of 'is' test"" (Closed)
Patch Set: Remove change to TestCidsInstr::Canonicalize and improve printer Created 3 years, 7 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/aot_optimizer.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/il_printer.cc
diff --git a/runtime/vm/il_printer.cc b/runtime/vm/il_printer.cc
index b9d584c09e0d45987ea837ae17f0bf5584eeaad9..3e2141f612415507889c791e6c832fdd2c22148d 100644
--- a/runtime/vm/il_printer.cc
+++ b/runtime/vm/il_printer.cc
@@ -565,11 +565,19 @@ void StrictCompareInstr::PrintOperandsTo(BufferFormatter* f) const {
void TestCidsInstr::PrintOperandsTo(BufferFormatter* f) const {
left()->PrintTo(f);
f->Print(" %s [", Token::Str(kind()));
- for (intptr_t i = 0; i < cid_results().length(); i += 2) {
+ intptr_t length = cid_results().length();
+ for (intptr_t i = 0; i < length; i += 2) {
f->Print("0x%" Px ":%s ", cid_results()[i],
cid_results()[i + 1] == 0 ? "false" : "true");
}
f->Print("] ");
+ if (CanDeoptimize()) {
+ ASSERT(deopt_id() != Thread::kNoDeoptId);
+ f->Print("else deoptimize ");
+ } else {
+ ASSERT(deopt_id() == Thread::kNoDeoptId);
+ f->Print("else %s ", cid_results()[length - 1] != 0 ? "false" : "true");
+ }
}
« no previous file with comments | « runtime/vm/aot_optimizer.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698