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

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

Issue 254723003: Remember all deopt reasons in ic_data, not just the last one. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.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) 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 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 owner_->caller_graph()->alloc_ssa_temp_index()); 1409 owner_->caller_graph()->alloc_ssa_temp_index());
1410 cursor = AppendInstruction(cursor, redefinition); 1410 cursor = AppendInstruction(cursor, redefinition);
1411 if (inlined_variants_[i].cid == kSmiCid) { 1411 if (inlined_variants_[i].cid == kSmiCid) {
1412 CheckSmiInstr* check_smi = 1412 CheckSmiInstr* check_smi =
1413 new CheckSmiInstr(new Value(redefinition), call_->deopt_id()); 1413 new CheckSmiInstr(new Value(redefinition), call_->deopt_id());
1414 check_smi->InheritDeoptTarget(call_); 1414 check_smi->InheritDeoptTarget(call_);
1415 cursor = AppendInstruction(cursor, check_smi); 1415 cursor = AppendInstruction(cursor, check_smi);
1416 } else { 1416 } else {
1417 const ICData& old_checks = call_->ic_data(); 1417 const ICData& old_checks = call_->ic_data();
1418 const ICData& new_checks = ICData::ZoneHandle( 1418 const ICData& new_checks = ICData::ZoneHandle(
1419 ICData::New(Function::Handle(old_checks.function()), 1419 ICData::New(Function::Handle(old_checks.owner()),
1420 String::Handle(old_checks.target_name()), 1420 String::Handle(old_checks.target_name()),
1421 Array::Handle(old_checks.arguments_descriptor()), 1421 Array::Handle(old_checks.arguments_descriptor()),
1422 old_checks.deopt_id(), 1422 old_checks.deopt_id(),
1423 1)); // Number of args tested. 1423 1)); // Number of args tested.
1424 new_checks.AddReceiverCheck(inlined_variants_[i].cid, 1424 new_checks.AddReceiverCheck(inlined_variants_[i].cid,
1425 *inlined_variants_[i].target); 1425 *inlined_variants_[i].target);
1426 CheckClassInstr* check_class = 1426 CheckClassInstr* check_class =
1427 new CheckClassInstr(new Value(redefinition), 1427 new CheckClassInstr(new Value(redefinition),
1428 call_->deopt_id(), 1428 call_->deopt_id(),
1429 new_checks); 1429 new_checks);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1541 // Move push arguments of the call. 1541 // Move push arguments of the call.
1542 for (intptr_t i = 0; i < call_->ArgumentCount(); ++i) { 1542 for (intptr_t i = 0; i < call_->ArgumentCount(); ++i) {
1543 PushArgumentInstr* push = call_->PushArgumentAt(i); 1543 PushArgumentInstr* push = call_->PushArgumentAt(i);
1544 push->ReplaceUsesWith(push->value()->definition()); 1544 push->ReplaceUsesWith(push->value()->definition());
1545 push->previous()->LinkTo(push->next()); 1545 push->previous()->LinkTo(push->next());
1546 cursor->LinkTo(push); 1546 cursor->LinkTo(push);
1547 cursor = push; 1547 cursor = push;
1548 } 1548 }
1549 const ICData& old_checks = call_->ic_data(); 1549 const ICData& old_checks = call_->ic_data();
1550 const ICData& new_checks = ICData::ZoneHandle( 1550 const ICData& new_checks = ICData::ZoneHandle(
1551 ICData::New(Function::Handle(old_checks.function()), 1551 ICData::New(Function::Handle(old_checks.owner()),
1552 String::Handle(old_checks.target_name()), 1552 String::Handle(old_checks.target_name()),
1553 Array::Handle(old_checks.arguments_descriptor()), 1553 Array::Handle(old_checks.arguments_descriptor()),
1554 old_checks.deopt_id(), 1554 old_checks.deopt_id(),
1555 1)); // Number of args tested. 1555 1)); // Number of args tested.
1556 for (intptr_t i = 0; i < non_inlined_variants_.length(); ++i) { 1556 for (intptr_t i = 0; i < non_inlined_variants_.length(); ++i) {
1557 new_checks.AddReceiverCheck(non_inlined_variants_[i].cid, 1557 new_checks.AddReceiverCheck(non_inlined_variants_[i].cid,
1558 *non_inlined_variants_[i].target, 1558 *non_inlined_variants_[i].target,
1559 non_inlined_variants_[i].count); 1559 non_inlined_variants_[i].count);
1560 } 1560 }
1561 PolymorphicInstanceCallInstr* fallback_call = 1561 PolymorphicInstanceCallInstr* fallback_call =
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1689 OS::Print("After Inlining of %s\n", flow_graph_-> 1689 OS::Print("After Inlining of %s\n", flow_graph_->
1690 parsed_function().function().ToFullyQualifiedCString()); 1690 parsed_function().function().ToFullyQualifiedCString());
1691 FlowGraphPrinter printer(*flow_graph_); 1691 FlowGraphPrinter printer(*flow_graph_);
1692 printer.PrintBlocks(); 1692 printer.PrintBlocks();
1693 } 1693 }
1694 } 1694 }
1695 } 1695 }
1696 } 1696 }
1697 1697
1698 } // namespace dart 1698 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698