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

Side by Side Diff: src/compiler.cc

Issue 5633009: Collect only optimizable function samples.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years 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 | src/runtime-profiler.cc » ('j') | src/runtime-profiler.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 static void FinishOptimization(Handle<JSFunction> function, int64_t start) { 116 static void FinishOptimization(Handle<JSFunction> function, int64_t start) {
117 int opt_count = function->shared()->opt_count(); 117 int opt_count = function->shared()->opt_count();
118 function->shared()->set_opt_count(opt_count + 1); 118 function->shared()->set_opt_count(opt_count + 1);
119 if (!FLAG_trace_opt) return; 119 if (!FLAG_trace_opt) return;
120 120
121 double ms = static_cast<double>(OS::Ticks() - start) / 1000; 121 double ms = static_cast<double>(OS::Ticks() - start) / 1000;
122 PrintF("[optimizing: "); 122 PrintF("[optimizing: ");
123 function->PrintName(); 123 function->PrintName();
124 PrintF(" / %" V8PRIxPTR, reinterpret_cast<intptr_t>(*function)); 124 PrintF(" / %" V8PRIxPTR, reinterpret_cast<intptr_t>(*function));
125 PrintF(" - took %0.3f ms]\n", ms); 125 PrintF(" - took %0.3f ms]\n", ms);
126
127 if (FLAG_trace_opt) {
Kasper Lund 2010/12/09 11:51:51 Remove this check. FLAG_trace_opt is true at this
Karl Klose 2010/12/09 12:49:32 Done.
128 static double compilation_time = 0.0;
129 static int compiled_functions =0;
Kasper Lund 2010/12/09 11:51:51 =0 -> = 0
Karl Klose 2010/12/09 12:49:32 Done.
130 static int code_size = 0;
131
132 compilation_time += ms;
133 compiled_functions++;
134 code_size += function->shared()->SourceSize();
135 PrintF("Compiled: %d functions with %d byte source size in %fms.\n",
136 compiled_functions,
137 code_size,
138 compilation_time);
139 }
126 } 140 }
127 141
128 142
129 static void AbortAndDisable(CompilationInfo* info) { 143 static void AbortAndDisable(CompilationInfo* info) {
130 // Disable optimization for the shared function info and mark the 144 // Disable optimization for the shared function info and mark the
131 // code as non-optimizable. The marker on the shared function info 145 // code as non-optimizable. The marker on the shared function info
132 // is there because we flush non-optimized code thereby loosing the 146 // is there because we flush non-optimized code thereby loosing the
133 // non-optimizable information for the code. When the code is 147 // non-optimizable information for the code. When the code is
134 // regenerated and set on the shared function info it is marked as 148 // regenerated and set on the shared function info it is marked as
135 // non-optimizable if optimization is disabled for the shared 149 // non-optimizable if optimization is disabled for the shared
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 *code, 769 *code,
756 *name)); 770 *name));
757 OPROFILE(CreateNativeCodeRegion(*name, 771 OPROFILE(CreateNativeCodeRegion(*name,
758 code->instruction_start(), 772 code->instruction_start(),
759 code->instruction_size())); 773 code->instruction_size()));
760 } 774 }
761 } 775 }
762 } 776 }
763 777
764 } } // namespace v8::internal 778 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/runtime-profiler.cc » ('j') | src/runtime-profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698