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

Unified Diff: src/execution.cc

Issue 9373028: Initial support for count-based profiling (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/code-stubs.h ('k') | src/flag-definitions.h » ('j') | src/full-codegen.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/execution.cc
diff --git a/src/execution.cc b/src/execution.cc
index 71e8ea34a1eb72b2050086889d812afa666c68cd..56d102f9a9f5b95c9a1ff5e5b57a2531c6679139 100644
--- a/src/execution.cc
+++ b/src/execution.cc
@@ -1,4 +1,4 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
+// Copyright 2012 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -49,6 +49,7 @@ StackGuard::StackGuard()
void StackGuard::set_interrupt_limits(const ExecutionAccess& lock) {
+ if (FLAG_count_based_interrupts) return;
ASSERT(isolate_ != NULL);
// Ignore attempts to interrupt when interrupts are postponed.
if (should_postpone_interrupts(lock)) return;
@@ -59,6 +60,7 @@ void StackGuard::set_interrupt_limits(const ExecutionAccess& lock) {
void StackGuard::reset_limits(const ExecutionAccess& lock) {
+ if (FLAG_count_based_interrupts) return;
ASSERT(isolate_ != NULL);
thread_local_.jslimit_ = thread_local_.real_jslimit_;
thread_local_.climit_ = thread_local_.real_climit_;
@@ -882,7 +884,9 @@ MaybeObject* Execution::HandleStackGuardInterrupt() {
}
isolate->counters()->stack_interrupts()->Increment();
- if (stack_guard->IsRuntimeProfilerTick()) {
+ // If FLAG_count_based_interrupts, every interrupt is a profiler interrupt.
+ if (FLAG_count_based_interrupts ||
+ stack_guard->IsRuntimeProfilerTick()) {
isolate->counters()->runtime_profiler_ticks()->Increment();
stack_guard->Continue(RUNTIME_PROFILER_TICK);
isolate->runtime_profiler()->OptimizeNow();
@@ -904,4 +908,5 @@ MaybeObject* Execution::HandleStackGuardInterrupt() {
return isolate->heap()->undefined_value();
}
+
} } // namespace v8::internal
« no previous file with comments | « src/code-stubs.h ('k') | src/flag-definitions.h » ('j') | src/full-codegen.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698