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

Unified Diff: runtime/vm/intermediate_language.h

Issue 2904543002: Fix misoptimization of 'is' test (Closed)
Patch Set: Feedback from Slava, do same optimization on AOT and JIT 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.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index e017cf72e4c9b99f338f0ad972aadb7b7b4a2fb6..49c83bcb3c8df4697748fa51ae513ac52014ab47 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -3103,21 +3103,19 @@ class TestSmiInstr : public TemplateComparison<2, NoThrow, Pure> {
// Checks the input value cid against cids stored in a table and returns either
-// a result or deoptimizes.
+// a result or deoptimizes. If the cid is not in the list and there is a deopt
+// id, then the instruction deoptimizes. If there is no deopt id, all the
+// results must be the same (all true or all false) and the instruction returns
+// the opposite for cids not on the list. The first element in the table must
+// always be the result for the Smi class-id and is allowed to differ from the
+// other results even in the no-deopt case.
class TestCidsInstr : public TemplateComparison<1, NoThrow, Pure> {
public:
TestCidsInstr(TokenPosition token_pos,
Token::Kind kind,
Value* value,
const ZoneGrowableArray<intptr_t>& cid_results,
- intptr_t deopt_id)
- : TemplateComparison(token_pos, kind, deopt_id),
- cid_results_(cid_results),
- licm_hoisted_(false) {
- ASSERT((kind == Token::kIS) || (kind == Token::kISNOT));
- SetInputAt(0, value);
- set_operation_cid(kObjectCid);
- }
+ intptr_t deopt_id);
const ZoneGrowableArray<intptr_t>& cid_results() const {
return cid_results_;
« no previous file with comments | « runtime/vm/aot_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698