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

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

Issue 9845019: Port count-based profiler to x64 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 8 years, 9 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/runtime.cc ('k') | src/x64/deoptimizer-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 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 if (FLAG_trace_osr) { 168 if (FLAG_trace_osr) {
169 PrintF("[patching stack checks in "); 169 PrintF("[patching stack checks in ");
170 function->PrintName(); 170 function->PrintName();
171 PrintF(" for on-stack replacement]\n"); 171 PrintF(" for on-stack replacement]\n");
172 } 172 }
173 173
174 // Get the stack check stub code object to match against. We aren't 174 // Get the stack check stub code object to match against. We aren't
175 // prepared to generate it, but we don't expect to have to. 175 // prepared to generate it, but we don't expect to have to.
176 bool found_code = false; 176 bool found_code = false;
177 Code* stack_check_code = NULL; 177 Code* stack_check_code = NULL;
178 #if defined(V8_TARGET_ARCH_IA32) || \
179 defined(V8_TARGET_ARCH_ARM) || \
180 defined(V8_TARGET_ARCH_MIPS)
181 if (FLAG_count_based_interrupts) { 178 if (FLAG_count_based_interrupts) {
182 InterruptStub interrupt_stub; 179 InterruptStub interrupt_stub;
183 found_code = interrupt_stub.FindCodeInCache(&stack_check_code); 180 found_code = interrupt_stub.FindCodeInCache(&stack_check_code);
184 } else // NOLINT 181 } else // NOLINT
185 #endif
186 { // NOLINT 182 { // NOLINT
187 StackCheckStub check_stub; 183 StackCheckStub check_stub;
188 found_code = check_stub.FindCodeInCache(&stack_check_code); 184 found_code = check_stub.FindCodeInCache(&stack_check_code);
189 } 185 }
190 if (found_code) { 186 if (found_code) {
191 Code* replacement_code = 187 Code* replacement_code =
192 isolate_->builtins()->builtin(Builtins::kOnStackReplacement); 188 isolate_->builtins()->builtin(Builtins::kOnStackReplacement);
193 Code* unoptimized_code = shared->code(); 189 Code* unoptimized_code = shared->code();
194 Deoptimizer::PatchStackCheckCode(unoptimized_code, 190 Deoptimizer::PatchStackCheckCode(unoptimized_code,
195 stack_check_code, 191 stack_check_code,
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 // this as part of collecting them because this will interfere with 342 // this as part of collecting them because this will interfere with
347 // the sample lookup in case of recursive functions. 343 // the sample lookup in case of recursive functions.
348 for (int i = 0; i < sample_count; i++) { 344 for (int i = 0; i < sample_count; i++) {
349 AddSample(samples[i], kSamplerFrameWeight[i]); 345 AddSample(samples[i], kSamplerFrameWeight[i]);
350 } 346 }
351 } 347 }
352 } 348 }
353 349
354 350
355 void RuntimeProfiler::NotifyTick() { 351 void RuntimeProfiler::NotifyTick() {
356 #if defined(V8_TARGET_ARCH_IA32) || \
357 defined(V8_TARGET_ARCH_ARM) || \
358 defined(V8_TARGET_ARCH_MIPS)
359 if (FLAG_count_based_interrupts) return; 352 if (FLAG_count_based_interrupts) return;
360 #endif
361 isolate_->stack_guard()->RequestRuntimeProfilerTick(); 353 isolate_->stack_guard()->RequestRuntimeProfilerTick();
362 } 354 }
363 355
364 356
365 void RuntimeProfiler::SetUp() { 357 void RuntimeProfiler::SetUp() {
366 ASSERT(has_been_globally_set_up_); 358 ASSERT(has_been_globally_set_up_);
367 if (!FLAG_watch_ic_patching) { 359 if (!FLAG_watch_ic_patching) {
368 ClearSampleBuffer(); 360 ClearSampleBuffer();
369 } 361 }
370 // If the ticker hasn't already started, make sure to do so to get 362 // If the ticker hasn't already started, make sure to do so to get
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 470
479 bool RuntimeProfilerRateLimiter::SuspendIfNecessary() { 471 bool RuntimeProfilerRateLimiter::SuspendIfNecessary() {
480 if (!RuntimeProfiler::IsSomeIsolateInJS()) { 472 if (!RuntimeProfiler::IsSomeIsolateInJS()) {
481 return RuntimeProfiler::WaitForSomeIsolateToEnterJS(); 473 return RuntimeProfiler::WaitForSomeIsolateToEnterJS();
482 } 474 }
483 return false; 475 return false;
484 } 476 }
485 477
486 478
487 } } // namespace v8::internal 479 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | src/x64/deoptimizer-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698