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

Unified Diff: src/execution.cc

Issue 8139027: Version 3.6.5 (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: '' Created 9 years, 2 months 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/extensions/gc-extension.cc » ('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 9531)
+++ src/execution.cc (working copy)
@@ -33,6 +33,7 @@
#include "bootstrapper.h"
#include "codegen.h"
#include "debug.h"
+#include "isolate-inl.h"
#include "runtime-profiler.h"
#include "simulator.h"
#include "v8threads.h"
@@ -88,11 +89,9 @@
Handle<Code> code;
if (construct) {
- JSConstructEntryStub stub;
- code = stub.GetCode();
+ code = isolate->factory()->js_construct_entry_code();
} else {
- JSEntryStub stub;
- code = stub.GetCode();
+ code = isolate->factory()->js_entry_code();
}
// Convert calls on global objects to be calls on the global
@@ -151,6 +150,8 @@
Object*** args,
bool* pending_exception,
bool convert_receiver) {
+ *pending_exception = false;
+
if (!callable->IsJSFunction()) {
callable = TryGetFunctionDelegate(callable, pending_exception);
if (*pending_exception) return callable;
@@ -195,6 +196,7 @@
v8::TryCatch catcher;
catcher.SetVerbose(false);
catcher.SetCaptureMessage(false);
+ *caught_exception = false;
Handle<Object> result = Invoke(false, func, receiver, argc, args,
caught_exception);
@@ -377,7 +379,7 @@
bool StackGuard::IsInterrupted() {
ExecutionAccess access(isolate_);
- return thread_local_.interrupt_flags_ & INTERRUPT;
+ return (thread_local_.interrupt_flags_ & INTERRUPT) != 0;
}
@@ -403,7 +405,7 @@
bool StackGuard::IsTerminateExecution() {
ExecutionAccess access(isolate_);
- return thread_local_.interrupt_flags_ & TERMINATE;
+ return (thread_local_.interrupt_flags_ & TERMINATE) != 0;
}
@@ -416,7 +418,7 @@
bool StackGuard::IsRuntimeProfilerTick() {
ExecutionAccess access(isolate_);
- return thread_local_.interrupt_flags_ & RUNTIME_PROFILER_TICK;
+ return (thread_local_.interrupt_flags_ & RUNTIME_PROFILER_TICK) != 0;
}
@@ -433,6 +435,22 @@
}
+bool StackGuard::IsGCRequest() {
+ ExecutionAccess access(isolate_);
+ return (thread_local_.interrupt_flags_ & GC_REQUEST) != 0;
+}
+
+
+void StackGuard::RequestGC() {
+ ExecutionAccess access(isolate_);
+ thread_local_.interrupt_flags_ |= GC_REQUEST;
+ if (thread_local_.postpone_interrupts_nesting_ == 0) {
+ thread_local_.jslimit_ = thread_local_.climit_ = kInterruptLimit;
+ isolate_->heap()->SetStackLimits();
+ }
+}
+
+
#ifdef ENABLE_DEBUGGER_SUPPORT
bool StackGuard::IsDebugBreak() {
ExecutionAccess access(isolate_);
@@ -740,7 +758,7 @@
Handle<Object>::cast(fun).location(),
pos.location(),
is_global.location() };
- bool caught_exception = false;
+ bool caught_exception;
Handle<Object> result =
TryCall(isolate->get_stack_trace_line_fun(),
isolate->js_builtins_object(), argc, args,
@@ -852,6 +870,12 @@
MaybeObject* Execution::HandleStackGuardInterrupt() {
Isolate* isolate = Isolate::Current();
StackGuard* stack_guard = isolate->stack_guard();
+
+ if (stack_guard->IsGCRequest()) {
+ isolate->heap()->CollectAllGarbage(false);
+ stack_guard->Continue(GC_REQUEST);
+ }
+
isolate->counters()->stack_interrupts()->Increment();
if (stack_guard->IsRuntimeProfilerTick()) {
isolate->counters()->runtime_profiler_ticks()->Increment();
« no previous file with comments | « src/execution.h ('k') | src/extensions/gc-extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698