Commit 4f569522 authored by jgruber's avatar jgruber Committed by Commit bot

[d8] Fix the shared-library build

This commit ensures that the d8 shared library build uses the same logic as
the standard static build by exporting relevant functions and classes.

BUG=chromium:646337

Committed: https://crrev.com/2c10ca8086a4d595ecf9aa843d2031b068470d65
Review-Url: https://codereview.chromium.org/2342563002
Cr-Original-Commit-Position: refs/heads/master@{#39503}
Cr-Commit-Position: refs/heads/master@{#39547}
parent 7d9a0375
...@@ -115,10 +115,7 @@ config("internal_config") { ...@@ -115,10 +115,7 @@ config("internal_config") {
include_dirs = [ "." ] include_dirs = [ "." ]
if (is_component_build) { if (is_component_build) {
defines = [ defines = [ "BUILDING_V8_SHARED" ]
"V8_SHARED",
"BUILDING_V8_SHARED",
]
} }
} }
...@@ -142,10 +139,7 @@ config("libsampler_config") { ...@@ -142,10 +139,7 @@ config("libsampler_config") {
# itself. # itself.
config("external_config") { config("external_config") {
if (is_component_build) { if (is_component_build) {
defines = [ defines = [ "USING_V8_SHARED" ]
"V8_SHARED",
"USING_V8_SHARED",
]
} }
include_dirs = [ "include" ] include_dirs = [ "include" ]
if (v8_enable_inspector_override) { if (v8_enable_inspector_override) {
...@@ -2390,6 +2384,7 @@ if (is_component_build) { ...@@ -2390,6 +2384,7 @@ if (is_component_build) {
v8_executable("d8") { v8_executable("d8") {
sources = [ sources = [
"$target_gen_dir/d8-js.cc",
"src/d8.cc", "src/d8.cc",
"src/d8.h", "src/d8.h",
] ]
...@@ -2417,9 +2412,6 @@ v8_executable("d8") { ...@@ -2417,9 +2412,6 @@ v8_executable("d8") {
sources += [ "src/d8-windows.cc" ] sources += [ "src/d8-windows.cc" ]
} }
if (!is_component_build) {
sources += [ "$target_gen_dir/d8-js.cc" ]
}
if (v8_enable_i18n_support) { if (v8_enable_i18n_support) {
deps += [ "//third_party/icu" ] deps += [ "//third_party/icu" ]
} }
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#else // V8_OS_WIN #else // V8_OS_WIN
// Setup for Linux shared library export. // Setup for Linux shared library export.
#if V8_HAS_ATTRIBUTE_VISIBILITY && defined(V8_SHARED) #if V8_HAS_ATTRIBUTE_VISIBILITY
# ifdef BUILDING_V8_SHARED # ifdef BUILDING_V8_SHARED
# define V8_EXPORT __attribute__ ((visibility("default"))) # define V8_EXPORT __attribute__ ((visibility("default")))
# else # else
......
...@@ -13,10 +13,10 @@ namespace internal { ...@@ -13,10 +13,10 @@ namespace internal {
// Called when allocation routines fail to allocate. // Called when allocation routines fail to allocate.
// This function should not return, but should terminate the current // This function should not return, but should terminate the current
// processing. // processing.
void FatalProcessOutOfMemory(const char* message); V8_EXPORT_PRIVATE void FatalProcessOutOfMemory(const char* message);
// Superclass for classes managed with new & delete. // Superclass for classes managed with new & delete.
class Malloced { class V8_EXPORT_PRIVATE Malloced {
public: public:
void* operator new(size_t size) { return New(size); } void* operator new(size_t size) { return New(size); }
void operator delete(void* p) { Delete(p); } void operator delete(void* p) { Delete(p); }
...@@ -72,7 +72,7 @@ void DeleteArray(T* array) { ...@@ -72,7 +72,7 @@ void DeleteArray(T* array) {
// The normal strdup functions use malloc. These versions of StrDup // The normal strdup functions use malloc. These versions of StrDup
// and StrNDup uses new and calls the FatalProcessOutOfMemory handler // and StrNDup uses new and calls the FatalProcessOutOfMemory handler
// if allocation fails. // if allocation fails.
char* StrDup(const char* str); V8_EXPORT_PRIVATE char* StrDup(const char* str);
char* StrNDup(const char* str, int n); char* StrNDup(const char* str, int n);
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <vector> #include <vector>
#include "src/base/macros.h" #include "src/base/macros.h"
#include "src/globals.h"
namespace v8 { namespace v8 {
namespace internal { namespace internal {
...@@ -58,15 +59,16 @@ class BasicBlockProfiler { ...@@ -58,15 +59,16 @@ class BasicBlockProfiler {
const DataList* data_list() { return &data_list_; } const DataList* data_list() { return &data_list_; }
private: private:
friend std::ostream& operator<<(std::ostream& os, friend V8_EXPORT_PRIVATE std::ostream& operator<<(
const BasicBlockProfiler& s); std::ostream& os, const BasicBlockProfiler& s);
DataList data_list_; DataList data_list_;
DISALLOW_COPY_AND_ASSIGN(BasicBlockProfiler); DISALLOW_COPY_AND_ASSIGN(BasicBlockProfiler);
}; };
std::ostream& operator<<(std::ostream& os, const BasicBlockProfiler& s); V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
const BasicBlockProfiler& s);
std::ostream& operator<<(std::ostream& os, const BasicBlockProfiler::Data& s); std::ostream& operator<<(std::ostream& os, const BasicBlockProfiler::Data& s);
} // namespace internal } // namespace internal
......
This diff is collapsed.
...@@ -49,10 +49,18 @@ ...@@ -49,10 +49,18 @@
'sources': [ 'sources': [
'd8.h', 'd8.h',
'd8.cc', 'd8.cc',
'<(SHARED_INTERMEDIATE_DIR)/d8-js.cc',
], ],
'conditions': [ 'conditions': [
[ 'want_separate_host_toolset==1', { [ 'want_separate_host_toolset==1', {
'toolsets': [ 'target', ], 'toolsets': [ 'target', ],
'dependencies': [
'd8_js2c#host',
],
}, {
'dependencies': [
'd8_js2c',
],
}], }],
['(OS=="linux" or OS=="mac" or OS=="freebsd" or OS=="netbsd" \ ['(OS=="linux" or OS=="mac" or OS=="freebsd" or OS=="netbsd" \
or OS=="openbsd" or OS=="solaris" or OS=="android" \ or OS=="openbsd" or OS=="solaris" or OS=="android" \
...@@ -63,19 +71,7 @@ ...@@ -63,19 +71,7 @@
'sources': [ 'd8-windows.cc', ] 'sources': [ 'd8-windows.cc', ]
}], }],
[ 'component!="shared_library"', { [ 'component!="shared_library"', {
'sources': [
'<(SHARED_INTERMEDIATE_DIR)/d8-js.cc',
],
'conditions': [ 'conditions': [
[ 'want_separate_host_toolset==1', {
'dependencies': [
'd8_js2c#host',
],
}, {
'dependencies': [
'd8_js2c',
],
}],
[ 'v8_postmortem_support=="true"', { [ 'v8_postmortem_support=="true"', {
'xcode_settings': { 'xcode_settings': {
'OTHER_LDFLAGS': [ 'OTHER_LDFLAGS': [
......
...@@ -5,15 +5,10 @@ ...@@ -5,15 +5,10 @@
#ifndef V8_D8_H_ #ifndef V8_D8_H_
#define V8_D8_H_ #define V8_D8_H_
#ifndef V8_SHARED
#include "src/allocation.h" #include "src/allocation.h"
#include "src/base/hashmap.h" #include "src/base/hashmap.h"
#include "src/base/platform/time.h" #include "src/base/platform/time.h"
#include "src/list.h" #include "src/list.h"
#else
#include "include/v8.h"
#include "src/base/compiler-specific.h"
#endif // !V8_SHARED
#include "src/base/once.h" #include "src/base/once.h"
...@@ -21,7 +16,6 @@ ...@@ -21,7 +16,6 @@
namespace v8 { namespace v8 {
#ifndef V8_SHARED
// A single counter in a counter collection. // A single counter in a counter collection.
class Counter { class Counter {
public: public:
...@@ -90,17 +84,14 @@ class CounterMap { ...@@ -90,17 +84,14 @@ class CounterMap {
static bool Match(void* key1, void* key2); static bool Match(void* key1, void* key2);
base::HashMap hash_map_; base::HashMap hash_map_;
}; };
#endif // !V8_SHARED
class SourceGroup { class SourceGroup {
public: public:
SourceGroup() : SourceGroup() :
#ifndef V8_SHARED
next_semaphore_(0), next_semaphore_(0),
done_semaphore_(0), done_semaphore_(0),
thread_(NULL), thread_(NULL),
#endif // !V8_SHARED
argv_(NULL), argv_(NULL),
begin_offset_(0), begin_offset_(0),
end_offset_(0) {} end_offset_(0) {}
...@@ -116,7 +107,6 @@ class SourceGroup { ...@@ -116,7 +107,6 @@ class SourceGroup {
void Execute(Isolate* isolate); void Execute(Isolate* isolate);
#ifndef V8_SHARED
void StartExecuteInThread(); void StartExecuteInThread();
void WaitForThread(); void WaitForThread();
void JoinThread(); void JoinThread();
...@@ -141,7 +131,6 @@ class SourceGroup { ...@@ -141,7 +131,6 @@ class SourceGroup {
base::Semaphore next_semaphore_; base::Semaphore next_semaphore_;
base::Semaphore done_semaphore_; base::Semaphore done_semaphore_;
base::Thread* thread_; base::Thread* thread_;
#endif // !V8_SHARED
void ExitShell(int exit_code); void ExitShell(int exit_code);
Local<String> ReadFile(Isolate* isolate, const char* name); Local<String> ReadFile(Isolate* isolate, const char* name);
...@@ -151,7 +140,6 @@ class SourceGroup { ...@@ -151,7 +140,6 @@ class SourceGroup {
int end_offset_; int end_offset_;
}; };
#ifndef V8_SHARED
enum SerializationTag { enum SerializationTag {
kSerializationTagUndefined, kSerializationTagUndefined,
kSerializationTagNull, kSerializationTagNull,
...@@ -267,7 +255,6 @@ class Worker { ...@@ -267,7 +255,6 @@ class Worker {
char* script_; char* script_;
base::Atomic32 running_; base::Atomic32 running_;
}; };
#endif // !V8_SHARED
class ShellOptions { class ShellOptions {
...@@ -324,12 +311,7 @@ class ShellOptions { ...@@ -324,12 +311,7 @@ class ShellOptions {
const char* trace_config; const char* trace_config;
}; };
#ifdef V8_SHARED
class Shell {
#else
class Shell : public i::AllStatic { class Shell : public i::AllStatic {
#endif // V8_SHARED
public: public:
enum SourceType { SCRIPT, MODULE }; enum SourceType { SCRIPT, MODULE };
...@@ -351,7 +333,6 @@ class Shell : public i::AllStatic { ...@@ -351,7 +333,6 @@ class Shell : public i::AllStatic {
static void CollectGarbage(Isolate* isolate); static void CollectGarbage(Isolate* isolate);
static void EmptyMessageQueues(Isolate* isolate); static void EmptyMessageQueues(Isolate* isolate);
#ifndef V8_SHARED
// TODO(binji): stupid implementation for now. Is there an easy way to hash an // TODO(binji): stupid implementation for now. Is there an easy way to hash an
// object for use in base::HashMap? By pointer? // object for use in base::HashMap? By pointer?
typedef i::List<Local<Object>> ObjectList; typedef i::List<Local<Object>> ObjectList;
...@@ -372,7 +353,6 @@ class Shell : public i::AllStatic { ...@@ -372,7 +353,6 @@ class Shell : public i::AllStatic {
static void MapCounters(v8::Isolate* isolate, const char* name); static void MapCounters(v8::Isolate* isolate, const char* name);
static void PerformanceNow(const v8::FunctionCallbackInfo<v8::Value>& args); static void PerformanceNow(const v8::FunctionCallbackInfo<v8::Value>& args);
#endif // !V8_SHARED
static void RealmCurrent(const v8::FunctionCallbackInfo<v8::Value>& args); static void RealmCurrent(const v8::FunctionCallbackInfo<v8::Value>& args);
static void RealmOwner(const v8::FunctionCallbackInfo<v8::Value>& args); static void RealmOwner(const v8::FunctionCallbackInfo<v8::Value>& args);
...@@ -450,7 +430,6 @@ class Shell : public i::AllStatic { ...@@ -450,7 +430,6 @@ class Shell : public i::AllStatic {
private: private:
static Global<Context> evaluation_context_; static Global<Context> evaluation_context_;
static base::OnceType quit_once_; static base::OnceType quit_once_;
#ifndef V8_SHARED
static Global<Function> stringify_function_; static Global<Function> stringify_function_;
static CounterMap* counter_map_; static CounterMap* counter_map_;
// We statically allocate a set of local counters to be used if we // We statically allocate a set of local counters to be used if we
...@@ -469,7 +448,6 @@ class Shell : public i::AllStatic { ...@@ -469,7 +448,6 @@ class Shell : public i::AllStatic {
static void WriteIgnitionDispatchCountersFile(v8::Isolate* isolate); static void WriteIgnitionDispatchCountersFile(v8::Isolate* isolate);
static Counter* GetCounter(const char* name, bool is_histogram); static Counter* GetCounter(const char* name, bool is_histogram);
static Local<String> Stringify(Isolate* isolate, Local<Value> value); static Local<String> Stringify(Isolate* isolate, Local<Value> value);
#endif // !V8_SHARED
static void Initialize(Isolate* isolate); static void Initialize(Isolate* isolate);
static void RunShell(Isolate* isolate); static void RunShell(Isolate* isolate);
static bool SetOptions(int argc, char* argv[]); static bool SetOptions(int argc, char* argv[]);
......
...@@ -28,9 +28,8 @@ class Factory final { ...@@ -28,9 +28,8 @@ class Factory final {
byte kind); byte kind);
// Allocates a fixed array initialized with undefined values. // Allocates a fixed array initialized with undefined values.
Handle<FixedArray> NewFixedArray( V8_EXPORT_PRIVATE Handle<FixedArray> NewFixedArray(
int size, int size, PretenureFlag pretenure = NOT_TENURED);
PretenureFlag pretenure = NOT_TENURED);
// Allocate a new fixed array with non-existing entries (the hole). // Allocate a new fixed array with non-existing entries (the hole).
Handle<FixedArray> NewFixedArrayWithHoles( Handle<FixedArray> NewFixedArrayWithHoles(
...@@ -165,9 +164,8 @@ class Factory final { ...@@ -165,9 +164,8 @@ class Factory final {
// UTF8 strings are pretenured when used for regexp literal patterns and // UTF8 strings are pretenured when used for regexp literal patterns and
// flags in the parser. // flags in the parser.
MUST_USE_RESULT MaybeHandle<String> NewStringFromUtf8( MUST_USE_RESULT V8_EXPORT_PRIVATE MaybeHandle<String> NewStringFromUtf8(
Vector<const char> str, Vector<const char> str, PretenureFlag pretenure = NOT_TENURED);
PretenureFlag pretenure = NOT_TENURED);
MUST_USE_RESULT MaybeHandle<String> NewStringFromTwoByte( MUST_USE_RESULT MaybeHandle<String> NewStringFromTwoByte(
Vector<const uc16> str, Vector<const uc16> str,
...@@ -457,11 +455,11 @@ class Factory final { ...@@ -457,11 +455,11 @@ class Factory final {
} }
// Create a JSArray with the given elements. // Create a JSArray with the given elements.
Handle<JSArray> NewJSArrayWithElements(Handle<FixedArrayBase> elements, V8_EXPORT_PRIVATE Handle<JSArray> NewJSArrayWithElements(
ElementsKind elements_kind, int length, Handle<FixedArrayBase> elements, ElementsKind elements_kind, int length,
PretenureFlag pretenure = NOT_TENURED); PretenureFlag pretenure = NOT_TENURED);
Handle<JSArray> NewJSArrayWithElements( V8_EXPORT_PRIVATE Handle<JSArray> NewJSArrayWithElements(
Handle<FixedArrayBase> elements, Handle<FixedArrayBase> elements,
ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND, ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND,
PretenureFlag pretenure = NOT_TENURED) { PretenureFlag pretenure = NOT_TENURED) {
......
...@@ -23,14 +23,21 @@ ...@@ -23,14 +23,21 @@
// this will just be an extern declaration, but for a readonly flag we let the // this will just be an extern declaration, but for a readonly flag we let the
// compiler make better optimizations by giving it the value. // compiler make better optimizations by giving it the value.
#if defined(FLAG_MODE_DECLARE) #if defined(FLAG_MODE_DECLARE)
#define FLAG_FULL(ftype, ctype, nam, def, cmt) extern ctype FLAG_##nam; #define FLAG_FULL(ftype, ctype, nam, def, cmt) \
V8_EXPORT_PRIVATE extern ctype FLAG_##nam;
#define FLAG_READONLY(ftype, ctype, nam, def, cmt) \ #define FLAG_READONLY(ftype, ctype, nam, def, cmt) \
static ctype const FLAG_##nam = def; static ctype const FLAG_##nam = def;
// We want to supply the actual storage and value for the flag variable in the // We want to supply the actual storage and value for the flag variable in the
// .cc file. We only do this for writable flags. // .cc file. We only do this for writable flags.
#elif defined(FLAG_MODE_DEFINE) #elif defined(FLAG_MODE_DEFINE)
#define FLAG_FULL(ftype, ctype, nam, def, cmt) ctype FLAG_##nam = def; #ifdef USING_V8_SHARED
#define FLAG_FULL(ftype, ctype, nam, def, cmt) \
V8_EXPORT_PRIVATE extern ctype FLAG_##nam;
#else
#define FLAG_FULL(ftype, ctype, nam, def, cmt) \
V8_EXPORT_PRIVATE ctype FLAG_##nam = def;
#endif
// We need to define all of our default values so that the Flag structure can // We need to define all of our default values so that the Flag structure can
// access them by pointer. These are just used internally inside of one .cc, // access them by pointer. These are just used internally inside of one .cc,
......
...@@ -14,6 +14,32 @@ ...@@ -14,6 +14,32 @@
#include "src/base/logging.h" #include "src/base/logging.h"
#include "src/base/macros.h" #include "src/base/macros.h"
#ifdef V8_OS_WIN
// Setup for Windows shared library export.
#ifdef BUILDING_V8_SHARED
#define V8_EXPORT_PRIVATE __declspec(dllexport)
#elif USING_V8_SHARED
#define V8_EXPORT_PRIVATE __declspec(dllimport)
#else
#define V8_EXPORT_PRIVATE
#endif // BUILDING_V8_SHARED
#else // V8_OS_WIN
// Setup for Linux shared library export.
#if V8_HAS_ATTRIBUTE_VISIBILITY
#ifdef BUILDING_V8_SHARED
#define V8_EXPORT_PRIVATE __attribute__((visibility("default")))
#else
#define V8_EXPORT_PRIVATE
#endif
#else
#define V8_EXPORT_PRIVATE
#endif
#endif // V8_OS_WIN
// Unfortunately, the INFINITY macro cannot be used with the '-pedantic' // Unfortunately, the INFINITY macro cannot be used with the '-pedantic'
// warning flag and certain versions of GCC due to a bug: // warning flag and certain versions of GCC due to a bug:
// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11931 // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11931
......
...@@ -2426,7 +2426,7 @@ class AllSpaces BASE_EMBEDDED { ...@@ -2426,7 +2426,7 @@ class AllSpaces BASE_EMBEDDED {
// Space iterator for iterating over all old spaces of the heap: Old space // Space iterator for iterating over all old spaces of the heap: Old space
// and code space. Returns each space in turn, and null when it is done. // and code space. Returns each space in turn, and null when it is done.
class OldSpaces BASE_EMBEDDED { class V8_EXPORT_PRIVATE OldSpaces BASE_EMBEDDED {
public: public:
explicit OldSpaces(Heap* heap) : heap_(heap), counter_(OLD_SPACE) {} explicit OldSpaces(Heap* heap) : heap_(heap), counter_(OLD_SPACE) {}
OldSpace* next(); OldSpace* next();
......
...@@ -154,8 +154,8 @@ class IncrementalMarking { ...@@ -154,8 +154,8 @@ class IncrementalMarking {
INLINE(void RecordWriteOfCodeEntry(JSFunction* host, Object** slot, INLINE(void RecordWriteOfCodeEntry(JSFunction* host, Object** slot,
Code* value)); Code* value));
V8_EXPORT_PRIVATE void RecordWriteSlow(HeapObject* obj, Object** slot,
void RecordWriteSlow(HeapObject* obj, Object** slot, Object* value); Object* value);
void RecordWriteIntoCodeSlow(Code* host, RelocInfo* rinfo, Object* value); void RecordWriteIntoCodeSlow(Code* host, RelocInfo* rinfo, Object* value);
void RecordWriteOfCodeEntrySlow(JSFunction* host, Object** slot, Code* value); void RecordWriteOfCodeEntrySlow(JSFunction* host, Object** slot, Code* value);
void RecordCodeTargetPatch(Code* host, Address pc, HeapObject* value); void RecordCodeTargetPatch(Code* host, Address pc, HeapObject* value);
......
...@@ -776,8 +776,7 @@ class EvacuationScope BASE_EMBEDDED { ...@@ -776,8 +776,7 @@ class EvacuationScope BASE_EMBEDDED {
MarkCompactCollector* collector_; MarkCompactCollector* collector_;
}; };
V8_EXPORT_PRIVATE const char* AllocationSpaceName(AllocationSpace space);
const char* AllocationSpaceName(AllocationSpace space);
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
......
...@@ -463,7 +463,7 @@ class MemoryChunk { ...@@ -463,7 +463,7 @@ class MemoryChunk {
} }
inline LocalArrayBufferTracker* local_tracker() { return local_tracker_; } inline LocalArrayBufferTracker* local_tracker() { return local_tracker_; }
void AllocateOldToNewSlots(); V8_EXPORT_PRIVATE void AllocateOldToNewSlots();
void ReleaseOldToNewSlots(); void ReleaseOldToNewSlots();
void AllocateOldToOldSlots(); void AllocateOldToOldSlots();
void ReleaseOldToOldSlots(); void ReleaseOldToOldSlots();
...@@ -1430,7 +1430,7 @@ class MemoryAllocator { ...@@ -1430,7 +1430,7 @@ class MemoryAllocator {
// method which is used to avoid using virtual functions // method which is used to avoid using virtual functions
// iterating a specific space. // iterating a specific space.
class ObjectIterator : public Malloced { class V8_EXPORT_PRIVATE ObjectIterator : public Malloced {
public: public:
virtual ~ObjectIterator() {} virtual ~ObjectIterator() {}
virtual HeapObject* Next() = 0; virtual HeapObject* Next() = 0;
...@@ -1481,7 +1481,7 @@ class PageRange { ...@@ -1481,7 +1481,7 @@ class PageRange {
// If objects are allocated in the page during iteration the iterator may // If objects are allocated in the page during iteration the iterator may
// or may not iterate over those objects. The caller must create a new // or may not iterate over those objects. The caller must create a new
// iterator in order to be sure to visit these new objects. // iterator in order to be sure to visit these new objects.
class HeapObjectIterator : public ObjectIterator { class V8_EXPORT_PRIVATE HeapObjectIterator : public ObjectIterator {
public: public:
// Creates a new object iterator in a given space. // Creates a new object iterator in a given space.
explicit HeapObjectIterator(PagedSpace* space); explicit HeapObjectIterator(PagedSpace* space);
......
...@@ -106,10 +106,7 @@ config("inspector_config") { ...@@ -106,10 +106,7 @@ config("inspector_config") {
] ]
} }
if (is_component_build) { if (is_component_build) {
defines = [ defines = [ "BUILDING_V8_SHARED" ]
"V8_SHARED",
"BUILDING_V8_SHARED",
]
} }
} }
......
...@@ -56,7 +56,7 @@ class Interpreter { ...@@ -56,7 +56,7 @@ class Interpreter {
void TraceCodegen(Handle<Code> code); void TraceCodegen(Handle<Code> code);
const char* LookupNameOfBytecodeHandler(Code* code); const char* LookupNameOfBytecodeHandler(Code* code);
Local<v8::Object> GetDispatchCountersObject(); V8_EXPORT_PRIVATE Local<v8::Object> GetDispatchCountersObject();
Address dispatch_table_address() { Address dispatch_table_address() {
return reinterpret_cast<Address>(&dispatch_table_[0]); return reinterpret_cast<Address>(&dispatch_table_[0]);
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "include/v8config.h" #include "include/v8config.h"
#include "src/base/macros.h" #include "src/base/macros.h"
#include "src/globals.h"
namespace v8 { namespace v8 {
namespace internal { namespace internal {
...@@ -33,7 +34,7 @@ class OFStreamBase : public std::streambuf { ...@@ -33,7 +34,7 @@ class OFStreamBase : public std::streambuf {
// An output stream writing to a file. // An output stream writing to a file.
class OFStream : public std::ostream { class V8_EXPORT_PRIVATE OFStream : public std::ostream {
public: public:
explicit OFStream(FILE* f); explicit OFStream(FILE* f);
virtual ~OFStream(); virtual ~OFStream();
......
...@@ -22,8 +22,15 @@ enum NativeType { ...@@ -22,8 +22,15 @@ enum NativeType {
TEST TEST
}; };
// Extra handling for V8_EXPORT_PRIVATE in combination with USING_V8_SHARED
// since definition of methods of classes marked as dllimport is not allowed.
template <NativeType type> template <NativeType type>
#ifdef USING_V8_SHARED
class NativesCollection { class NativesCollection {
#else
class V8_EXPORT_PRIVATE NativesCollection {
#endif // USING_V8_SHARED
public: public:
// The following methods are implemented in js2c-generated code: // The following methods are implemented in js2c-generated code:
......
...@@ -387,8 +387,8 @@ void MemCopyUint16Uint8Wrapper(uint16_t* dest, const uint8_t* src, ...@@ -387,8 +387,8 @@ void MemCopyUint16Uint8Wrapper(uint16_t* dest, const uint8_t* src,
} }
} }
V8_EXPORT_PRIVATE MemCopyUint8Function memcopy_uint8_function =
MemCopyUint8Function memcopy_uint8_function = &MemCopyUint8Wrapper; &MemCopyUint8Wrapper;
MemCopyUint16Uint8Function memcopy_uint16_uint8_function = MemCopyUint16Uint8Function memcopy_uint16_uint8_function =
&MemCopyUint16Uint8Wrapper; &MemCopyUint16Uint8Wrapper;
// Defined in codegen-arm.cc. // Defined in codegen-arm.cc.
...@@ -398,7 +398,8 @@ MemCopyUint16Uint8Function CreateMemCopyUint16Uint8Function( ...@@ -398,7 +398,8 @@ MemCopyUint16Uint8Function CreateMemCopyUint16Uint8Function(
Isolate* isolate, MemCopyUint16Uint8Function stub); Isolate* isolate, MemCopyUint16Uint8Function stub);
#elif V8_OS_POSIX && V8_HOST_ARCH_MIPS #elif V8_OS_POSIX && V8_HOST_ARCH_MIPS
MemCopyUint8Function memcopy_uint8_function = &MemCopyUint8Wrapper; V8_EXPORT_PRIVATE MemCopyUint8Function memcopy_uint8_function =
&MemCopyUint8Wrapper;
// Defined in codegen-mips.cc. // Defined in codegen-mips.cc.
MemCopyUint8Function CreateMemCopyUint8Function(Isolate* isolate, MemCopyUint8Function CreateMemCopyUint8Function(Isolate* isolate,
MemCopyUint8Function stub); MemCopyUint8Function stub);
......
...@@ -437,7 +437,7 @@ void init_memcopy_functions(Isolate* isolate); ...@@ -437,7 +437,7 @@ void init_memcopy_functions(Isolate* isolate);
const int kMinComplexMemCopy = 64; const int kMinComplexMemCopy = 64;
// Copy memory area. No restrictions. // Copy memory area. No restrictions.
void MemMove(void* dest, const void* src, size_t size); V8_EXPORT_PRIVATE void MemMove(void* dest, const void* src, size_t size);
typedef void (*MemMoveFunction)(void* dest, const void* src, size_t size); typedef void (*MemMoveFunction)(void* dest, const void* src, size_t size);
// Keep the distinction of "move" vs. "copy" for the benefit of other // Keep the distinction of "move" vs. "copy" for the benefit of other
...@@ -448,7 +448,7 @@ V8_INLINE void MemCopy(void* dest, const void* src, size_t size) { ...@@ -448,7 +448,7 @@ V8_INLINE void MemCopy(void* dest, const void* src, size_t size) {
#elif defined(V8_HOST_ARCH_ARM) #elif defined(V8_HOST_ARCH_ARM)
typedef void (*MemCopyUint8Function)(uint8_t* dest, const uint8_t* src, typedef void (*MemCopyUint8Function)(uint8_t* dest, const uint8_t* src,
size_t size); size_t size);
extern MemCopyUint8Function memcopy_uint8_function; V8_EXPORT_PRIVATE extern MemCopyUint8Function memcopy_uint8_function;
V8_INLINE void MemCopyUint8Wrapper(uint8_t* dest, const uint8_t* src, V8_INLINE void MemCopyUint8Wrapper(uint8_t* dest, const uint8_t* src,
size_t chars) { size_t chars) {
memcpy(dest, src, chars); memcpy(dest, src, chars);
...@@ -459,7 +459,8 @@ V8_INLINE void MemCopy(void* dest, const void* src, size_t size) { ...@@ -459,7 +459,8 @@ V8_INLINE void MemCopy(void* dest, const void* src, size_t size) {
(*memcopy_uint8_function)(reinterpret_cast<uint8_t*>(dest), (*memcopy_uint8_function)(reinterpret_cast<uint8_t*>(dest),
reinterpret_cast<const uint8_t*>(src), size); reinterpret_cast<const uint8_t*>(src), size);
} }
V8_INLINE void MemMove(void* dest, const void* src, size_t size) { V8_EXPORT_PRIVATE V8_INLINE void MemMove(void* dest, const void* src,
size_t size) {
memmove(dest, src, size); memmove(dest, src, size);
} }
...@@ -477,7 +478,7 @@ V8_INLINE void MemCopyUint16Uint8(uint16_t* dest, const uint8_t* src, ...@@ -477,7 +478,7 @@ V8_INLINE void MemCopyUint16Uint8(uint16_t* dest, const uint8_t* src,
#elif defined(V8_HOST_ARCH_MIPS) #elif defined(V8_HOST_ARCH_MIPS)
typedef void (*MemCopyUint8Function)(uint8_t* dest, const uint8_t* src, typedef void (*MemCopyUint8Function)(uint8_t* dest, const uint8_t* src,
size_t size); size_t size);
extern MemCopyUint8Function memcopy_uint8_function; V8_EXPORT_PRIVATE extern MemCopyUint8Function memcopy_uint8_function;
V8_INLINE void MemCopyUint8Wrapper(uint8_t* dest, const uint8_t* src, V8_INLINE void MemCopyUint8Wrapper(uint8_t* dest, const uint8_t* src,
size_t chars) { size_t chars) {
memcpy(dest, src, chars); memcpy(dest, src, chars);
...@@ -488,7 +489,8 @@ V8_INLINE void MemCopy(void* dest, const void* src, size_t size) { ...@@ -488,7 +489,8 @@ V8_INLINE void MemCopy(void* dest, const void* src, size_t size) {
(*memcopy_uint8_function)(reinterpret_cast<uint8_t*>(dest), (*memcopy_uint8_function)(reinterpret_cast<uint8_t*>(dest),
reinterpret_cast<const uint8_t*>(src), size); reinterpret_cast<const uint8_t*>(src), size);
} }
V8_INLINE void MemMove(void* dest, const void* src, size_t size) { V8_EXPORT_PRIVATE V8_INLINE void MemMove(void* dest, const void* src,
size_t size) {
memmove(dest, src, size); memmove(dest, src, size);
} }
#else #else
...@@ -496,7 +498,8 @@ V8_INLINE void MemMove(void* dest, const void* src, size_t size) { ...@@ -496,7 +498,8 @@ V8_INLINE void MemMove(void* dest, const void* src, size_t size) {
V8_INLINE void MemCopy(void* dest, const void* src, size_t size) { V8_INLINE void MemCopy(void* dest, const void* src, size_t size) {
memcpy(dest, src, size); memcpy(dest, src, size);
} }
V8_INLINE void MemMove(void* dest, const void* src, size_t size) { V8_EXPORT_PRIVATE V8_INLINE void MemMove(void* dest, const void* src,
size_t size) {
memmove(dest, src, size); memmove(dest, src, size);
} }
const int kMinComplexMemCopy = 16 * kPointerSize; const int kMinComplexMemCopy = 16 * kPointerSize;
......
...@@ -61,12 +61,10 @@ ...@@ -61,12 +61,10 @@
'..', '..',
], ],
'defines': [ 'defines': [
'V8_SHARED',
'BUILDING_V8_SHARED', 'BUILDING_V8_SHARED',
], ],
'direct_dependent_settings': { 'direct_dependent_settings': {
'defines': [ 'defines': [
'V8_SHARED',
'USING_V8_SHARED', 'USING_V8_SHARED',
], ],
}, },
...@@ -164,12 +162,10 @@ ...@@ -164,12 +162,10 @@
}], }],
['component=="shared_library"', { ['component=="shared_library"', {
'defines': [ 'defines': [
'V8_SHARED',
'BUILDING_V8_SHARED', 'BUILDING_V8_SHARED',
], ],
'direct_dependent_settings': { 'direct_dependent_settings': {
'defines': [ 'defines': [
'V8_SHARED',
'USING_V8_SHARED', 'USING_V8_SHARED',
], ],
}, },
...@@ -259,7 +255,6 @@ ...@@ -259,7 +255,6 @@
['component=="shared_library"', { ['component=="shared_library"', {
'defines': [ 'defines': [
'BUILDING_V8_SHARED', 'BUILDING_V8_SHARED',
'V8_SHARED',
], ],
}], }],
] ]
...@@ -286,12 +281,10 @@ ...@@ -286,12 +281,10 @@
}], }],
['component=="shared_library"', { ['component=="shared_library"', {
'defines': [ 'defines': [
'V8_SHARED',
'BUILDING_V8_SHARED', 'BUILDING_V8_SHARED',
], ],
'direct_dependent_settings': { 'direct_dependent_settings': {
'defines': [ 'defines': [
'V8_SHARED',
'USING_V8_SHARED', 'USING_V8_SHARED',
], ],
}, },
...@@ -1713,7 +1706,6 @@ ...@@ -1713,7 +1706,6 @@
['component=="shared_library"', { ['component=="shared_library"', {
'defines': [ 'defines': [
'BUILDING_V8_SHARED', 'BUILDING_V8_SHARED',
'V8_SHARED',
], ],
}], }],
['v8_postmortem_support=="true"', { ['v8_postmortem_support=="true"', {
......
...@@ -5,13 +5,8 @@ ...@@ -5,13 +5,8 @@
#ifndef V8_WASM_JS_H_ #ifndef V8_WASM_JS_H_
#define V8_WASM_JS_H_ #define V8_WASM_JS_H_
#ifndef V8_SHARED
#include "src/allocation.h" #include "src/allocation.h"
#include "src/base/hashmap.h" #include "src/base/hashmap.h"
#else
#include "include/v8.h"
#include "src/base/compiler-specific.h"
#endif // !V8_SHARED
namespace v8 { namespace v8 {
namespace internal { namespace internal {
......
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