linux: extend the ifdefs in shell.cc to cover V8_SHARED too
Review URL: http://codereview.chromium.org/7076030 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8090 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
7eb6f5c1ba
commit
a4cf6da5d2
@ -41,7 +41,7 @@
|
|||||||
// #ifndef USING_V8_SHARED/#endif is a hack until we can resolve whether to
|
// #ifndef USING_V8_SHARED/#endif is a hack until we can resolve whether to
|
||||||
// still use the shell sample for testing or change to use the developer
|
// still use the shell sample for testing or change to use the developer
|
||||||
// shell d8 TODO(1272).
|
// shell d8 TODO(1272).
|
||||||
#ifndef USING_V8_SHARED
|
#if !(defined(USING_V8_SHARED) || defined(V8_SHARED))
|
||||||
#include "../src/v8.h"
|
#include "../src/v8.h"
|
||||||
#endif // USING_V8_SHARED
|
#endif // USING_V8_SHARED
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ static bool last_run = true;
|
|||||||
class SourceGroup {
|
class SourceGroup {
|
||||||
public:
|
public:
|
||||||
SourceGroup() :
|
SourceGroup() :
|
||||||
#ifndef USING_V8_SHARED
|
#if !(defined(USING_V8_SHARED) || defined(V8_SHARED))
|
||||||
next_semaphore_(v8::internal::OS::CreateSemaphore(0)),
|
next_semaphore_(v8::internal::OS::CreateSemaphore(0)),
|
||||||
done_semaphore_(v8::internal::OS::CreateSemaphore(0)),
|
done_semaphore_(v8::internal::OS::CreateSemaphore(0)),
|
||||||
thread_(NULL),
|
thread_(NULL),
|
||||||
@ -134,7 +134,7 @@ class SourceGroup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef USING_V8_SHARED
|
#if !(defined(USING_V8_SHARED) || defined(V8_SHARED))
|
||||||
void StartExecuteInThread() {
|
void StartExecuteInThread() {
|
||||||
if (thread_ == NULL) {
|
if (thread_ == NULL) {
|
||||||
thread_ = new IsolateThread(this);
|
thread_ = new IsolateThread(this);
|
||||||
@ -155,7 +155,7 @@ class SourceGroup {
|
|||||||
#endif // USING_V8_SHARED
|
#endif // USING_V8_SHARED
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifndef USING_V8_SHARED
|
#if !(defined(USING_V8_SHARED) || defined(V8_SHARED))
|
||||||
static v8::internal::Thread::Options GetThreadOptions() {
|
static v8::internal::Thread::Options GetThreadOptions() {
|
||||||
v8::internal::Thread::Options options;
|
v8::internal::Thread::Options options;
|
||||||
options.name = "IsolateThread";
|
options.name = "IsolateThread";
|
||||||
@ -228,7 +228,7 @@ int RunMain(int argc, char* argv[]) {
|
|||||||
int num_isolates = 1;
|
int num_isolates = 1;
|
||||||
for (int i = 1; i < argc; i++) {
|
for (int i = 1; i < argc; i++) {
|
||||||
if (strcmp(argv[i], "--isolate") == 0) {
|
if (strcmp(argv[i], "--isolate") == 0) {
|
||||||
#ifndef USING_V8_SHARED
|
#if !(defined(USING_V8_SHARED) || defined(V8_SHARED))
|
||||||
++num_isolates;
|
++num_isolates;
|
||||||
#else // USING_V8_SHARED
|
#else // USING_V8_SHARED
|
||||||
printf("Error: --isolate not supported when linked with shared "
|
printf("Error: --isolate not supported when linked with shared "
|
||||||
@ -259,14 +259,14 @@ int RunMain(int argc, char* argv[]) {
|
|||||||
}
|
}
|
||||||
current->End(argc);
|
current->End(argc);
|
||||||
}
|
}
|
||||||
#ifndef USING_V8_SHARED
|
#if !(defined(USING_V8_SHARED) || defined(V8_SHARED))
|
||||||
for (int i = 1; i < num_isolates; ++i) {
|
for (int i = 1; i < num_isolates; ++i) {
|
||||||
isolate_sources[i].StartExecuteInThread();
|
isolate_sources[i].StartExecuteInThread();
|
||||||
}
|
}
|
||||||
#endif // USING_V8_SHARED
|
#endif // USING_V8_SHARED
|
||||||
isolate_sources[0].Execute();
|
isolate_sources[0].Execute();
|
||||||
if (run_shell) RunShell(context);
|
if (run_shell) RunShell(context);
|
||||||
#ifndef USING_V8_SHARED
|
#if !(defined(USING_V8_SHARED) || defined(V8_SHARED))
|
||||||
for (int i = 1; i < num_isolates; ++i) {
|
for (int i = 1; i < num_isolates; ++i) {
|
||||||
isolate_sources[i].WaitForThread();
|
isolate_sources[i].WaitForThread();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user