Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
deps: V8: cherry-pick e8e324aa9d5f
Original commit message:

    Fix MSVC component build

    Add the necessary V8_EXPORT_PRIVATE attributes and a few other minor
    changes to make building DLLs with MSVC happy. (Note: Debug builds still
    seem to be failing in Torque, but this fixes Release builds).

    Bug: v8:8791
    Change-Id: Ia4d5372fd1cb961e6268a2b5c089bcd17822f1e5
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1996157
    Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
    Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
    Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
    Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#65822}

Refs: v8/v8@e8e324a
  • Loading branch information
mmarchini committed Mar 5, 2020
commit 1d54faf5f9bcce44b15d35f2295a2b8d78c4cc21
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.9',
'v8_embedder_string': '-node.10',

##### V8 defaults for Node.js #####

Expand Down
4 changes: 4 additions & 0 deletions deps/v8/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,10 @@ config("toolchain") {
]
}

if (!is_clang && is_win) {
cflags += [ "/wd4506" ] # Benign "no definition for inline function"
}

if (!is_clang && !is_win) {
cflags += [
# Disable gcc warnings for optimizations based on the assumption that
Expand Down
12 changes: 6 additions & 6 deletions deps/v8/src/codegen/code-stub-assembler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7829,12 +7829,12 @@ TNode<MaybeObject> CodeStubAssembler::LoadFieldTypeByDescriptorEntry(
DescriptorArray::ToValueIndex(0) * kTaggedSize);
}

template TNode<IntPtrT> CodeStubAssembler::EntryToIndex<NameDictionary>(
TNode<IntPtrT>, int);
template TNode<IntPtrT> CodeStubAssembler::EntryToIndex<GlobalDictionary>(
TNode<IntPtrT>, int);
template TNode<IntPtrT> CodeStubAssembler::EntryToIndex<NumberDictionary>(
TNode<IntPtrT>, int);
template V8_EXPORT_PRIVATE TNode<IntPtrT>
CodeStubAssembler::EntryToIndex<NameDictionary>(TNode<IntPtrT>, int);
template V8_EXPORT_PRIVATE TNode<IntPtrT>
CodeStubAssembler::EntryToIndex<GlobalDictionary>(TNode<IntPtrT>, int);
template V8_EXPORT_PRIVATE TNode<IntPtrT>
CodeStubAssembler::EntryToIndex<NumberDictionary>(TNode<IntPtrT>, int);

// This must be kept in sync with HashTableBase::ComputeCapacity().
TNode<IntPtrT> CodeStubAssembler::HashTableComputeCapacity(
Expand Down
5 changes: 2 additions & 3 deletions deps/v8/src/codegen/code-stub-assembler.h
Original file line number Diff line number Diff line change
Expand Up @@ -2871,10 +2871,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// Calculates array index for given dictionary entry and entry field.
// See Dictionary::EntryToIndex().
template <typename Dictionary>
V8_EXPORT_PRIVATE TNode<IntPtrT> EntryToIndex(TNode<IntPtrT> entry,
int field_index);
TNode<IntPtrT> EntryToIndex(TNode<IntPtrT> entry, int field_index);
template <typename Dictionary>
V8_EXPORT_PRIVATE TNode<IntPtrT> EntryToIndex(TNode<IntPtrT> entry) {
TNode<IntPtrT> EntryToIndex(TNode<IntPtrT> entry) {
return EntryToIndex<Dictionary>(entry, Dictionary::kEntryKeyIndex);
}

Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/objects/dictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class V8_EXPORT_PRIVATE NameDictionary
BaseNameDictionary<NameDictionary, NameDictionaryShape>);
};

class GlobalDictionaryShape : public NameDictionaryShape {
class V8_EXPORT_PRIVATE GlobalDictionaryShape : public NameDictionaryShape {
public:
static inline bool IsMatch(Handle<Name> key, Object other);
static inline uint32_t HashForObject(ReadOnlyRoots roots, Object object);
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/objects/hash-table.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace internal {
// information by subclasses.

template <typename KeyT>
class BaseShape {
class V8_EXPORT_PRIVATE BaseShape {
public:
using Key = KeyT;
static inline RootIndex GetMapRootIndex();
Expand Down
12 changes: 6 additions & 6 deletions deps/v8/src/objects/string-table.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class StringTableKey {
int length_;
};

class StringTableShape : public BaseShape<StringTableKey*> {
class V8_EXPORT_PRIVATE StringTableShape : public BaseShape<StringTableKey*> {
public:
static inline bool IsMatch(Key key, Object value);

Expand All @@ -59,12 +59,12 @@ class SeqOneByteString;
//
// No special elements in the prefix and the element size is 1
// because only the string itself (the key) needs to be stored.
class StringTable : public HashTable<StringTable, StringTableShape> {
class V8_EXPORT_PRIVATE StringTable
: public HashTable<StringTable, StringTableShape> {
public:
// Find string in the string table. If it is not there yet, it is
// added. The return value is the string found.
V8_EXPORT_PRIVATE static Handle<String> LookupString(Isolate* isolate,
Handle<String> key);
static Handle<String> LookupString(Isolate* isolate, Handle<String> key);
template <typename StringTableKey>
static Handle<String> LookupKey(Isolate* isolate, StringTableKey* key);
static Handle<String> AddKeyNoResize(Isolate* isolate, StringTableKey* key);
Expand All @@ -77,8 +77,8 @@ class StringTable : public HashTable<StringTable, StringTableShape> {
// {raw_string} must be a tagged String pointer.
// Returns a tagged pointer: either an internalized string, or a Smi
// sentinel.
V8_EXPORT_PRIVATE static Address LookupStringIfExists_NoAllocate(
Isolate* isolate, Address raw_string);
static Address LookupStringIfExists_NoAllocate(Isolate* isolate,
Address raw_string);

static void EnsureCapacityForDeserialization(Isolate* isolate, int expected);

Expand Down
8 changes: 4 additions & 4 deletions deps/v8/src/strings/unicode-decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ void Utf8Decoder::Decode(Char* out, const Vector<const uint8_t>& data) {
if (t != unibrow::Utf8::kBufferEmpty) *out = static_cast<Char>(t);
}

template void Utf8Decoder::Decode(uint8_t* out,
const Vector<const uint8_t>& data);
template V8_EXPORT_PRIVATE void Utf8Decoder::Decode(
uint8_t* out, const Vector<const uint8_t>& data);

template void Utf8Decoder::Decode(uint16_t* out,
const Vector<const uint8_t>& data);
template V8_EXPORT_PRIVATE void Utf8Decoder::Decode(
uint16_t* out, const Vector<const uint8_t>& data);

} // namespace internal
} // namespace v8
2 changes: 1 addition & 1 deletion deps/v8/src/torque/contextual.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ContextualVariable {

private:
template <class T>
friend typename T::Scope*& ContextualVariableTop();
friend V8_EXPORT_PRIVATE typename T::Scope*& ContextualVariableTop();
static Scope*& Top() { return ContextualVariableTop<Derived>(); }

static bool HasScope() { return Top() != nullptr; }
Expand Down
2 changes: 2 additions & 0 deletions deps/v8/src/utils/allocation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ bool OnCriticalMemoryPressure(size_t length) {
return true;
}

VirtualMemory::VirtualMemory() = default;

VirtualMemory::VirtualMemory(v8::PageAllocator* page_allocator, size_t size,
void* hint, size_t alignment)
: page_allocator_(page_allocator) {
Expand Down
21 changes: 11 additions & 10 deletions deps/v8/src/utils/allocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,18 @@ inline bool SetPermissions(v8::PageAllocator* page_allocator, Address address,
V8_EXPORT_PRIVATE bool OnCriticalMemoryPressure(size_t length);

// Represents and controls an area of reserved memory.
class V8_EXPORT_PRIVATE VirtualMemory final {
class VirtualMemory final {
public:
// Empty VirtualMemory object, controlling no reserved memory.
VirtualMemory() = default;
V8_EXPORT_PRIVATE VirtualMemory();

// Reserves virtual memory containing an area of the given size that is
// aligned per |alignment| rounded up to the |page_allocator|'s allocate page
// size. The |size| must be aligned with |page_allocator|'s commit page size.
// This may not be at the position returned by address().
VirtualMemory(v8::PageAllocator* page_allocator, size_t size, void* hint,
size_t alignment = 1);
V8_EXPORT_PRIVATE VirtualMemory(v8::PageAllocator* page_allocator,
size_t size, void* hint,
size_t alignment = 1);

// Construct a virtual memory by assigning it some already mapped address
// and size.
Expand All @@ -171,7 +172,7 @@ class V8_EXPORT_PRIVATE VirtualMemory final {

// Releases the reserved memory, if any, controlled by this VirtualMemory
// object.
~VirtualMemory();
V8_EXPORT_PRIVATE ~VirtualMemory();

// Move constructor.
VirtualMemory(VirtualMemory&& other) V8_NOEXCEPT { *this = std::move(other); }
Expand All @@ -189,7 +190,7 @@ class V8_EXPORT_PRIVATE VirtualMemory final {
bool IsReserved() const { return region_.begin() != kNullAddress; }

// Initialize or resets an embedded VirtualMemory object.
void Reset();
V8_EXPORT_PRIVATE void Reset();

v8::PageAllocator* page_allocator() { return page_allocator_; }

Expand Down Expand Up @@ -217,14 +218,14 @@ class V8_EXPORT_PRIVATE VirtualMemory final {

// Sets permissions according to the access argument. address and size must be
// multiples of CommitPageSize(). Returns true on success, otherwise false.
bool SetPermissions(Address address, size_t size,
PageAllocator::Permission access);
V8_EXPORT_PRIVATE bool SetPermissions(Address address, size_t size,
PageAllocator::Permission access);

// Releases memory after |free_start|. Returns the number of bytes released.
size_t Release(Address free_start);
V8_EXPORT_PRIVATE size_t Release(Address free_start);

// Frees all memory.
void Free();
V8_EXPORT_PRIVATE void Free();

bool InVM(Address address, size_t size) {
return region_.contains(address, size);
Expand Down