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 |