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

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

Issue 11031040: Don't inline functions above the deoptimization threshold. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Typo and added deopt increment Created 8 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 | « no previous file | runtime/vm/deopt_instructions.cc » ('j') | runtime/vm/deopt_instructions.cc » ('J')
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 #include "vm/code_generator.h" 5 #include "vm/code_generator.h"
6 6
7 #include "vm/assembler_macros.h" 7 #include "vm/assembler_macros.h"
8 #include "vm/ast.h" 8 #include "vm/ast.h"
9 #include "vm/code_patcher.h" 9 #include "vm/code_patcher.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after
1574 1574
1575 1575
1576 DeoptInfo& deopt_info = DeoptInfo::Handle(); 1576 DeoptInfo& deopt_info = DeoptInfo::Handle();
1577 DeoptReasonId deopt_reason = kDeoptUnknown; 1577 DeoptReasonId deopt_reason = kDeoptUnknown;
1578 GetDeoptInfoAtPc(optimized_code, caller_frame->pc(), &deopt_info, 1578 GetDeoptInfoAtPc(optimized_code, caller_frame->pc(), &deopt_info,
1579 &deopt_reason); 1579 &deopt_reason);
1580 ASSERT(!deopt_info.IsNull()); 1580 ASSERT(!deopt_info.IsNull());
1581 1581
1582 CopyFrame(optimized_code, *caller_frame); 1582 CopyFrame(optimized_code, *caller_frame);
1583 if (FLAG_trace_deoptimization) { 1583 if (FLAG_trace_deoptimization) {
1584 OS::Print("Deoptimizing (reason %d '%s') at pc %#"Px" '%s'\n", 1584 OS::Print("Deoptimizing (reason %d '%s') at pc %#"Px" '%s' (count %d)\n",
1585 deopt_reason, 1585 deopt_reason,
1586 DeoptReasonToText(deopt_reason), 1586 DeoptReasonToText(deopt_reason),
1587 caller_frame->pc(), 1587 caller_frame->pc(),
1588 Function::Handle(optimized_code.function()).ToFullyQualifiedCString()); 1588 Function::Handle(optimized_code.function()).ToFullyQualifiedCString(),
Kevin Millikin (Google) 2012/10/04 11:37:59 Not a bit deal, but we don't need two handles here
zerny-google 2012/10/04 12:18:41 Done.
1589 Function::Handle(optimized_code.function()).deoptimization_counter());
1589 } 1590 }
1590 1591
1591 // Compute the stack size of the unoptimized frame. For functions with 1592 // Compute the stack size of the unoptimized frame. For functions with
1592 // optional arguments the deoptimization info does not describe the 1593 // optional arguments the deoptimization info does not describe the
1593 // incoming arguments. 1594 // incoming arguments.
1594 const Function& function = Function::Handle(optimized_code.function()); 1595 const Function& function = Function::Handle(optimized_code.function());
1595 const intptr_t num_args = 1596 const intptr_t num_args =
1596 function.HasOptionalParameters() ? 0 : function.num_fixed_parameters(); 1597 function.HasOptionalParameters() ? 0 : function.num_fixed_parameters();
1597 intptr_t unoptimized_stack_size = 1598 intptr_t unoptimized_stack_size =
1598 + deopt_info.Length() - num_args 1599 + deopt_info.Length() - num_args
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1672 const intptr_t caller_fp = 1673 const intptr_t caller_fp =
1673 DeoptimizeWithDeoptInfo(optimized_code, deopt_info, *caller_frame); 1674 DeoptimizeWithDeoptInfo(optimized_code, deopt_info, *caller_frame);
1674 1675
1675 isolate->SetDeoptFrameCopy(NULL, 0); 1676 isolate->SetDeoptFrameCopy(NULL, 0);
1676 isolate->set_deopt_cpu_registers_copy(NULL); 1677 isolate->set_deopt_cpu_registers_copy(NULL);
1677 isolate->set_deopt_xmm_registers_copy(NULL); 1678 isolate->set_deopt_xmm_registers_copy(NULL);
1678 delete[] frame_copy; 1679 delete[] frame_copy;
1679 delete[] cpu_registers_copy; 1680 delete[] cpu_registers_copy;
1680 delete[] xmm_registers_copy; 1681 delete[] xmm_registers_copy;
1681 1682
1682 // Clear invocation counter so that the function gets optimized after
1683 // classes have been collected.
1684 function.set_usage_counter(0);
1685 function.set_deoptimization_counter(function.deoptimization_counter() + 1);
1686
1687 if (function.HasOptimizedCode()) {
1688 function.SwitchToUnoptimizedCode();
1689 }
1690 return caller_fp; 1683 return caller_fp;
1691 } 1684 }
1692 END_LEAF_RUNTIME_ENTRY 1685 END_LEAF_RUNTIME_ENTRY
1693 1686
1694 1687
1695 // This is the last step in the deoptimization, GC can occur. 1688 // This is the last step in the deoptimization, GC can occur.
1696 DEFINE_RUNTIME_ENTRY(DeoptimizeMaterializeDoubles, 0) { 1689 DEFINE_RUNTIME_ENTRY(DeoptimizeMaterializeDoubles, 0) {
1697 DeferredDouble* deferred_double = Isolate::Current()->DetachDeferredDoubles(); 1690 DeferredDouble* deferred_double = Isolate::Current()->DetachDeferredDoubles();
1698 1691
1699 while (deferred_double != NULL) { 1692 while (deferred_double != NULL) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1743 intptr_t line, column; 1736 intptr_t line, column;
1744 script.GetTokenLocation(token_pos, &line, &column); 1737 script.GetTokenLocation(token_pos, &line, &column);
1745 String& line_string = String::Handle(script.GetLine(line)); 1738 String& line_string = String::Handle(script.GetLine(line));
1746 OS::Print(" Function: %s\n", top_function.ToFullyQualifiedCString()); 1739 OS::Print(" Function: %s\n", top_function.ToFullyQualifiedCString());
1747 OS::Print(" Line %"Pd": '%s'\n", line, line_string.ToCString()); 1740 OS::Print(" Line %"Pd": '%s'\n", line, line_string.ToCString());
1748 } 1741 }
1749 } 1742 }
1750 1743
1751 1744
1752 } // namespace dart 1745 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/deopt_instructions.cc » ('j') | runtime/vm/deopt_instructions.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698