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

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

Issue 15779006: Add deoptimization history to optimized functions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
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/compiler.h" 7 #include "vm/compiler.h"
8 #include "vm/flags.h" 8 #include "vm/flags.h"
9 #include "vm/flow_graph.h" 9 #include "vm/flow_graph.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 } 605 }
606 606
607 // If depth is less or equal to threshold recursively add call sites. 607 // If depth is less or equal to threshold recursively add call sites.
608 if (inlining_depth_ < FLAG_inlining_depth_threshold) { 608 if (inlining_depth_ < FLAG_inlining_depth_threshold) {
609 collected_call_sites_->FindCallSites(callee_graph); 609 collected_call_sites_->FindCallSites(callee_graph);
610 } 610 }
611 611
612 // Add the function to the cache. 612 // Add the function to the cache.
613 if (!in_cache) function_cache_.Add(parsed_function); 613 if (!in_cache) function_cache_.Add(parsed_function);
614 614
615 // Functions can be inlined before they are optimized.
616 // If not yet present, allocate deoptimization history array.
617 Array& deopt_history = Array::Handle(function.deopt_history());
618 if (deopt_history.IsNull()) {
619 deopt_history = Array::New(FLAG_deoptimization_counter_threshold);
620 function.set_deopt_history(deopt_history);
srdjan 2013/05/28 10:48:49 This code is used repeatedly. How about factoring
Florian Schneider 2013/05/29 08:50:20 Good idea.
621 }
622
615 // Build succeeded so we restore the bailout jump. 623 // Build succeeded so we restore the bailout jump.
616 inlined_ = true; 624 inlined_ = true;
617 inlined_size_ += size; 625 inlined_size_ += size;
618 isolate->set_long_jump_base(base); 626 isolate->set_long_jump_base(base);
619 isolate->set_deopt_id(prev_deopt_id); 627 isolate->set_deopt_id(prev_deopt_id);
620 628
621 call_data->callee_graph = callee_graph; 629 call_data->callee_graph = callee_graph;
622 call_data->parameter_stubs = param_stubs; 630 call_data->parameter_stubs = param_stubs;
623 call_data->exit_collector = exit_collector; 631 call_data->exit_collector = exit_collector;
624 TRACE_INLINING(OS::Print(" Success\n")); 632 TRACE_INLINING(OS::Print(" Success\n"));
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 OS::Print("After Inlining of %s\n", flow_graph_-> 1342 OS::Print("After Inlining of %s\n", flow_graph_->
1335 parsed_function().function().ToFullyQualifiedCString()); 1343 parsed_function().function().ToFullyQualifiedCString());
1336 FlowGraphPrinter printer(*flow_graph_); 1344 FlowGraphPrinter printer(*flow_graph_);
1337 printer.PrintBlocks(); 1345 printer.PrintBlocks();
1338 } 1346 }
1339 } 1347 }
1340 } 1348 }
1341 } 1349 }
1342 1350
1343 } // namespace dart 1351 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698