diff options
| author | Ben Murdoch <benm@google.com> | 2012-04-11 10:23:59 +0100 |
|---|---|---|
| committer | Ben Murdoch <benm@google.com> | 2012-04-11 15:40:41 +0100 |
| commit | 5d4cdbf7a67d3662fa0bee4efdb7edd8daec9b0b (patch) | |
| tree | 7b717e53b80c4a64bf9b723aabcf7c909ae3c243 /src/execution.cc | |
| parent | c7cc028aaeedbbfa11c11d0b7b243b3d9e837ed9 (diff) | |
| download | android_external_v8-5d4cdbf7a67d3662fa0bee4efdb7edd8daec9b0b.tar.gz android_external_v8-5d4cdbf7a67d3662fa0bee4efdb7edd8daec9b0b.tar.bz2 android_external_v8-5d4cdbf7a67d3662fa0bee4efdb7edd8daec9b0b.zip | |
Merge V8 3.9 at 3.9.24.9
http://v8.googlecode.com/svn/branches/3.9@11260
Bug: 5688872
Change-Id: Iddd944e82189d92df3fc427dc5f0d3f1b2f0c6c8
Diffstat (limited to 'src/execution.cc')
| -rw-r--r-- | src/execution.cc | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/src/execution.cc b/src/execution.cc index 8a0242ff..56189756 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: @@ -376,6 +376,12 @@ void StackGuard::DisableInterrupts() { } +bool StackGuard::ShouldPostponeInterrupts() { + ExecutionAccess access(isolate_); + return should_postpone_interrupts(access); +} + + bool StackGuard::IsInterrupted() { ExecutionAccess access(isolate_); return (thread_local_.interrupt_flags_ & INTERRUPT) != 0; @@ -820,6 +826,11 @@ Object* Execution::DebugBreakHelper() { return isolate->heap()->undefined_value(); } + StackLimitCheck check(isolate); + if (check.HasOverflowed()) { + return isolate->heap()->undefined_value(); + } + { JavaScriptFrameIterator it(isolate); ASSERT(!it.done()); @@ -856,6 +867,11 @@ void Execution::ProcessDebugMessages(bool debug_command_only) { // Clear the debug command request flag. isolate->stack_guard()->Continue(DEBUGCOMMAND); + StackLimitCheck check(isolate); + if (check.HasOverflowed()) { + return; + } + HandleScope scope(isolate); // Enter the debugger. Just continue if we fail to enter the debugger. EnterDebugger debugger; @@ -872,17 +888,22 @@ void Execution::ProcessDebugMessages(bool debug_command_only) { #endif -MaybeObject* Execution::HandleStackGuardInterrupt() { - Isolate* isolate = Isolate::Current(); +MaybeObject* Execution::HandleStackGuardInterrupt(Isolate* isolate) { StackGuard* stack_guard = isolate->stack_guard(); + if (stack_guard->ShouldPostponeInterrupts()) { + return isolate->heap()->undefined_value(); + } if (stack_guard->IsGCRequest()) { - isolate->heap()->CollectAllGarbage(false); + isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, + "StackGuard GC request"); stack_guard->Continue(GC_REQUEST); } 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 +925,5 @@ MaybeObject* Execution::HandleStackGuardInterrupt() { return isolate->heap()->undefined_value(); } + } } // namespace v8::internal |
