Commit 76aad1a0 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Fixed a known issue in D8 (read file), enabled D8 shared library build on Windows.

Review URL: http://codereview.chromium.org/7586001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8853 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 528a3301
......@@ -1394,10 +1394,12 @@ def BuildSpecific(env, mode, env_overrides, tools):
env['SONAME'] = soname
# Build the object files by invoking SCons recursively.
d8_env = Environment(tools=tools)
d8_env.Replace(**context.flags['d8'])
(object_files, shell_files, mksnapshot, preparser_files) = env.SConscript(
join('src', 'SConscript'),
build_dir=join('obj', target_id),
exports='context tools',
exports='context tools d8_env',
duplicate=False
)
......@@ -1426,8 +1428,6 @@ def BuildSpecific(env, mode, env_overrides, tools):
context.library_targets.append(library)
context.library_targets.append(preparser_library)
d8_env = Environment(tools=tools)
d8_env.Replace(**context.flags['d8'])
context.ApplyEnvOverrides(d8_env)
if context.options['library'] == 'static':
shell = d8_env.Program('d8' + suffix, object_files + shell_files)
......
......@@ -3606,7 +3606,7 @@ class V8EXPORT Locker {
/**
* Returns whether v8::Locker is being used by this V8 instance.
*/
static bool IsActive() { return active_; }
static bool IsActive();
private:
bool has_lock_;
......
......@@ -32,6 +32,7 @@ sys.path.append(join(root_dir, 'tools'))
import js2c
Import('context')
Import('tools')
Import('d8_env')
SOURCES = {
......@@ -340,7 +341,7 @@ def ConfigureObjectFiles():
else:
d8_files = context.GetRelevantSources(D8_FULL_FILES)
d8_objs = [d8_js_obj]
d8_objs.append(context.ConfigureObject(env, [d8_files]))
d8_objs.append(context.ConfigureObject(d8_env, [d8_files]))
# Combine the JavaScript library files into a single C++ file and
# compile it.
......
This diff is collapsed.
......@@ -29,22 +29,22 @@
#define V8_D8_H_
#ifndef USING_V8_SHARED
#ifndef V8_SHARED
#include "v8.h"
#include "allocation.h"
#include "hashmap.h"
#else
#include "../include/v8.h"
#endif // USING_V8_SHARED
#endif // V8_SHARED
namespace v8 {
#ifndef USING_V8_SHARED
#ifndef V8_SHARED
namespace i = v8::internal;
#endif // USING_V8_SHARED
#endif // V8_SHARED
#ifndef USING_V8_SHARED
#ifndef V8_SHARED
// A single counter in a counter collection.
class Counter {
public:
......@@ -117,17 +117,17 @@ class CounterMap {
static bool Match(void* key1, void* key2);
i::HashMap hash_map_;
};
#endif // USING_V8_SHARED
#endif // V8_SHARED
class SourceGroup {
public:
SourceGroup() :
#ifndef USING_V8_SHARED
#ifndef V8_SHARED
next_semaphore_(v8::internal::OS::CreateSemaphore(0)),
done_semaphore_(v8::internal::OS::CreateSemaphore(0)),
thread_(NULL),
#endif // USING_V8_SHARED
#endif // V8_SHARED
argv_(NULL),
begin_offset_(0),
end_offset_(0) { }
......@@ -141,7 +141,7 @@ class SourceGroup {
void Execute();
#ifndef USING_V8_SHARED
#ifndef V8_SHARED
void StartExecuteInThread();
void WaitForThread();
......@@ -165,7 +165,7 @@ class SourceGroup {
i::Semaphore* next_semaphore_;
i::Semaphore* done_semaphore_;
i::Thread* thread_;
#endif // USING_V8_SHARED
#endif // V8_SHARED
void ExitShell(int exit_code);
Handle<String> ReadFile(const char* name);
......@@ -179,11 +179,11 @@ class SourceGroup {
class ShellOptions {
public:
ShellOptions() :
#ifndef USING_V8_SHARED
#ifndef V8_SHARED
use_preemption(true),
preemption_interval(10),
parallel_files(NULL),
#endif // USING_V8_SHARED
#endif // V8_SHARED
script_executed(false),
last_run(true),
stress_opt(false),
......@@ -193,11 +193,11 @@ class ShellOptions {
num_isolates(1),
isolate_sources(NULL) { }
#ifndef USING_V8_SHARED
#ifndef V8_SHARED
bool use_preemption;
int preemption_interval;
i::List< i::Vector<const char> >* parallel_files;
#endif // USING_V8_SHARED
#endif // V8_SHARED
bool script_executed;
bool last_run;
bool stress_opt;
......@@ -208,11 +208,11 @@ class ShellOptions {
SourceGroup* isolate_sources;
};
#ifdef USING_V8_SHARED
#ifdef V8_SHARED
class Shell {
#else
class Shell : public i::AllStatic {
#endif // USING_V8_SHARED
#endif // V8_SHARED
public:
static bool ExecuteString(Handle<String> source,
Handle<Value> name,
......@@ -225,7 +225,7 @@ class Shell : public i::AllStatic {
static int RunMain(int argc, char* argv[]);
static int Main(int argc, char* argv[]);
#ifndef USING_V8_SHARED
#ifndef V8_SHARED
static Handle<Array> GetCompletions(Handle<String> text,
Handle<String> full);
static void OnExit();
......@@ -236,7 +236,7 @@ class Shell : public i::AllStatic {
size_t buckets);
static void AddHistogramSample(void* histogram, int sample);
static void MapCounters(const char* name);
#endif // USING_V8_SHARED
#endif // V8_SHARED
#ifdef ENABLE_DEBUGGER_SUPPORT
static Handle<Object> DebugMessageDetails(Handle<String> message);
......@@ -300,15 +300,15 @@ class Shell : public i::AllStatic {
static Handle<Value> RemoveDirectory(const Arguments& args);
static void AddOSMethods(Handle<ObjectTemplate> os_template);
#ifndef USING_V8_SHARED
#ifndef V8_SHARED
static const char* kHistoryFileName;
#endif // USING_V8_SHARED
#endif // V8_SHARED
static const char* kPrompt;
static ShellOptions options;
private:
static Persistent<Context> evaluation_context_;
#ifndef USING_V8_SHARED
#ifndef V8_SHARED
static Persistent<Context> utility_context_;
static CounterMap* counter_map_;
// We statically allocate a set of local counters to be used if we
......@@ -320,7 +320,7 @@ class Shell : public i::AllStatic {
static Counter* GetCounter(const char* name, bool is_histogram);
static void InstallUtilityScript();
#endif // USING_V8_SHARED
#endif // V8_SHARED
static void Initialize();
static void RunShell();
static bool SetOptions(int argc, char* argv[]);
......@@ -332,7 +332,7 @@ class Shell : public i::AllStatic {
};
#ifndef USING_V8_SHARED
#ifndef V8_SHARED
class LineEditor {
public:
enum Type { DUMB = 0, READLINE = 1 };
......@@ -352,7 +352,7 @@ class LineEditor {
LineEditor* next_;
static LineEditor* first_;
};
#endif // USING_V8_SHARED
#endif // V8_SHARED
} // namespace v8
......
......@@ -94,6 +94,11 @@ bool Locker::IsLocked(v8::Isolate* isolate) {
}
bool Locker::IsActive() {
return active_;
}
Locker::~Locker() {
ASSERT(isolate_->thread_manager()->IsLockedByCurrentThread());
if (has_lock_) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment