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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/aot_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ 5 #ifndef RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_
6 #define RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ 6 #define RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/ast.h" 9 #include "vm/ast.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 3085 matching lines...) Expand 10 before | Expand all | Expand 10 after
3096 3096
3097 virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler, 3097 virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler,
3098 BranchLabels labels); 3098 BranchLabels labels);
3099 3099
3100 private: 3100 private:
3101 DISALLOW_COPY_AND_ASSIGN(TestSmiInstr); 3101 DISALLOW_COPY_AND_ASSIGN(TestSmiInstr);
3102 }; 3102 };
3103 3103
3104 3104
3105 // Checks the input value cid against cids stored in a table and returns either 3105 // Checks the input value cid against cids stored in a table and returns either
3106 // a result or deoptimizes. 3106 // a result or deoptimizes. If the cid is not in the list and there is a deopt
3107 // id, then the instruction deoptimizes. If there is no deopt id, all the
3108 // results must be the same (all true or all false) and the instruction returns
3109 // the opposite for cids not on the list. The first element in the table must
3110 // always be the result for the Smi class-id and is allowed to differ from the
3111 // other results even in the no-deopt case.
3107 class TestCidsInstr : public TemplateComparison<1, NoThrow, Pure> { 3112 class TestCidsInstr : public TemplateComparison<1, NoThrow, Pure> {
3108 public: 3113 public:
3109 TestCidsInstr(TokenPosition token_pos, 3114 TestCidsInstr(TokenPosition token_pos,
3110 Token::Kind kind, 3115 Token::Kind kind,
3111 Value* value, 3116 Value* value,
3112 const ZoneGrowableArray<intptr_t>& cid_results, 3117 const ZoneGrowableArray<intptr_t>& cid_results,
3113 intptr_t deopt_id) 3118 intptr_t deopt_id);
3114 : TemplateComparison(token_pos, kind, deopt_id),
3115 cid_results_(cid_results),
3116 licm_hoisted_(false) {
3117 ASSERT((kind == Token::kIS) || (kind == Token::kISNOT));
3118 SetInputAt(0, value);
3119 set_operation_cid(kObjectCid);
3120 }
3121 3119
3122 const ZoneGrowableArray<intptr_t>& cid_results() const { 3120 const ZoneGrowableArray<intptr_t>& cid_results() const {
3123 return cid_results_; 3121 return cid_results_;
3124 } 3122 }
3125 3123
3126 DECLARE_INSTRUCTION(TestCids); 3124 DECLARE_INSTRUCTION(TestCids);
3127 3125
3128 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); 3126 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right);
3129 3127
3130 virtual CompileType ComputeType() const; 3128 virtual CompileType ComputeType() const;
(...skipping 5090 matching lines...) Expand 10 before | Expand all | Expand 10 after
8221 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ 8219 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \
8222 UNIMPLEMENTED(); \ 8220 UNIMPLEMENTED(); \
8223 return NULL; \ 8221 return NULL; \
8224 } \ 8222 } \
8225 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } 8223 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); }
8226 8224
8227 8225
8228 } // namespace dart 8226 } // namespace dart
8229 8227
8230 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ 8228 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« 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