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

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

Issue 11366076: Remove special meaning when usage counter reaches the threshold. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | runtime/vm/stub_code_x64.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 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/assembler_macros.h" 9 #include "vm/assembler_macros.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 void StubCode::GenerateUsageCounterIncrement(Assembler* assembler, 1547 void StubCode::GenerateUsageCounterIncrement(Assembler* assembler,
1548 Register ic_reg, 1548 Register ic_reg,
1549 Register temp_reg) { 1549 Register temp_reg) {
1550 __ movl(temp_reg, FieldAddress(ic_reg, ICData::function_offset())); 1550 __ movl(temp_reg, FieldAddress(ic_reg, ICData::function_offset()));
1551 Label is_hot; 1551 Label is_hot;
1552 if (FlowGraphCompiler::CanOptimize()) { 1552 if (FlowGraphCompiler::CanOptimize()) {
1553 ASSERT(FLAG_optimization_counter_threshold > 1); 1553 ASSERT(FLAG_optimization_counter_threshold > 1);
1554 // The usage_counter is always less than FLAG_optimization_counter_threshold 1554 // The usage_counter is always less than FLAG_optimization_counter_threshold
1555 // except when the function gets optimized. 1555 // except when the function gets optimized.
1556 __ cmpl(FieldAddress(temp_reg, Function::usage_counter_offset()), 1556 __ cmpl(FieldAddress(temp_reg, Function::usage_counter_offset()),
1557 Immediate(FLAG_optimization_counter_threshold - 1)); 1557 Immediate(FLAG_optimization_counter_threshold));
1558 // Do not increment to equality with threshold, since a counter greater
1559 // than threshold denotes a function that was already optimized.
1560 // The equality should be reached only at exit of the method
1561 // (return instruction).
1562 __ j(EQUAL, &is_hot, Assembler::kNearJump); 1558 __ j(EQUAL, &is_hot, Assembler::kNearJump);
1563 // As long as VM has no OSR do not optimize in the middle of the function 1559 // As long as VM has no OSR do not optimize in the middle of the function
1564 // but only at exit so that we have collected all type feedback before 1560 // but only at exit so that we have collected all type feedback before
1565 // optimizing. 1561 // optimizing.
1566 } 1562 }
1567 __ incl(FieldAddress(temp_reg, Function::usage_counter_offset())); 1563 __ incl(FieldAddress(temp_reg, Function::usage_counter_offset()));
1568 __ Bind(&is_hot); 1564 __ Bind(&is_hot);
1569 } 1565 }
1570 1566
1571 1567
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
2068 __ Drop(4); 2064 __ Drop(4);
2069 __ LeaveFrame(); 2065 __ LeaveFrame();
2070 2066
2071 __ jmp(&compute_result, Assembler::kNearJump); 2067 __ jmp(&compute_result, Assembler::kNearJump);
2072 } 2068 }
2073 2069
2074 2070
2075 } // namespace dart 2071 } // namespace dart
2076 2072
2077 #endif // defined TARGET_ARCH_IA32 2073 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698