summaryrefslogtreecommitdiffstats
path: root/src/execution.cc
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-05 13:52:32 +0100
committerBen Murdoch <benm@google.com>2011-05-10 15:41:47 +0100
commitb0fe1620dcb4135ac3ab2d66ff93072373911299 (patch)
tree3487cdc7e01ec56a6f84ea20f4bae596a0b73986 /src/execution.cc
parentdf5bff59602802b769e994b0dc1d8869a27fa40c (diff)
downloadandroid_external_v8-b0fe1620dcb4135ac3ab2d66ff93072373911299.tar.gz
android_external_v8-b0fe1620dcb4135ac3ab2d66ff93072373911299.tar.bz2
android_external_v8-b0fe1620dcb4135ac3ab2d66ff93072373911299.zip
Update V8 to r6101 as required by WebKit r74534
Change-Id: I7f84af8dd732f11898fd644b2c2b1538914cb78d
Diffstat (limited to 'src/execution.cc')
-rw-r--r--src/execution.cc28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/execution.cc b/src/execution.cc
index 691d5695..11dacfee 100644
--- a/src/execution.cc
+++ b/src/execution.cc
@@ -33,8 +33,10 @@
#include "bootstrapper.h"
#include "codegen-inl.h"
#include "debug.h"
+#include "runtime-profiler.h"
#include "simulator.h"
#include "v8threads.h"
+#include "vm-state-inl.h"
namespace v8 {
namespace internal {
@@ -295,6 +297,25 @@ void StackGuard::TerminateExecution() {
}
+bool StackGuard::IsRuntimeProfilerTick() {
+ ExecutionAccess access;
+ return thread_local_.interrupt_flags_ & RUNTIME_PROFILER_TICK;
+}
+
+
+void StackGuard::RequestRuntimeProfilerTick() {
+ // Ignore calls if we're not optimizing or if we can't get the lock.
+ if (FLAG_opt && ExecutionAccess::TryLock()) {
+ thread_local_.interrupt_flags_ |= RUNTIME_PROFILER_TICK;
+ if (thread_local_.postpone_interrupts_nesting_ == 0) {
+ thread_local_.jslimit_ = thread_local_.climit_ = kInterruptLimit;
+ Heap::SetStackLimits();
+ }
+ ExecutionAccess::Unlock();
+ }
+}
+
+
#ifdef ENABLE_DEBUGGER_SUPPORT
bool StackGuard::IsDebugBreak() {
ExecutionAccess access;
@@ -682,6 +703,12 @@ void Execution::ProcessDebugMesssages(bool debug_command_only) {
#endif
MaybeObject* Execution::HandleStackGuardInterrupt() {
+ Counters::stack_interrupts.Increment();
+ if (StackGuard::IsRuntimeProfilerTick()) {
+ Counters::runtime_profiler_ticks.Increment();
+ StackGuard::Continue(RUNTIME_PROFILER_TICK);
+ RuntimeProfiler::OptimizeNow();
+ }
#ifdef ENABLE_DEBUGGER_SUPPORT
if (StackGuard::IsDebugBreak() || StackGuard::IsDebugCommand()) {
DebugBreakHelper();
@@ -693,7 +720,6 @@ MaybeObject* Execution::HandleStackGuardInterrupt() {
return Top::TerminateExecution();
}
if (StackGuard::IsInterrupted()) {
- // interrupt
StackGuard::Continue(INTERRUPT);
return Top::StackOverflow();
}