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

Unified Diff: src/api.cc

Issue 2715004: [Isolates]... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: Address comments/make StackGuard::ThreadLocal::Initialize/Clear side-effects visible Created 10 years, 6 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 | « no previous file | src/arm/regexp-macro-assembler-arm.cc » ('j') | src/execution.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
===================================================================
--- src/api.cc (revision 4831)
+++ src/api.cc (working copy)
@@ -381,15 +381,18 @@
bool SetResourceConstraints(ResourceConstraints* constraints) {
+ i::Isolate* isolate = i::Isolate::Current();
+
int young_space_size = constraints->max_young_space_size();
int old_gen_size = constraints->max_old_space_size();
if (young_space_size != 0 || old_gen_size != 0) {
- bool result = i::Heap::ConfigureHeap(young_space_size / 2, old_gen_size);
+ bool result = isolate->heap()->ConfigureHeap(young_space_size / 2,
+ old_gen_size);
if (!result) return false;
}
if (constraints->stack_limit() != NULL) {
uintptr_t limit = reinterpret_cast<uintptr_t>(constraints->stack_limit());
- i::StackGuard::SetStackLimit(limit);
+ isolate->stack_guard()->SetStackLimit(limit);
}
return true;
}
@@ -3854,11 +3857,12 @@
void V8::TerminateExecution(int thread_id) {
if (!i::V8::IsRunning()) return;
API_ENTRY_CHECK("V8::GetCurrentThreadId()");
+ i::Isolate* isolate = i::Isolate::Current();
// If the thread_id identifies the current thread just terminate
// execution right away. Otherwise, ask the thread manager to
// terminate the thread with the given id if any.
if (thread_id == i::Top::thread_id()) {
- i::StackGuard::TerminateExecution();
+ isolate->stack_guard()->TerminateExecution();
} else {
i::ThreadManager::TerminateExecution(thread_id);
}
@@ -3867,7 +3871,7 @@
void V8::TerminateExecution() {
if (!i::V8::IsRunning()) return;
- i::StackGuard::TerminateExecution();
+ i::Isolate::Current()->stack_guard()->TerminateExecution();
}
@@ -4095,7 +4099,7 @@
void Debug::DebugBreak() {
if (!i::V8::IsRunning()) return;
- i::StackGuard::DebugBreak();
+ i::Isolate::Current()->stack_guard()->DebugBreak();
}
« no previous file with comments | « no previous file | src/arm/regexp-macro-assembler-arm.cc » ('j') | src/execution.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698