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

Side by Side Diff: runtime/vm/intermediate_language_x64.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_ia32.cc ('k') | runtime/vm/stub_code_ia32.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" // Needed here to get TARGET_ARCH_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // collection and counting stub. 54 // collection and counting stub.
55 const Function& function = 55 const Function& function =
56 Function::ZoneHandle(compiler->parsed_function().function().raw()); 56 Function::ZoneHandle(compiler->parsed_function().function().raw());
57 __ LoadObject(temp, function); 57 __ LoadObject(temp, function);
58 __ incq(FieldAddress(temp, Function::usage_counter_offset())); 58 __ incq(FieldAddress(temp, Function::usage_counter_offset()));
59 if (FlowGraphCompiler::CanOptimize() && 59 if (FlowGraphCompiler::CanOptimize() &&
60 compiler->parsed_function().function().is_optimizable()) { 60 compiler->parsed_function().function().is_optimizable()) {
61 // Do not optimize if usage count must be reported. 61 // Do not optimize if usage count must be reported.
62 __ cmpq(FieldAddress(temp, Function::usage_counter_offset()), 62 __ cmpq(FieldAddress(temp, Function::usage_counter_offset()),
63 Immediate(FLAG_optimization_counter_threshold)); 63 Immediate(FLAG_optimization_counter_threshold));
64 Label not_yet_hot, already_optimized; 64 Label not_yet_hot;
65 __ j(LESS, &not_yet_hot, Assembler::kNearJump); 65 __ j(LESS, &not_yet_hot, Assembler::kNearJump);
66 __ j(GREATER, &already_optimized, Assembler::kNearJump);
67 __ pushq(result); // Preserve result. 66 __ pushq(result); // Preserve result.
68 __ pushq(temp); // Argument for runtime: function to optimize. 67 __ pushq(temp); // Argument for runtime: function to optimize.
69 __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry); 68 __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry);
70 __ popq(temp); // Remove argument. 69 __ popq(temp); // Remove argument.
71 __ popq(result); // Restore result. 70 __ popq(result); // Restore result.
72 __ Bind(&not_yet_hot); 71 __ Bind(&not_yet_hot);
73 __ Bind(&already_optimized);
74 } 72 }
75 } 73 }
76 if (FLAG_trace_functions) { 74 if (FLAG_trace_functions) {
77 const Function& function = 75 const Function& function =
78 Function::ZoneHandle(compiler->parsed_function().function().raw()); 76 Function::ZoneHandle(compiler->parsed_function().function().raw());
79 __ LoadObject(temp, function); 77 __ LoadObject(temp, function);
80 __ pushq(result); // Preserve result. 78 __ pushq(result); // Preserve result.
81 __ pushq(temp); 79 __ pushq(temp);
82 compiler->GenerateCallRuntime(0, 80 compiler->GenerateCallRuntime(0,
83 kTraceFunctionExitRuntimeEntry, 81 kTraceFunctionExitRuntimeEntry,
(...skipping 2279 matching lines...) Expand 10 before | Expand all | Expand 10 after
2363 2361
2364 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2362 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2365 UNIMPLEMENTED(); 2363 UNIMPLEMENTED();
2366 } 2364 }
2367 2365
2368 } // namespace dart 2366 } // namespace dart
2369 2367
2370 #undef __ 2368 #undef __
2371 2369
2372 #endif // defined TARGET_ARCH_X64 2370 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698