From 008b871162d11a3ad8960548690a9938aba679e9 Mon Sep 17 00:00:00 2001 From: "bmeurer@chromium.org" Date: Thu, 24 Oct 2013 11:59:09 +0000 Subject: [PATCH] Fix shared library build after r17368. TBR=hpayer@chromium.org Review URL: https://codereview.chromium.org/40033002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17372 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/d8.cc | 6 +++++- src/d8.h | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/d8.cc b/src/d8.cc index 4b1d33b..357c8a4 100644 --- a/src/d8.cc +++ b/src/d8.cc @@ -160,13 +160,13 @@ i::OS::MemoryMappedFile* Shell::counters_file_ = NULL; CounterCollection Shell::local_counters_; CounterCollection* Shell::counters_ = &local_counters_; i::Mutex Shell::context_mutex_; +const i::TimeTicks Shell::kInitialTicks = i::TimeTicks::HighResolutionNow(); Persistent Shell::utility_context_; #endif // V8_SHARED Persistent Shell::evaluation_context_; ShellOptions Shell::options; const char* Shell::kPrompt = "d8> "; -const i::TimeTicks Shell::kInitialTicks = i::TimeTicks::HighResolutionNow(); const int MB = 1024 * 1024; @@ -290,11 +290,13 @@ int PerIsolateData::RealmFind(Handle context) { } +#ifndef V8_SHARED // performance.now() returns a time stamp as double, measured in milliseconds. void Shell::PerformanceNow(const v8::FunctionCallbackInfo& args) { i::TimeDelta delta = i::TimeTicks::HighResolutionNow() - kInitialTicks; args.GetReturnValue().Set(delta.InMillisecondsF()); } +#endif // V8_SHARED // Realm.current() returns the index of the currently active realm. @@ -880,10 +882,12 @@ Handle Shell::CreateGlobalTemplate(Isolate* isolate) { RealmSharedGet, RealmSharedSet); global_template->Set(String::New("Realm"), realm_template); +#ifndef V8_SHARED Handle performance_template = ObjectTemplate::New(); performance_template->Set(String::New("now"), FunctionTemplate::New(PerformanceNow)); global_template->Set(String::New("performance"), performance_template); +#endif // V8_SHARED #if !defined(V8_SHARED) && !defined(_WIN32) && !defined(_WIN64) Handle os_templ = ObjectTemplate::New(); diff --git a/src/d8.h b/src/d8.h index a3716ee..411dfdd 100644 --- a/src/d8.h +++ b/src/d8.h @@ -302,9 +302,10 @@ class Shell : public i::AllStatic { Handle command); static void DispatchDebugMessages(); #endif // ENABLE_DEBUGGER_SUPPORT -#endif // V8_SHARED static void PerformanceNow(const v8::FunctionCallbackInfo& args); +#endif // V8_SHARED + static void RealmCurrent(const v8::FunctionCallbackInfo& args); static void RealmOwner(const v8::FunctionCallbackInfo& args); static void RealmGlobal(const v8::FunctionCallbackInfo& args); @@ -382,7 +383,6 @@ class Shell : public i::AllStatic { static const char* kPrompt; static ShellOptions options; - static const i::TimeTicks kInitialTicks; private: static Persistent evaluation_context_; @@ -395,6 +395,7 @@ class Shell : public i::AllStatic { static CounterCollection* counters_; static i::OS::MemoryMappedFile* counters_file_; static i::Mutex context_mutex_; + static const i::TimeTicks kInitialTicks; static Counter* GetCounter(const char* name, bool is_histogram); static void InstallUtilityScript(Isolate* isolate); -- 2.7.4