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

Side by Side Diff: runtime/vm/flow_graph_inliner.cc

Issue 27307005: Change == into an instance call to allow polymorphic inlining of ==. (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
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 #include "vm/flow_graph_inliner.h" 5 #include "vm/flow_graph_inliner.h"
6 6
7 #include "vm/block_scheduler.h" 7 #include "vm/block_scheduler.h"
8 #include "vm/compiler.h" 8 #include "vm/compiler.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/flow_graph.h" 10 #include "vm/flow_graph.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 instruction_count_ = 0; 164 instruction_count_ = 0;
165 for (BlockIterator block_it = graph.postorder_iterator(); 165 for (BlockIterator block_it = graph.postorder_iterator();
166 !block_it.Done(); 166 !block_it.Done();
167 block_it.Advance()) { 167 block_it.Advance()) {
168 for (ForwardInstructionIterator it(block_it.Current()); 168 for (ForwardInstructionIterator it(block_it.Current());
169 !it.Done(); 169 !it.Done();
170 it.Advance()) { 170 it.Advance()) {
171 ++instruction_count_; 171 ++instruction_count_;
172 Instruction* current = it.Current(); 172 Instruction* current = it.Current();
173 if (current->IsStaticCall() || 173 if (current->IsStaticCall() ||
174 current->IsClosureCall() || 174 current->IsClosureCall()) {
175 (current->IsPolymorphicInstanceCall() &&
176 !current->AsPolymorphicInstanceCall()->HasRecognizedTarget())) {
177 ++call_site_count_; 175 ++call_site_count_;
176 continue;
177 }
178 if (current->IsPolymorphicInstanceCall()) {
179 PolymorphicInstanceCallInstr* call =
180 current->AsPolymorphicInstanceCall();
181 // These checks make sure that the number of call-sites counted does
182 // not change relative to the time when the current set of inlining
183 // parameters was fixed.
184 // TODO(fschneider): Determine new heuristic parameters that avoid
185 // these checks entirely.
186 if (!call->HasRecognizedTarget() &&
Florian Schneider 2013/10/28 13:34:19 This is needed to avoid performance regressions wi
187 (call->instance_call()->token_kind() != Token::kEQ)) {
188 ++call_site_count_;
189 }
178 } 190 }
179 } 191 }
180 } 192 }
181 } 193 }
182 194
183 intptr_t call_site_count() const { return call_site_count_; } 195 intptr_t call_site_count() const { return call_site_count_; }
184 intptr_t instruction_count() const { return instruction_count_; } 196 intptr_t instruction_count() const { return instruction_count_; }
185 197
186 private: 198 private:
187 intptr_t call_site_count_; 199 intptr_t call_site_count_;
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1496 OS::Print("After Inlining of %s\n", flow_graph_-> 1508 OS::Print("After Inlining of %s\n", flow_graph_->
1497 parsed_function().function().ToFullyQualifiedCString()); 1509 parsed_function().function().ToFullyQualifiedCString());
1498 FlowGraphPrinter printer(*flow_graph_); 1510 FlowGraphPrinter printer(*flow_graph_);
1499 printer.PrintBlocks(); 1511 printer.PrintBlocks();
1500 } 1512 }
1501 } 1513 }
1502 } 1514 }
1503 } 1515 }
1504 1516
1505 } // namespace dart 1517 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698