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

Unified Diff: runtime/vm/intermediate_language.cc

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/intermediate_language.h ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index fe521dae39d2cb57caaeb8e7987579f282647823..d61cb4c2d84e178a3bba600069b5483808fe31b1 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -2733,6 +2733,30 @@ Instruction* CheckClassIdInstr::Canonicalize(FlowGraph* flow_graph) {
}
+TestCidsInstr::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);
+#ifdef DEBUG
+ ASSERT(cid_results[0] == kSmiCid);
+ if (deopt_id == Thread::kNoDeoptId) {
+ // The entry for Smi can be special, but all other entries have
+ // to match in the no-deopt case.
+ for (intptr_t i = 4; i < cid_results.length(); i += 2) {
+ ASSERT(cid_results[i + 1] == cid_results[3]);
+ }
+ }
+#endif
+}
+
+
Definition* TestCidsInstr::Canonicalize(FlowGraph* flow_graph) {
CompileType* in_type = left()->Type();
intptr_t cid = in_type->ToCid();
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698