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

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

Issue 25411004: Polymorphic inlining for []= operators. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: fixed checked mode Created 7 years, 2 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 | 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 28 matching lines...) Expand all
39 void EliminateDeadPhis(); 39 void EliminateDeadPhis();
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(const Function& target, 47 bool TryInlineRecognizedMethod(const Function& target,
48 Instruction* call, 48 Instruction* call,
49 intptr_t token_pos,
49 const ICData& ic_data, 50 const ICData& ic_data,
50 TargetEntryInstr** entry, 51 TargetEntryInstr** entry,
51 Definition** last); 52 Definition** last);
52 53
53 // Remove environments from the instructions which do not deoptimize. 54 // Remove environments from the instructions which do not deoptimize.
54 void EliminateEnvironments(); 55 void EliminateEnvironments();
55 56
56 virtual void VisitStaticCall(StaticCallInstr* instr); 57 virtual void VisitStaticCall(StaticCallInstr* instr);
57 virtual void VisitInstanceCall(InstanceCallInstr* instr); 58 virtual void VisitInstanceCall(InstanceCallInstr* instr);
58 virtual void VisitEqualityCompare(EqualityCompareInstr* instr); 59 virtual void VisitEqualityCompare(EqualityCompareInstr* instr);
59 virtual void VisitBranch(BranchInstr* instr); 60 virtual void VisitBranch(BranchInstr* instr);
60 virtual void VisitStrictCompare(StrictCompareInstr* instr); 61 virtual void VisitStrictCompare(StrictCompareInstr* instr);
61 62
62 void InsertBefore(Instruction* next, 63 void InsertBefore(Instruction* next,
63 Instruction* instr, 64 Instruction* instr,
64 Environment* env, 65 Environment* env,
65 Definition::UseKind use_kind) { 66 Definition::UseKind use_kind) {
66 flow_graph_->InsertBefore(next, instr, env, use_kind); 67 flow_graph_->InsertBefore(next, instr, env, use_kind);
67 } 68 }
68 69
69 private: 70 private:
70 // Attempt to build ICData for call using propagated class-ids. 71 // Attempt to build ICData for call using propagated class-ids.
71 bool TryCreateICData(InstanceCallInstr* call); 72 bool TryCreateICData(InstanceCallInstr* call);
72 73
73 void SpecializePolymorphicInstanceCall(PolymorphicInstanceCallInstr* call); 74 void SpecializePolymorphicInstanceCall(PolymorphicInstanceCallInstr* call);
74 75
75 intptr_t PrepareIndexedOp(InstanceCallInstr* call,
76 intptr_t class_id,
77 Definition** array,
78 Definition** index);
79 bool TryReplaceWithStoreIndexed(InstanceCallInstr* call); 76 bool TryReplaceWithStoreIndexed(InstanceCallInstr* call);
80 void BuildStoreIndexed(InstanceCallInstr* call, 77 bool BuildInlineSetIndexed(MethodRecognizer::Kind kind,
81 const ICData& value_check, 78 const Function& target,
82 intptr_t class_id); 79 Instruction* call,
80 intptr_t token_pos,
81 const ICData* ic_data,
82 const ICData& value_check,
83 TargetEntryInstr** entry,
84 Definition** last);
srdjan 2013/10/02 16:19:19 It would be nice if we could simplify the code by
Florian Schneider 2013/10/03 09:20:52 I agree. The problem is that the call can be a Ins
83 bool TryReplaceWithLoadIndexed(InstanceCallInstr* call); 85 bool TryReplaceWithLoadIndexed(InstanceCallInstr* call);
84 bool TryInlineGetIndexed(MethodRecognizer::Kind kind, 86 bool BuildInlineGetIndexed(MethodRecognizer::Kind kind,
srdjan 2013/10/02 16:19:19 s/BuildInlineXXXIndexed/InlineXXXIndexed/ ?
Florian Schneider 2013/10/03 09:20:52 Done.
85 Instruction* call, 87 Instruction* call,
86 const ICData& ic_data, 88 const ICData& ic_data,
87 TargetEntryInstr** entry, 89 TargetEntryInstr** entry,
88 Definition** last); 90 Definition** last);
91 intptr_t PrepareInlineIndexedOp(Instruction* call,
92 intptr_t array_cid,
93 Definition** array,
94 Definition* index,
95 Instruction** cursor);
96
89 97
90 bool TryReplaceWithBinaryOp(InstanceCallInstr* call, Token::Kind op_kind); 98 bool TryReplaceWithBinaryOp(InstanceCallInstr* call, Token::Kind op_kind);
91 bool TryReplaceWithUnaryOp(InstanceCallInstr* call, Token::Kind op_kind); 99 bool TryReplaceWithUnaryOp(InstanceCallInstr* call, Token::Kind op_kind);
92 100
93 bool TryReplaceWithRelationalOp(InstanceCallInstr* call, Token::Kind op_kind); 101 bool TryReplaceWithRelationalOp(InstanceCallInstr* call, Token::Kind op_kind);
94 102
95 bool TryInlineInstanceGetter(InstanceCallInstr* call); 103 bool TryInlineInstanceGetter(InstanceCallInstr* call);
96 bool TryInlineInstanceSetter(InstanceCallInstr* call, 104 bool TryInlineInstanceSetter(InstanceCallInstr* call,
97 const ICData& unary_ic_data); 105 const ICData& unary_ic_data);
98 106
(...skipping 24 matching lines...) Expand all
123 131
124 // Insert a check of 'to_check' determined by 'unary_checks'. If the 132 // Insert a check of 'to_check' determined by 'unary_checks'. If the
125 // check fails it will deoptimize to 'deopt_id' using the deoptimization 133 // check fails it will deoptimize to 'deopt_id' using the deoptimization
126 // environment 'deopt_environment'. The check is inserted immediately 134 // environment 'deopt_environment'. The check is inserted immediately
127 // before 'insert_before'. 135 // before 'insert_before'.
128 void AddCheckClass(Definition* to_check, 136 void AddCheckClass(Definition* to_check,
129 const ICData& unary_checks, 137 const ICData& unary_checks,
130 intptr_t deopt_id, 138 intptr_t deopt_id,
131 Environment* deopt_environment, 139 Environment* deopt_environment,
132 Instruction* insert_before); 140 Instruction* insert_before);
141 Instruction* GetCheckClass(Definition* to_check,
142 const ICData& unary_checks,
143 intptr_t deopt_id);
133 144
134 // Insert a Smi check if needed. 145 // Insert a Smi check if needed.
135 void AddCheckSmi(Definition* to_check, 146 void AddCheckSmi(Definition* to_check,
136 intptr_t deopt_id, 147 intptr_t deopt_id,
137 Environment* deopt_environment, 148 Environment* deopt_environment,
138 Instruction* insert_before); 149 Instruction* insert_before);
139 150
140 // Add a class check for a call's first argument immediately before the 151 // Add a class check for a call's first argument immediately before the
141 // call, using the call's IC data to determine the check, and the call's 152 // call, using the call's IC data to determine the check, and the call's
142 // deopt ID and deoptimization environment if the check fails. 153 // deopt ID and deoptimization environment if the check fails.
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 // Optimize spill stores inside try-blocks by identifying values that always 382 // Optimize spill stores inside try-blocks by identifying values that always
372 // contain a single known constant at catch block entry. 383 // contain a single known constant at catch block entry.
373 class TryCatchAnalyzer : public AllStatic { 384 class TryCatchAnalyzer : public AllStatic {
374 public: 385 public:
375 static void Optimize(FlowGraph* flow_graph); 386 static void Optimize(FlowGraph* flow_graph);
376 }; 387 };
377 388
378 } // namespace dart 389 } // namespace dart
379 390
380 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ 391 #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