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

Side by Side Diff: src/runtime-profiler.cc

Issue 248953002: Sort functions in polymorphic calls based on overall profiling ticks and inlined AST size. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 | « src/objects-inl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 int frame_count_limit = FLAG_frame_count; 178 int frame_count_limit = FLAG_frame_count;
179 for (JavaScriptFrameIterator it(isolate_); 179 for (JavaScriptFrameIterator it(isolate_);
180 frame_count++ < frame_count_limit && !it.done(); 180 frame_count++ < frame_count_limit && !it.done();
181 it.Advance()) { 181 it.Advance()) {
182 JavaScriptFrame* frame = it.frame(); 182 JavaScriptFrame* frame = it.frame();
183 JSFunction* function = frame->function(); 183 JSFunction* function = frame->function();
184 184
185 SharedFunctionInfo* shared = function->shared(); 185 SharedFunctionInfo* shared = function->shared();
186 Code* shared_code = shared->code(); 186 Code* shared_code = shared->code();
187 187
188 List<JSFunction*> functions(4);
189 frame->GetFunctions(&functions);
190 for (int i = functions.length(); --i >= 0; ) {
191 SharedFunctionInfo* shared_function_info = functions[i]->shared();
192 int ticks = shared_function_info->profiler_ticks();
193 if (ticks < Smi::kMaxValue) {
194 shared_function_info->set_profiler_ticks(ticks + 1);
195 }
196 }
197
188 if (shared_code->kind() != Code::FUNCTION) continue; 198 if (shared_code->kind() != Code::FUNCTION) continue;
189 if (function->IsInOptimizationQueue()) continue; 199 if (function->IsInOptimizationQueue()) continue;
190 200
191 if (FLAG_always_osr && 201 if (FLAG_always_osr &&
192 shared_code->allow_osr_at_loop_nesting_level() == 0) { 202 shared_code->allow_osr_at_loop_nesting_level() == 0) {
193 // Testing mode: always try an OSR compile for every function. 203 // Testing mode: always try an OSR compile for every function.
194 for (int i = 0; i < Code::kMaxLoopNestingMarker; i++) { 204 for (int i = 0; i < Code::kMaxLoopNestingMarker; i++) {
195 // TODO(titzer): fix AttemptOnStackReplacement to avoid this dumb loop. 205 // TODO(titzer): fix AttemptOnStackReplacement to avoid this dumb loop.
196 shared_code->set_allow_osr_at_loop_nesting_level(i); 206 shared_code->set_allow_osr_at_loop_nesting_level(i);
197 AttemptOnStackReplacement(function); 207 AttemptOnStackReplacement(function);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 Optimize(function, "small function"); 282 Optimize(function, "small function");
273 } else { 283 } else {
274 shared_code->set_profiler_ticks(ticks + 1); 284 shared_code->set_profiler_ticks(ticks + 1);
275 } 285 }
276 } 286 }
277 any_ic_changed_ = false; 287 any_ic_changed_ = false;
278 } 288 }
279 289
280 290
281 } } // namespace v8::internal 291 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698