summaryrefslogtreecommitdiffstats
path: root/V8Binding/v8/src/execution.cc
diff options
context:
space:
mode:
Diffstat (limited to 'V8Binding/v8/src/execution.cc')
-rw-r--r--V8Binding/v8/src/execution.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/V8Binding/v8/src/execution.cc b/V8Binding/v8/src/execution.cc
index 40a9b4f..4ab6b61 100644
--- a/V8Binding/v8/src/execution.cc
+++ b/V8Binding/v8/src/execution.cc
@@ -83,6 +83,14 @@ static Handle<Object> Invoke(bool construct,
code = stub.GetCode();
}
+ // Convert calls on global objects to be calls on the global
+ // receiver instead to avoid having a 'this' pointer which refers
+ // directly to a global object.
+ if (receiver->IsGlobalObject()) {
+ Handle<GlobalObject> global = Handle<GlobalObject>::cast(receiver);
+ receiver = Handle<JSObject>(global->global_receiver());
+ }
+
{
// Save and restore context around invocation and block the
// allocation of handles without explicit handle scopes.
@@ -587,6 +595,23 @@ Object* Execution::DebugBreakHelper() {
return Heap::undefined_value();
}
+ {
+ JavaScriptFrameIterator it;
+ ASSERT(!it.done());
+ Object* fun = it.frame()->function();
+ if (fun && fun->IsJSFunction()) {
+ // Don't stop in builtin functions.
+ if (JSFunction::cast(fun)->IsBuiltin()) {
+ return Heap::undefined_value();
+ }
+ GlobalObject* global = JSFunction::cast(fun)->context()->global();
+ // Don't stop in debugger functions.
+ if (Debug::IsDebugGlobal(global)) {
+ return Heap::undefined_value();
+ }
+ }
+ }
+
// Collect the break state before clearing the flags.
bool debug_command_only =
StackGuard::IsDebugCommand() && !StackGuard::IsDebugBreak();