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

Unified Diff: src/execution.cc

Issue 14886: Bring toiger up to date with bleeding edge 984. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: Created 12 years 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/execution.h ('k') | src/global-handles.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/execution.cc
===================================================================
--- src/execution.cc (revision 1004)
+++ src/execution.cc (working copy)
@@ -38,6 +38,9 @@
#include "simulator-ia32.h"
#endif
+#include "debug.h"
+#include "v8threads.h"
+
namespace v8 { namespace internal {
@@ -500,6 +503,69 @@
}
+static Object* RuntimePreempt() {
+ // Clear the preempt request flag.
+ StackGuard::Continue(PREEMPT);
+
+ ContextSwitcher::PreemptionReceived();
+
+ {
+ v8::Unlocker unlocker;
+ Thread::YieldCPU();
+ }
+
+ return Heap::undefined_value();
+}
+
+
+Object* Execution::DebugBreakHelper() {
+ // Just continue if breaks are disabled.
+ if (Debug::disable_break()) {
+ return Heap::undefined_value();
+ }
+
+ // Don't break in system functions. If the current function is
+ // either in the builtins object of some context or is in the debug
+ // context just return with the debug break stack guard active.
+ JavaScriptFrameIterator it;
+ JavaScriptFrame* frame = it.frame();
+ Object* fun = frame->function();
+ if (fun->IsJSFunction()) {
+ GlobalObject* global = JSFunction::cast(fun)->context()->global();
+ if (global->IsJSBuiltinsObject() || Debug::IsDebugGlobal(global)) {
+ return Heap::undefined_value();
+ }
+ }
+
+ // Clear the debug request flag.
+ StackGuard::Continue(DEBUGBREAK);
+
+ HandleScope scope;
+ // Enter the debugger. Just continue if we fail to enter the debugger.
+ EnterDebugger debugger;
+ if (debugger.FailedToEnter()) {
+ return Heap::undefined_value();
+ }
+
+ // Notify the debug event listeners.
+ Debugger::OnDebugBreak(Factory::undefined_value());
+
+ // Return to continue execution.
+ return Heap::undefined_value();
+}
+
+
+Object* Execution::HandleStackGuardInterrupt() {
+ if (StackGuard::IsDebugBreak()) DebugBreakHelper();
+ if (StackGuard::IsPreempted()) RuntimePreempt();
+ if (StackGuard::IsInterrupted()) {
+ // interrupt
+ StackGuard::Continue(INTERRUPT);
+ return Top::StackOverflow();
+ }
+ return Heap::undefined_value();
+}
+
// --- G C E x t e n s i o n ---
const char* GCExtension::kSource = "native function gc();";
« no previous file with comments | « src/execution.h ('k') | src/global-handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698