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

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

Issue 47933004: VM: Fix bug in polymorphic inlining of recognized methods. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/flow_graph_optimizer.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 VM_FLOW_GRAPH_OPTIMIZER_H_ 5 #ifndef VM_FLOW_GRAPH_OPTIMIZER_H_
6 #define VM_FLOW_GRAPH_OPTIMIZER_H_ 6 #define VM_FLOW_GRAPH_OPTIMIZER_H_
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 #include "vm/flow_graph.h" 9 #include "vm/flow_graph.h"
10 10
(...skipping 29 matching lines...) Expand all
40 40
41 void SelectRepresentations(); 41 void SelectRepresentations();
42 42
43 void InferSmiRanges(); 43 void InferSmiRanges();
44 44
45 void AnalyzeTryCatch(); 45 void AnalyzeTryCatch();
46 46
47 bool TryInlineRecognizedMethod(intptr_t receiver_cid, 47 bool TryInlineRecognizedMethod(intptr_t receiver_cid,
48 const Function& target, 48 const Function& target,
49 Instruction* call, 49 Instruction* call,
50 Definition* receiver,
50 intptr_t token_pos, 51 intptr_t token_pos,
51 const ICData& ic_data, 52 const ICData& ic_data,
52 TargetEntryInstr** entry, 53 TargetEntryInstr** entry,
53 Definition** last); 54 Definition** last);
54 55
55 // Remove environments from the instructions which do not deoptimize. 56 // Remove environments from the instructions which do not deoptimize.
56 void EliminateEnvironments(); 57 void EliminateEnvironments();
57 58
58 virtual void VisitStaticCall(StaticCallInstr* instr); 59 virtual void VisitStaticCall(StaticCallInstr* instr);
59 virtual void VisitInstanceCall(InstanceCallInstr* instr); 60 virtual void VisitInstanceCall(InstanceCallInstr* instr);
(...skipping 10 matching lines...) Expand all
70 private: 71 private:
71 // Attempt to build ICData for call using propagated class-ids. 72 // Attempt to build ICData for call using propagated class-ids.
72 bool TryCreateICData(InstanceCallInstr* call); 73 bool TryCreateICData(InstanceCallInstr* call);
73 74
74 void SpecializePolymorphicInstanceCall(PolymorphicInstanceCallInstr* call); 75 void SpecializePolymorphicInstanceCall(PolymorphicInstanceCallInstr* call);
75 76
76 bool TryReplaceWithStoreIndexed(InstanceCallInstr* call); 77 bool TryReplaceWithStoreIndexed(InstanceCallInstr* call);
77 bool InlineSetIndexed(MethodRecognizer::Kind kind, 78 bool InlineSetIndexed(MethodRecognizer::Kind kind,
78 const Function& target, 79 const Function& target,
79 Instruction* call, 80 Instruction* call,
81 Definition* receiver,
80 intptr_t token_pos, 82 intptr_t token_pos,
81 const ICData* ic_data, 83 const ICData* ic_data,
82 const ICData& value_check, 84 const ICData& value_check,
83 TargetEntryInstr** entry, 85 TargetEntryInstr** entry,
84 Definition** last); 86 Definition** last);
85 bool TryReplaceWithLoadIndexed(InstanceCallInstr* call); 87 bool TryReplaceWithLoadIndexed(InstanceCallInstr* call);
86 bool InlineGetIndexed(MethodRecognizer::Kind kind, 88 bool InlineGetIndexed(MethodRecognizer::Kind kind,
87 Instruction* call, 89 Instruction* call,
90 Definition* receiver,
88 const ICData& ic_data, 91 const ICData& ic_data,
89 TargetEntryInstr** entry, 92 TargetEntryInstr** entry,
90 Definition** last); 93 Definition** last);
91 intptr_t PrepareInlineIndexedOp(Instruction* call, 94 intptr_t PrepareInlineIndexedOp(Instruction* call,
92 intptr_t array_cid, 95 intptr_t array_cid,
93 Definition** array, 96 Definition** array,
94 Definition* index, 97 Definition* index,
95 Instruction** cursor); 98 Instruction** cursor);
96 99
97 100
(...skipping 15 matching lines...) Expand all
113 MethodRecognizer::Kind recognized_kind); 116 MethodRecognizer::Kind recognized_kind);
114 bool TryInlineUint32x4Method(InstanceCallInstr* call, 117 bool TryInlineUint32x4Method(InstanceCallInstr* call,
115 MethodRecognizer::Kind recognized_kind); 118 MethodRecognizer::Kind recognized_kind);
116 void ReplaceWithInstanceOf(InstanceCallInstr* instr); 119 void ReplaceWithInstanceOf(InstanceCallInstr* instr);
117 void ReplaceWithTypeCast(InstanceCallInstr* instr); 120 void ReplaceWithTypeCast(InstanceCallInstr* instr);
118 121
119 LoadIndexedInstr* BuildStringCodeUnitAt(InstanceCallInstr* call, 122 LoadIndexedInstr* BuildStringCodeUnitAt(InstanceCallInstr* call,
120 intptr_t cid); 123 intptr_t cid);
121 124
122 bool InlineByteArrayViewLoad(Instruction* call, 125 bool InlineByteArrayViewLoad(Instruction* call,
126 Definition* receiver,
123 intptr_t array_cid, 127 intptr_t array_cid,
124 intptr_t view_cid, 128 intptr_t view_cid,
125 const ICData& ic_data, 129 const ICData& ic_data,
126 TargetEntryInstr** entry, 130 TargetEntryInstr** entry,
127 Definition** last); 131 Definition** last);
128 132
129 intptr_t PrepareInlineByteArrayViewOp(Instruction* call, 133 intptr_t PrepareInlineByteArrayViewOp(Instruction* call,
130 intptr_t array_cid, 134 intptr_t array_cid,
131 intptr_t view_cid, 135 intptr_t view_cid,
132 Definition** array, 136 Definition** array,
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 // Optimize spill stores inside try-blocks by identifying values that always 399 // Optimize spill stores inside try-blocks by identifying values that always
396 // contain a single known constant at catch block entry. 400 // contain a single known constant at catch block entry.
397 class TryCatchAnalyzer : public AllStatic { 401 class TryCatchAnalyzer : public AllStatic {
398 public: 402 public:
399 static void Optimize(FlowGraph* flow_graph); 403 static void Optimize(FlowGraph* flow_graph);
400 }; 404 };
401 405
402 } // namespace dart 406 } // namespace dart
403 407
404 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ 408 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698