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

Side by Side Diff: runtime/vm/intermediate_language.h

Issue 2912903002: Reapply "Fix misoptimization of 'is' test"" (Closed)
Patch Set: Remove change to TestCidsInstr::Canonicalize and improve printer Created 3 years, 6 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/il_printer.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 3086 matching lines...) Expand 10 before | Expand all | Expand 10 after
3097 3097
3098 virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler, 3098 virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler,
3099 BranchLabels labels); 3099 BranchLabels labels);
3100 3100
3101 private: 3101 private:
3102 DISALLOW_COPY_AND_ASSIGN(TestSmiInstr); 3102 DISALLOW_COPY_AND_ASSIGN(TestSmiInstr);
3103 }; 3103 };
3104 3104
3105 3105
3106 // Checks the input value cid against cids stored in a table and returns either 3106 // Checks the input value cid against cids stored in a table and returns either
3107 // a result or deoptimizes. 3107 // a result or deoptimizes. If the cid is not in the list and there is a deopt
3108 // id, then the instruction deoptimizes. If there is no deopt id, all the
3109 // results must be the same (all true or all false) and the instruction returns
3110 // the opposite for cids not on the list. The first element in the table must
3111 // always be the result for the Smi class-id and is allowed to differ from the
3112 // other results even in the no-deopt case.
3108 class TestCidsInstr : public TemplateComparison<1, NoThrow, Pure> { 3113 class TestCidsInstr : public TemplateComparison<1, NoThrow, Pure> {
3109 public: 3114 public:
3110 TestCidsInstr(TokenPosition token_pos, 3115 TestCidsInstr(TokenPosition token_pos,
3111 Token::Kind kind, 3116 Token::Kind kind,
3112 Value* value, 3117 Value* value,
3113 const ZoneGrowableArray<intptr_t>& cid_results, 3118 const ZoneGrowableArray<intptr_t>& cid_results,
3114 intptr_t deopt_id) 3119 intptr_t deopt_id);
3115 : TemplateComparison(token_pos, kind, deopt_id),
3116 cid_results_(cid_results),
3117 licm_hoisted_(false) {
3118 ASSERT((kind == Token::kIS) || (kind == Token::kISNOT));
3119 SetInputAt(0, value);
3120 set_operation_cid(kObjectCid);
3121 }
3122 3120
3123 const ZoneGrowableArray<intptr_t>& cid_results() const { 3121 const ZoneGrowableArray<intptr_t>& cid_results() const {
3124 return cid_results_; 3122 return cid_results_;
3125 } 3123 }
3126 3124
3127 DECLARE_INSTRUCTION(TestCids); 3125 DECLARE_INSTRUCTION(TestCids);
3128 3126
3129 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); 3127 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right);
3130 3128
3131 virtual CompileType ComputeType() const; 3129 virtual CompileType ComputeType() const;
(...skipping 5099 matching lines...) Expand 10 before | Expand all | Expand 10 after
8231 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ 8229 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \
8232 UNIMPLEMENTED(); \ 8230 UNIMPLEMENTED(); \
8233 return NULL; \ 8231 return NULL; \
8234 } \ 8232 } \
8235 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } 8233 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); }
8236 8234
8237 8235
8238 } // namespace dart 8236 } // namespace dart
8239 8237
8240 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ 8238 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698