Commit 75ae54c5 authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[cctest] Add V8_EXPORT_PRIVATE for cctest (objects part)

Bug: v8:9020

Change-Id: I1b9f3c0c805709c6570785ec9f1045f21c9d03e4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1541048Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60638}
parent 20affe42
......@@ -350,7 +350,7 @@ class JSArrayBufferView::BodyDescriptor final : public BodyDescriptorBase {
};
template <typename Derived>
class SmallOrderedHashTable<Derived>::BodyDescriptor final
class V8_EXPORT_PRIVATE SmallOrderedHashTable<Derived>::BodyDescriptor final
: public BodyDescriptorBase {
public:
static bool IsValidSlot(Map map, HeapObject obj, int offset) {
......
......@@ -7605,14 +7605,6 @@ BaseNameDictionary<Derived, Shape>::AddNoUpdateNextEnumerationIndex(
details, entry_out);
}
// GCC workaround: Explicitly instantiate template method for NameDictionary
// to avoid "undefined reference" issues during linking.
template Handle<NameDictionary>
BaseNameDictionary<NameDictionary, NameDictionaryShape>::
AddNoUpdateNextEnumerationIndex(Isolate* isolate, Handle<NameDictionary>,
Handle<Name>, Handle<Object>,
PropertyDetails, int*);
template <typename Derived, typename Shape>
Handle<Derived> BaseNameDictionary<Derived, Shape>::Add(
Isolate* isolate, Handle<Derived> dictionary, Key key, Handle<Object> value,
......@@ -8443,19 +8435,35 @@ Address Smi::LexicographicCompare(Isolate* isolate, Smi x, Smi y) {
template class HashTable<StringTable, StringTableShape>;
template class HashTable<CompilationCacheTable, CompilationCacheShape>;
template class EXPORT_TEMPLATE_DEFINE(
V8_EXPORT_PRIVATE) HashTable<CompilationCacheTable, CompilationCacheShape>;
template class HashTable<ObjectHashTable, ObjectHashTableShape>;
template class EXPORT_TEMPLATE_DEFINE(
V8_EXPORT_PRIVATE) HashTable<ObjectHashTable, ObjectHashTableShape>;
template class HashTable<EphemeronHashTable, EphemeronHashTableShape>;
template class EXPORT_TEMPLATE_DEFINE(
V8_EXPORT_PRIVATE) HashTable<ObjectHashSet, ObjectHashSetShape>;
template class ObjectHashTableBase<ObjectHashTable, ObjectHashTableShape>;
template class EXPORT_TEMPLATE_DEFINE(V8_EXPORT_PRIVATE)
ObjectHashTableBase<ObjectHashTable, ObjectHashTableShape>;
template class ObjectHashTableBase<EphemeronHashTable, EphemeronHashTableShape>;
template class EXPORT_TEMPLATE_DEFINE(
V8_EXPORT_PRIVATE) HashTable<EphemeronHashTable, EphemeronHashTableShape>;
template class EXPORT_TEMPLATE_DEFINE(V8_EXPORT_PRIVATE)
ObjectHashTableBase<EphemeronHashTable, EphemeronHashTableShape>;
template class EXPORT_TEMPLATE_DEFINE(V8_EXPORT_PRIVATE)
BaseNameDictionary<NameDictionary, NameDictionaryShape>;
template class EXPORT_TEMPLATE_DEFINE(V8_EXPORT_PRIVATE)
BaseNameDictionary<GlobalDictionary, GlobalDictionaryShape>;
template class Dictionary<NameDictionary, NameDictionaryShape>;
template class EXPORT_TEMPLATE_DEFINE(V8_EXPORT_PRIVATE)
Dictionary<NameDictionary, NameDictionaryShape>;
template class Dictionary<GlobalDictionary, GlobalDictionaryShape>;
template class EXPORT_TEMPLATE_DEFINE(V8_EXPORT_PRIVATE)
Dictionary<GlobalDictionary, GlobalDictionaryShape>;
template class EXPORT_TEMPLATE_DEFINE(
V8_EXPORT_PRIVATE) HashTable<NumberDictionary, NumberDictionaryShape>;
......@@ -8469,74 +8477,16 @@ template class EXPORT_TEMPLATE_DEFINE(V8_EXPORT_PRIVATE)
template class EXPORT_TEMPLATE_DEFINE(V8_EXPORT_PRIVATE)
Dictionary<SimpleNumberDictionary, SimpleNumberDictionaryShape>;
template Handle<NameDictionary>
BaseNameDictionary<NameDictionary, NameDictionaryShape>::New(
Isolate*, int n, AllocationType allocation,
MinimumCapacity capacity_option);
template Handle<GlobalDictionary>
BaseNameDictionary<GlobalDictionary, GlobalDictionaryShape>::New(
Isolate*, int n, AllocationType allocation,
MinimumCapacity capacity_option);
template Handle<NameDictionary>
HashTable<NameDictionary, NameDictionaryShape>::New(Isolate*, int,
AllocationType,
MinimumCapacity);
template Handle<ObjectHashSet>
HashTable<ObjectHashSet, ObjectHashSetShape>::New(Isolate*, int n,
AllocationType,
MinimumCapacity);
template Handle<NameDictionary>
template V8_EXPORT_PRIVATE Handle<NameDictionary>
HashTable<NameDictionary, NameDictionaryShape>::Shrink(Isolate* isolate,
Handle<NameDictionary>,
int additionalCapacity);
template Handle<NameDictionary>
BaseNameDictionary<NameDictionary, NameDictionaryShape>::Add(
Isolate* isolate, Handle<NameDictionary>, Handle<Name>, Handle<Object>,
PropertyDetails, int*);
template Handle<GlobalDictionary>
BaseNameDictionary<GlobalDictionary, GlobalDictionaryShape>::Add(
Isolate* isolate, Handle<GlobalDictionary>, Handle<Name>, Handle<Object>,
PropertyDetails, int*);
template void HashTable<GlobalDictionary, GlobalDictionaryShape>::Rehash(
ReadOnlyRoots roots);
template Handle<NameDictionary>
BaseNameDictionary<NameDictionary, NameDictionaryShape>::EnsureCapacity(
Isolate* isolate, Handle<NameDictionary>, int);
template void
BaseNameDictionary<GlobalDictionary, GlobalDictionaryShape>::CopyEnumKeysTo(
Isolate* isolate, Handle<GlobalDictionary> dictionary,
Handle<FixedArray> storage, KeyCollectionMode mode,
KeyAccumulator* accumulator);
template void
BaseNameDictionary<NameDictionary, NameDictionaryShape>::CopyEnumKeysTo(
Isolate* isolate, Handle<NameDictionary> dictionary,
Handle<FixedArray> storage, KeyCollectionMode mode,
KeyAccumulator* accumulator);
template Handle<FixedArray>
BaseNameDictionary<GlobalDictionary, GlobalDictionaryShape>::IterationIndices(
Isolate* isolate, Handle<GlobalDictionary> dictionary);
template void
BaseNameDictionary<GlobalDictionary, GlobalDictionaryShape>::CollectKeysTo(
Handle<GlobalDictionary> dictionary, KeyAccumulator* keys);
template Handle<FixedArray>
BaseNameDictionary<NameDictionary, NameDictionaryShape>::IterationIndices(
Isolate* isolate, Handle<NameDictionary> dictionary);
template void
BaseNameDictionary<NameDictionary, NameDictionaryShape>::CollectKeysTo(
Handle<NameDictionary> dictionary, KeyAccumulator* keys);
void JSFinalizationGroup::Cleanup(
Handle<JSFinalizationGroup> finalization_group, Isolate* isolate) {
// It's possible that the cleared_cells list is empty, since
......
......@@ -642,8 +642,8 @@ class Object {
Handle<FieldType> OptimalType(Isolate* isolate,
Representation representation);
static Handle<Object> NewStorageFor(Isolate* isolate, Handle<Object> object,
Representation representation);
V8_EXPORT_PRIVATE static Handle<Object> NewStorageFor(
Isolate* isolate, Handle<Object> object, Representation representation);
static Handle<Object> WrapForRead(Isolate* isolate, Handle<Object> object,
Representation representation);
......@@ -653,20 +653,19 @@ class Object {
inline bool HasValidElements();
// ECMA-262 9.2.
bool BooleanValue(Isolate* isolate);
V8_EXPORT_PRIVATE bool BooleanValue(Isolate* isolate);
Object ToBoolean(Isolate* isolate);
// ES6 section 7.2.11 Abstract Relational Comparison
V8_WARN_UNUSED_RESULT static Maybe<ComparisonResult> Compare(
Isolate* isolate, Handle<Object> x, Handle<Object> y);
V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT static Maybe<ComparisonResult>
Compare(Isolate* isolate, Handle<Object> x, Handle<Object> y);
// ES6 section 7.2.12 Abstract Equality Comparison
V8_WARN_UNUSED_RESULT static Maybe<bool> Equals(Isolate* isolate,
Handle<Object> x,
Handle<Object> y);
V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT static Maybe<bool> Equals(
Isolate* isolate, Handle<Object> x, Handle<Object> y);
// ES6 section 7.2.13 Strict Equality Comparison
bool StrictEquals(Object that);
V8_EXPORT_PRIVATE bool StrictEquals(Object that);
// ES6 section 7.1.13 ToObject
// Convert to a JSObject if needed.
......@@ -717,8 +716,8 @@ class Object {
V8_WARN_UNUSED_RESULT static inline MaybeHandle<String> ToString(
Isolate* isolate, Handle<Object> input);
static Handle<String> NoSideEffectsToString(Isolate* isolate,
Handle<Object> input);
V8_EXPORT_PRIVATE static Handle<String> NoSideEffectsToString(
Isolate* isolate, Handle<Object> input);
// ES6 section 7.1.14 ToPropertyKey
V8_WARN_UNUSED_RESULT static inline MaybeHandle<Object> ToPropertyKey(
......@@ -783,13 +782,14 @@ class Object {
// In some cases, an exception is thrown regardless of the ShouldThrow
// argument. These cases are either in accordance with the spec or not
// covered by it (eg., concerning API callbacks).
V8_WARN_UNUSED_RESULT static Maybe<bool> SetProperty(
V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT static Maybe<bool> SetProperty(
LookupIterator* it, Handle<Object> value, StoreOrigin store_origin,
Maybe<ShouldThrow> should_throw = Nothing<ShouldThrow>());
V8_WARN_UNUSED_RESULT static MaybeHandle<Object> SetProperty(
Isolate* isolate, Handle<Object> object, Handle<Name> name,
Handle<Object> value, StoreOrigin store_origin = StoreOrigin::kMaybeKeyed,
Maybe<ShouldThrow> should_throw = Nothing<ShouldThrow>());
V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT static MaybeHandle<Object>
SetProperty(Isolate* isolate, Handle<Object> object, Handle<Name> name,
Handle<Object> value,
StoreOrigin store_origin = StoreOrigin::kMaybeKeyed,
Maybe<ShouldThrow> should_throw = Nothing<ShouldThrow>());
V8_WARN_UNUSED_RESULT static inline MaybeHandle<Object> SetPropertyOrElement(
Isolate* isolate, Handle<Object> object, Handle<Name> name,
Handle<Object> value,
......@@ -850,7 +850,7 @@ class Object {
// Returns the permanent hash code associated with this object depending on
// the actual object type. May create and store a hash code if needed and none
// exists.
Smi GetOrCreateHash(Isolate* isolate);
V8_EXPORT_PRIVATE Smi GetOrCreateHash(Isolate* isolate);
// Checks whether this object has the same value as the given one. This
// function is implemented according to ES5, section 9.12 and can be used
......@@ -914,7 +914,7 @@ class Object {
// to a HeapObject.
inline bool IsCleared() const { return false; }
DECL_VERIFIER(Object)
EXPORT_DECL_VERIFIER(Object)
#ifdef VERIFY_HEAP
// Verify a pointer is a valid object pointer.
......@@ -924,12 +924,12 @@ class Object {
inline void VerifyApiCallResultType();
// Prints this object without details.
void ShortPrint(FILE* out = stdout) const;
V8_EXPORT_PRIVATE void ShortPrint(FILE* out = stdout) const;
// Prints this object without details to a message accumulator.
void ShortPrint(StringStream* accumulator) const;
V8_EXPORT_PRIVATE void ShortPrint(StringStream* accumulator) const;
void ShortPrint(std::ostream& os) const; // NOLINT
V8_EXPORT_PRIVATE void ShortPrint(std::ostream& os) const; // NOLINT
inline static Object cast(Object object) { return object; }
inline static Object unchecked_cast(Object object) { return object; }
......@@ -939,10 +939,10 @@ class Object {
#ifdef OBJECT_PRINT
// For our gdb macros, we should perhaps change these in the future.
void Print() const;
V8_EXPORT_PRIVATE void Print() const;
// Prints this object with details.
void Print(std::ostream& os) const; // NOLINT
V8_EXPORT_PRIVATE void Print(std::ostream& os) const; // NOLINT
#else
void Print() const { ShortPrint(); }
void Print(std::ostream& os) const { ShortPrint(os); } // NOLINT
......@@ -990,8 +990,8 @@ class Object {
Isolate* isolate, Handle<Object> input);
V8_WARN_UNUSED_RESULT static MaybeHandle<Object> ConvertToPropertyKey(
Isolate* isolate, Handle<Object> value);
V8_WARN_UNUSED_RESULT static MaybeHandle<String> ConvertToString(
Isolate* isolate, Handle<Object> input);
V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT static MaybeHandle<String>
ConvertToString(Isolate* isolate, Handle<Object> input);
V8_WARN_UNUSED_RESULT static MaybeHandle<Object> ConvertToNumberOrNumeric(
Isolate* isolate, Handle<Object> input, Conversion mode);
V8_WARN_UNUSED_RESULT static MaybeHandle<Object> ConvertToInteger(
......
......@@ -133,7 +133,7 @@ class FreshlyAllocatedBigInt : public BigIntBase {
};
// Arbitrary precision integers in JavaScript.
class V8_EXPORT_PRIVATE BigInt : public BigIntBase {
class BigInt : public BigIntBase {
public:
// Implementation of the Spec methods, see:
// https://tc39.github.io/proposal-bigint/#sec-numeric-types
......@@ -189,7 +189,8 @@ class V8_EXPORT_PRIVATE BigInt : public BigIntBase {
Handle<String> y);
static ComparisonResult CompareToNumber(Handle<BigInt> x, Handle<Object> y);
// Exposed for tests, do not call directly. Use CompareToNumber() instead.
static ComparisonResult CompareToDouble(Handle<BigInt> x, double y);
V8_EXPORT_PRIVATE static ComparisonResult CompareToDouble(Handle<BigInt> x,
double y);
static Handle<BigInt> AsIntN(Isolate* isolate, uint64_t n, Handle<BigInt> x);
static MaybeHandle<BigInt> AsUintN(Isolate* isolate, uint64_t n,
......@@ -223,8 +224,8 @@ class V8_EXPORT_PRIVATE BigInt : public BigIntBase {
static Handle<Object> ToNumber(Isolate* isolate, Handle<BigInt> x);
// ECMAScript's NumberToBigInt
static MaybeHandle<BigInt> FromNumber(Isolate* isolate,
Handle<Object> number);
V8_EXPORT_PRIVATE static MaybeHandle<BigInt> FromNumber(
Isolate* isolate, Handle<Object> number);
// ECMAScript's ToBigInt (throws for Number input)
static MaybeHandle<BigInt> FromObject(Isolate* isolate, Handle<Object> obj);
......
......@@ -59,8 +59,8 @@ class Code : public HeapObject {
#ifdef ENABLE_DISASSEMBLER
const char* GetName(Isolate* isolate) const;
void Disassemble(const char* name, std::ostream& os,
Address current_pc = kNullAddress);
V8_EXPORT_PRIVATE void Disassemble(const char* name, std::ostream& os,
Address current_pc = kNullAddress);
#endif
// [instruction_size]: Size of the native instructions, including embedded
......@@ -74,7 +74,7 @@ class Code : public HeapObject {
// the off-heap instruction stream rather than the on-heap trampoline located
// at instruction_start.
inline int InstructionSize() const;
int OffHeapInstructionSize() const;
V8_EXPORT_PRIVATE int OffHeapInstructionSize() const;
// [relocation_info]: Code relocation information
DECL_ACCESSORS(relocation_info, ByteArray)
......@@ -168,7 +168,7 @@ class Code : public HeapObject {
inline void set_code_comments_offset(int offset);
inline Address code_comments() const;
int code_comments_size() const;
bool has_code_comments() const;
V8_EXPORT_PRIVATE bool has_code_comments() const;
// The size of the executable instruction area, without embedded metadata.
int ExecutableInstructionSize() const;
......@@ -242,7 +242,7 @@ class Code : public HeapObject {
// this differs from instruction_start (which would point to the off-heap
// trampoline instead).
inline Address InstructionStart() const;
Address OffHeapInstructionStart() const;
V8_EXPORT_PRIVATE Address OffHeapInstructionStart() const;
// Returns the address right after the last instruction.
inline Address raw_instruction_end() const;
......@@ -251,7 +251,7 @@ class Code : public HeapObject {
// objects this differs from instruction_end (which would point to the
// off-heap trampoline instead).
inline Address InstructionEnd() const;
Address OffHeapInstructionEnd() const;
V8_EXPORT_PRIVATE Address OffHeapInstructionEnd() const;
// Returns the size of the instructions, padding, relocation and unwinding
// information.
......@@ -816,13 +816,13 @@ class BytecodeArray : public FixedArrayBase {
DECL_PRINTER(BytecodeArray)
DECL_VERIFIER(BytecodeArray)
void Disassemble(std::ostream& os);
V8_EXPORT_PRIVATE void Disassemble(std::ostream& os);
void CopyBytecodesTo(BytecodeArray to);
// Bytecode aging
bool IsOld() const;
void MakeOlder();
V8_EXPORT_PRIVATE bool IsOld() const;
V8_EXPORT_PRIVATE void MakeOlder();
// Clear uninitialized padding space. This ensures that the snapshot content
// is deterministic.
......@@ -934,7 +934,7 @@ class DeoptimizationData : public FixedArray {
AllocationType allocation);
// Return an empty DeoptimizationData.
static Handle<DeoptimizationData> Empty(Isolate* isolate);
V8_EXPORT_PRIVATE static Handle<DeoptimizationData> Empty(Isolate* isolate);
DECL_CAST(DeoptimizationData)
......
......@@ -123,7 +123,7 @@ class DescriptorArray : public HeapObject {
// Allocates a DescriptorArray, but returns the singleton
// empty descriptor array object if number_of_descriptors is 0.
static Handle<DescriptorArray> Allocate(
V8_EXPORT_PRIVATE static Handle<DescriptorArray> Allocate(
Isolate* isolate, int nof_descriptors, int slack,
AllocationType allocation = AllocationType::kYoung);
......@@ -190,7 +190,7 @@ class DescriptorArray : public HeapObject {
#ifdef DEBUG
// Is the descriptor array sorted and without duplicates?
bool IsSortedNoDuplicates(int valid_descriptors = -1);
V8_EXPORT_PRIVATE bool IsSortedNoDuplicates(int valid_descriptors = -1);
// Are two DescriptorArrays equal?
bool IsEqualTo(DescriptorArray other);
......
......@@ -24,7 +24,8 @@ class Handle;
class Isolate;
template <typename Derived, typename Shape>
class Dictionary : public HashTable<Derived, Shape> {
class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) Dictionary
: public HashTable<Derived, Shape> {
using DerivedHashTable = HashTable<Derived, Shape>;
public:
......@@ -125,7 +126,8 @@ class NameDictionaryShape : public BaseDictionaryShape<Handle<Name>> {
};
template <typename Derived, typename Shape>
class BaseNameDictionary : public Dictionary<Derived, Shape> {
class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) BaseNameDictionary
: public Dictionary<Derived, Shape> {
using Key = typename Shape::Key;
public:
......@@ -192,7 +194,12 @@ class BaseNameDictionary : public Dictionary<Derived, Shape> {
OBJECT_CONSTRUCTORS(BaseNameDictionary, Dictionary<Derived, Shape>);
};
class NameDictionary
class NameDictionary;
extern template class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE)
BaseNameDictionary<NameDictionary, NameDictionaryShape>;
class V8_EXPORT_PRIVATE NameDictionary
: public BaseNameDictionary<NameDictionary, NameDictionaryShape> {
public:
DECL_CAST(NameDictionary)
......@@ -228,7 +235,12 @@ class GlobalDictionaryShape : public NameDictionaryShape {
static inline RootIndex GetMapRootIndex();
};
class GlobalDictionary
class GlobalDictionary;
extern template class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE)
BaseNameDictionary<GlobalDictionary, GlobalDictionaryShape>;
class V8_EXPORT_PRIVATE GlobalDictionary
: public BaseNameDictionary<GlobalDictionary, GlobalDictionaryShape> {
public:
DECL_CAST(GlobalDictionary)
......
......@@ -85,7 +85,7 @@ class FixedArrayBase : public HeapObject {
static int GetMaxLengthForNewSpaceAllocation(ElementsKind kind);
bool IsCowArray() const;
V8_EXPORT_PRIVATE bool IsCowArray() const;
// Maximal allowed size, in bytes, of a single FixedArrayBase.
// Prevents overflowing size computations, as well as extreme memory
......@@ -124,7 +124,7 @@ class FixedArray : public FixedArrayBase {
Handle<T> GetValueChecked(Isolate* isolate, int index) const;
// Return a grown copy if the index is bigger than the array's length.
static Handle<FixedArray> SetAndGrow(
V8_EXPORT_PRIVATE static Handle<FixedArray> SetAndGrow(
Isolate* isolate, Handle<FixedArray> array, int index,
Handle<Object> value, AllocationType allocation = AllocationType::kYoung);
......@@ -162,7 +162,7 @@ class FixedArray : public FixedArrayBase {
inline void FillWithHoles(int from, int to);
// Shrink the array and insert filler objects. {new_length} must be > 0.
void Shrink(Isolate* isolate, int new_length);
V8_EXPORT_PRIVATE void Shrink(Isolate* isolate, int new_length);
// If {new_length} is 0, return the canonical empty FixedArray. Otherwise
// like above.
static Handle<FixedArray> ShrinkOrEmpty(Isolate* isolate,
......@@ -170,7 +170,8 @@ class FixedArray : public FixedArrayBase {
int new_length);
// Copy a sub array from the receiver to dest.
void CopyTo(int pos, FixedArray dest, int dest_pos, int len) const;
V8_EXPORT_PRIVATE void CopyTo(int pos, FixedArray dest, int dest_pos,
int len) const;
// Garbage collection support.
static constexpr int SizeFor(int length) {
......@@ -340,9 +341,9 @@ class WeakArrayList : public HeapObject {
DECL_VERIFIER(WeakArrayList)
DECL_PRINTER(WeakArrayList)
static Handle<WeakArrayList> AddToEnd(Isolate* isolate,
Handle<WeakArrayList> array,
const MaybeObjectHandle& value);
V8_EXPORT_PRIVATE static Handle<WeakArrayList> AddToEnd(
Isolate* isolate, Handle<WeakArrayList> array,
const MaybeObjectHandle& value);
inline MaybeObject Get(int index) const;
......@@ -359,7 +360,7 @@ class WeakArrayList : public HeapObject {
// Gives access to raw memory which stores the array's data.
inline MaybeObjectSlot data_start();
bool IsFull();
V8_EXPORT_PRIVATE bool IsFull();
DECL_INT_ACCESSORS(capacity)
DECL_INT_ACCESSORS(length)
......@@ -395,7 +396,7 @@ class WeakArrayList : public HeapObject {
// around in the array - this method can only be used in cases where the user
// doesn't care about the indices! Users should make sure there are no
// duplicates.
bool RemoveOne(const MaybeObjectHandle& value);
V8_EXPORT_PRIVATE bool RemoveOne(const MaybeObjectHandle& value);
class Iterator;
......@@ -431,10 +432,13 @@ class WeakArrayList::Iterator {
// underlying FixedArray starting at kFirstIndex.
class ArrayList : public FixedArray {
public:
static Handle<ArrayList> Add(Isolate* isolate, Handle<ArrayList> array,
Handle<Object> obj);
static Handle<ArrayList> Add(Isolate* isolate, Handle<ArrayList> array,
Handle<Object> obj1, Handle<Object> obj2);
V8_EXPORT_PRIVATE static Handle<ArrayList> Add(Isolate* isolate,
Handle<ArrayList> array,
Handle<Object> obj);
V8_EXPORT_PRIVATE static Handle<ArrayList> Add(Isolate* isolate,
Handle<ArrayList> array,
Handle<Object> obj1,
Handle<Object> obj2);
static Handle<ArrayList> New(Isolate* isolate, int size);
// Returns the number of elements in the list, not the allocated size, which
......
......@@ -6,6 +6,8 @@
#define V8_OBJECTS_HASH_TABLE_H_
#include "src/base/compiler-specific.h"
#include "src/base/export-template.h"
#include "src/base/macros.h"
#include "src/globals.h"
#include "src/objects/fixed-array.h"
#include "src/objects/smi.h"
......@@ -130,7 +132,8 @@ class V8_EXPORT_PRIVATE HashTableBase : public NON_EXPORTED_BASE(FixedArray) {
};
template <typename Derived, typename Shape>
class HashTable : public HashTableBase {
class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) HashTable
: public HashTableBase {
public:
using ShapeT = Shape;
using Key = typename Shape::Key;
......@@ -287,7 +290,8 @@ class ObjectHashTableShape : public BaseShape<Handle<Object>> {
};
template <typename Derived, typename Shape>
class ObjectHashTableBase : public HashTable<Derived, Shape> {
class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) ObjectHashTableBase
: public HashTable<Derived, Shape> {
public:
// Looks up the value associated with the given key. The hole value is
// returned in case the key is not present.
......@@ -328,9 +332,16 @@ class ObjectHashTableBase : public HashTable<Derived, Shape> {
OBJECT_CONSTRUCTORS(ObjectHashTableBase, HashTable<Derived, Shape>);
};
class ObjectHashTable;
extern template class EXPORT_TEMPLATE_DECLARE(
V8_EXPORT_PRIVATE) HashTable<ObjectHashTable, ObjectHashTableShape>;
extern template class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE)
ObjectHashTableBase<ObjectHashTable, ObjectHashTableShape>;
// ObjectHashTable maps keys that are arbitrary objects to object values by
// using the identity hash of the key for hashing purposes.
class ObjectHashTable
class V8_EXPORT_PRIVATE ObjectHashTable
: public ObjectHashTableBase<ObjectHashTable, ObjectHashTableShape> {
public:
DECL_CAST(ObjectHashTable)
......@@ -346,11 +357,18 @@ class EphemeronHashTableShape : public ObjectHashTableShape {
static inline RootIndex GetMapRootIndex();
};
class EphemeronHashTable;
extern template class EXPORT_TEMPLATE_DECLARE(
V8_EXPORT_PRIVATE) HashTable<EphemeronHashTable, EphemeronHashTableShape>;
extern template class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE)
ObjectHashTableBase<EphemeronHashTable, EphemeronHashTableShape>;
// EphemeronHashTable is similar to ObjectHashTable but gets special treatment
// by the GC. The GC treats its entries as ephemerons: both key and value are
// weak references, however if the key is strongly reachable its corresponding
// value is also kept alive.
class EphemeronHashTable
class V8_EXPORT_PRIVATE EphemeronHashTable
: public ObjectHashTableBase<EphemeronHashTable, EphemeronHashTableShape> {
public:
DECL_CAST(EphemeronHashTable)
......@@ -376,7 +394,12 @@ class ObjectHashSetShape : public ObjectHashTableShape {
static const int kEntrySize = 1;
};
class ObjectHashSet : public HashTable<ObjectHashSet, ObjectHashSetShape> {
class ObjectHashSet;
extern template class EXPORT_TEMPLATE_DECLARE(
V8_EXPORT_PRIVATE) HashTable<ObjectHashSet, ObjectHashSetShape>;
class V8_EXPORT_PRIVATE ObjectHashSet
: public HashTable<ObjectHashSet, ObjectHashSetShape> {
public:
static Handle<ObjectHashSet> Add(Isolate* isolate, Handle<ObjectHashSet> set,
Handle<Object> key);
......
......@@ -116,7 +116,7 @@ class HeapObject : public Object {
// Returns true if the object contains a tagged value at given offset.
// It is used for invalid slots filtering. If the offset points outside
// of the object or to the map word, the result is UNDEFINED (!!!).
bool IsValidSlot(Map map, int offset);
V8_EXPORT_PRIVATE bool IsValidSlot(Map map, int offset);
// Returns the heap object's size in bytes
inline int Size() const;
......@@ -149,7 +149,7 @@ class HeapObject : public Object {
void PrintHeader(std::ostream& os, const char* id); // NOLINT
#endif
DECL_PRINTER(HeapObject)
DECL_VERIFIER(HeapObject)
EXPORT_DECL_VERIFIER(HeapObject)
#ifdef VERIFY_HEAP
inline void VerifyObjectField(Isolate* isolate, int offset);
inline void VerifySmiField(int offset);
......
......@@ -79,7 +79,7 @@ class Intl {
//
// service is a string denoting the type of Intl object; used when
// printing the error message.
V8_WARN_UNUSED_RESULT static Maybe<bool> GetStringOption(
V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT static Maybe<bool> GetStringOption(
Isolate* isolate, Handle<JSReceiver> options, const char* property,
std::vector<const char*> values, const char* service,
std::unique_ptr<char[]>* result);
......@@ -122,7 +122,7 @@ class Intl {
//
// service is a string denoting the type of Intl object; used when
// printing the error message.
V8_WARN_UNUSED_RESULT static Maybe<bool> GetBoolOption(
V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT static Maybe<bool> GetBoolOption(
Isolate* isolate, Handle<JSReceiver> options, const char* property,
const char* service, bool* result);
......
......@@ -95,8 +95,9 @@ class JSArrayBuffer : public JSObject {
bool is_wasm_memory;
};
void FreeBackingStoreFromMainThread();
static void FreeBackingStore(Isolate* isolate, Allocation allocation);
V8_EXPORT_PRIVATE void FreeBackingStoreFromMainThread();
V8_EXPORT_PRIVATE static void FreeBackingStore(Isolate* isolate,
Allocation allocation);
V8_EXPORT_PRIVATE static void Setup(
Handle<JSArrayBuffer> array_buffer, Isolate* isolate, bool is_external,
......@@ -111,7 +112,7 @@ class JSArrayBuffer : public JSObject {
// Returns false if array buffer contents could not be allocated.
// In this case, |array_buffer| will not be set up.
static bool SetupAllocatingData(
V8_EXPORT_PRIVATE static bool SetupAllocatingData(
Handle<JSArrayBuffer> array_buffer, Isolate* isolate,
size_t allocated_length, bool initialize = true,
SharedFlag shared_flag = SharedFlag::kNotShared) V8_WARN_UNUSED_RESULT;
......@@ -196,7 +197,7 @@ class JSTypedArray : public JSArrayBufferView {
ExternalArrayType type();
V8_EXPORT_PRIVATE size_t element_size();
Handle<JSArrayBuffer> GetBuffer();
V8_EXPORT_PRIVATE Handle<JSArrayBuffer> GetBuffer();
// Whether the buffer's backing store is on-heap or off-heap.
inline bool is_on_heap() const;
......
......@@ -36,7 +36,8 @@ class JSArray : public JSObject {
// Initialize the array with the given capacity. The function may
// fail due to out-of-memory situations, but only if the requested
// capacity is non-zero.
static void Initialize(Handle<JSArray> array, int capacity, int length = 0);
V8_EXPORT_PRIVATE static void Initialize(Handle<JSArray> array, int capacity,
int length = 0);
// If the JSArray has fast elements, and new_length would result in
// normalization, returns true.
......@@ -46,7 +47,8 @@ class JSArray : public JSObject {
// Initializes the array to a certain length.
inline bool AllowsSetLength();
static void SetLength(Handle<JSArray> array, uint32_t length);
V8_EXPORT_PRIVATE static void SetLength(Handle<JSArray> array,
uint32_t length);
// Set the content of the array to the content of storage.
static inline void SetContent(Handle<JSArray> array,
......
......@@ -35,7 +35,7 @@ class JSV8BreakIterator : public JSObject {
static Handle<JSObject> ResolvedOptions(
Isolate* isolate, Handle<JSV8BreakIterator> break_iterator);
static const std::set<std::string>& GetAvailableLocales();
V8_EXPORT_PRIVATE static const std::set<std::string>& GetAvailableLocales();
static void AdoptText(Isolate* isolate,
Handle<JSV8BreakIterator> break_iterator,
......
......@@ -40,7 +40,7 @@ class JSCollator : public JSObject {
static Handle<JSObject> ResolvedOptions(Isolate* isolate,
Handle<JSCollator> collator);
static const std::set<std::string>& GetAvailableLocales();
V8_EXPORT_PRIVATE static const std::set<std::string>& GetAvailableLocales();
DECL_CAST(JSCollator)
DECL_PRINTER(JSCollator)
......
......@@ -100,8 +100,9 @@ class JSWeakCollection : public JSObject {
DECL_ACCESSORS(table, Object)
static void Initialize(Handle<JSWeakCollection> collection, Isolate* isolate);
static void Set(Handle<JSWeakCollection> collection, Handle<Object> key,
Handle<Object> value, int32_t hash);
V8_EXPORT_PRIVATE static void Set(Handle<JSWeakCollection> collection,
Handle<Object> key, Handle<Object> value,
int32_t hash);
static bool Delete(Handle<JSWeakCollection> collection, Handle<Object> key,
int32_t hash);
static Handle<JSArray> GetEntries(Handle<JSWeakCollection> holder,
......
......@@ -83,7 +83,7 @@ class JSDateTimeFormat : public JSObject {
Isolate* isolate, Handle<Object> date, Handle<Object> locales,
Handle<Object> options, RequiredOption required, DefaultsOption defaults);
static const std::set<std::string>& GetAvailableLocales();
V8_EXPORT_PRIVATE static const std::set<std::string>& GetAvailableLocales();
Handle<String> HourCycleAsString() const;
DECL_CAST(JSDateTimeFormat)
......
......@@ -49,7 +49,7 @@ class JSListFormat : public JSObject {
Isolate* isolate, Handle<JSListFormat> format_holder,
Handle<JSArray> list);
static const std::set<std::string>& GetAvailableLocales();
V8_EXPORT_PRIVATE static const std::set<std::string>& GetAvailableLocales();
Handle<String> StyleAsString() const;
Handle<String> TypeAsString() const;
......
......@@ -64,7 +64,7 @@ class JSNumberFormat : public JSObject {
Isolate* isolate, const icu::NumberFormat& number_format,
Handle<Object> numeric_obj);
static const std::set<std::string>& GetAvailableLocales();
V8_EXPORT_PRIVATE static const std::set<std::string>& GetAvailableLocales();
Handle<String> StyleAsString() const;
Handle<String> CurrencyDisplayAsString() const;
......@@ -143,7 +143,7 @@ struct NumberFormatSpan {
: field_id(field_id), begin_pos(begin_pos), end_pos(end_pos) {}
};
std::vector<NumberFormatSpan> FlattenRegionsToParts(
V8_EXPORT_PRIVATE std::vector<NumberFormatSpan> FlattenRegionsToParts(
std::vector<NumberFormatSpan>* regions);
} // namespace internal
......
This diff is collapsed.
......@@ -40,7 +40,7 @@ class JSPluralRules : public JSObject {
V8_WARN_UNUSED_RESULT static MaybeHandle<String> ResolvePlural(
Isolate* isolate, Handle<JSPluralRules> plural_rules, double number);
static const std::set<std::string>& GetAvailableLocales();
V8_EXPORT_PRIVATE static const std::set<std::string>& GetAvailableLocales();
// [[Type]] is one of the values "cardinal" or "ordinal",
// identifying the plural rules used.
......
......@@ -49,7 +49,7 @@ class JSPromise : public JSObject {
void set_async_task_id(int id);
static const char* Status(Promise::PromiseState status);
Promise::PromiseState status() const;
V8_EXPORT_PRIVATE Promise::PromiseState status() const;
void set_status(Promise::PromiseState status);
// ES section #sec-fulfillpromise
......
......@@ -50,7 +50,7 @@ class JSRelativeTimeFormat : public JSObject {
Handle<JSRelativeTimeFormat> format_holder, const char* func_name,
bool to_parts);
static const std::set<std::string>& GetAvailableLocales();
V8_EXPORT_PRIVATE static const std::set<std::string>& GetAvailableLocales();
DECL_CAST(JSRelativeTimeFormat)
......
......@@ -39,7 +39,7 @@ class JSSegmenter : public JSObject {
V8_WARN_UNUSED_RESULT static Handle<JSObject> ResolvedOptions(
Isolate* isolate, Handle<JSSegmenter> segmenter_holder);
static const std::set<std::string>& GetAvailableLocales();
V8_EXPORT_PRIVATE static const std::set<std::string>& GetAvailableLocales();
Handle<String> GranularityAsString() const;
......
......@@ -22,7 +22,7 @@ class WeakCell;
class JSFinalizationGroup : public JSObject {
public:
DECL_PRINTER(JSFinalizationGroup)
DECL_VERIFIER(JSFinalizationGroup)
EXPORT_DECL_VERIFIER(JSFinalizationGroup)
DECL_CAST(JSFinalizationGroup)
DECL_ACCESSORS(native_context, NativeContext)
......@@ -86,7 +86,7 @@ class JSFinalizationGroup : public JSObject {
class WeakCell : public HeapObject {
public:
DECL_PRINTER(WeakCell)
DECL_VERIFIER(WeakCell)
EXPORT_DECL_VERIFIER(WeakCell)
DECL_CAST(WeakCell)
DECL_ACCESSORS(finalization_group, Object)
......@@ -141,7 +141,7 @@ class WeakCell : public HeapObject {
class JSWeakRef : public JSObject {
public:
DECL_PRINTER(JSWeakRef)
DECL_VERIFIER(JSWeakRef)
EXPORT_DECL_VERIFIER(JSWeakRef)
DECL_CAST(JSWeakRef)
DECL_ACCESSORS(target, HeapObject)
......
......@@ -36,7 +36,8 @@ struct ManagedPtrDestructor {
// The GC finalizer of a managed object, which does not depend on
// the template parameter.
void ManagedObjectFinalizer(const v8::WeakCallbackInfo<void>& data);
V8_EXPORT_PRIVATE void ManagedObjectFinalizer(
const v8::WeakCallbackInfo<void>& data);
// {Managed<T>} is essentially a {std::shared_ptr<T>} allocated on the heap
// that can be used to manage the lifetime of C++ objects that are shared
......
This diff is collapsed.
......@@ -495,8 +495,11 @@
#ifdef VERIFY_HEAP
#define DECL_VERIFIER(Name) void Name##Verify(Isolate* isolate);
#define EXPORT_DECL_VERIFIER(Name) \
V8_EXPORT_PRIVATE void Name##Verify(Isolate* isolate);
#else
#define DECL_VERIFIER(Name)
#define EXPORT_DECL_VERIFIER(Name)
#endif
#define DEFINE_DEOPT_ELEMENT_ACCESSORS(name, type) \
......
This diff is collapsed.
......@@ -5,6 +5,7 @@
#ifndef V8_OBJECTS_ORDERED_HASH_TABLE_H_
#define V8_OBJECTS_ORDERED_HASH_TABLE_H_
#include "src/base/export-template.h"
#include "src/globals.h"
#include "src/objects/fixed-array.h"
#include "src/objects/js-objects.h"
......@@ -229,7 +230,8 @@ class OrderedHashTable : public FixedArray {
friend class OrderedNameDictionaryHandler;
};
class OrderedHashSet : public OrderedHashTable<OrderedHashSet, 1> {
class V8_EXPORT_PRIVATE OrderedHashSet
: public OrderedHashTable<OrderedHashSet, 1> {
public:
DECL_CAST(OrderedHashSet)
......@@ -253,7 +255,8 @@ class OrderedHashSet : public OrderedHashTable<OrderedHashSet, 1> {
OBJECT_CONSTRUCTORS(OrderedHashSet, OrderedHashTable<OrderedHashSet, 1>);
};
class OrderedHashMap : public OrderedHashTable<OrderedHashMap, 2> {
class V8_EXPORT_PRIVATE OrderedHashMap
: public OrderedHashTable<OrderedHashMap, 2> {
public:
DECL_CAST(OrderedHashMap)
......@@ -574,7 +577,7 @@ class SmallOrderedHashSet : public SmallOrderedHashTable<SmallOrderedHashSet> {
DECL_CAST(SmallOrderedHashSet)
DECL_PRINTER(SmallOrderedHashSet)
DECL_VERIFIER(SmallOrderedHashSet)
EXPORT_DECL_VERIFIER(SmallOrderedHashSet)
static const int kKeyIndex = 0;
static const int kEntrySize = 1;
......@@ -583,9 +586,12 @@ class SmallOrderedHashSet : public SmallOrderedHashTable<SmallOrderedHashSet> {
// Adds |value| to |table|, if the capacity isn't enough, a new
// table is created. The original |table| is returned if there is
// capacity to store |value| otherwise the new table is returned.
static MaybeHandle<SmallOrderedHashSet> Add(Isolate* isolate,
Handle<SmallOrderedHashSet> table,
Handle<Object> key);
V8_EXPORT_PRIVATE static MaybeHandle<SmallOrderedHashSet> Add(
Isolate* isolate, Handle<SmallOrderedHashSet> table, Handle<Object> key);
V8_EXPORT_PRIVATE static bool Delete(Isolate* isolate,
SmallOrderedHashSet table, Object key);
V8_EXPORT_PRIVATE bool HasKey(Isolate* isolate, Handle<Object> key);
static inline bool Is(Handle<HeapObject> table);
static inline RootIndex GetMapRootIndex();
static Handle<SmallOrderedHashSet> Rehash(Isolate* isolate,
......@@ -603,7 +609,7 @@ class SmallOrderedHashMap : public SmallOrderedHashTable<SmallOrderedHashMap> {
DECL_CAST(SmallOrderedHashMap)
DECL_PRINTER(SmallOrderedHashMap)
DECL_VERIFIER(SmallOrderedHashMap)
EXPORT_DECL_VERIFIER(SmallOrderedHashMap)
static const int kKeyIndex = 0;
static const int kValueIndex = 1;
......@@ -613,10 +619,12 @@ class SmallOrderedHashMap : public SmallOrderedHashTable<SmallOrderedHashMap> {
// Adds |value| to |table|, if the capacity isn't enough, a new
// table is created. The original |table| is returned if there is
// capacity to store |value| otherwise the new table is returned.
static MaybeHandle<SmallOrderedHashMap> Add(Isolate* isolate,
Handle<SmallOrderedHashMap> table,
Handle<Object> key,
Handle<Object> value);
V8_EXPORT_PRIVATE static MaybeHandle<SmallOrderedHashMap> Add(
Isolate* isolate, Handle<SmallOrderedHashMap> table, Handle<Object> key,
Handle<Object> value);
V8_EXPORT_PRIVATE static bool Delete(Isolate* isolate,
SmallOrderedHashMap table, Object key);
V8_EXPORT_PRIVATE bool HasKey(Isolate* isolate, Handle<Object> key);
static inline bool Is(Handle<HeapObject> table);
static inline RootIndex GetMapRootIndex();
......@@ -636,7 +644,7 @@ STATIC_ASSERT(kSmallOrderedHashMapMinCapacity ==
// OrderedHashSetBase class as a base class for the two tables and use
// that instead of a HeapObject here.
template <class SmallTable, class LargeTable>
class OrderedHashTableHandler {
class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) OrderedHashTableHandler {
public:
using Entry = int;
......@@ -650,7 +658,10 @@ class OrderedHashTableHandler {
SmallOrderedHashTable<SmallTable>::kGrowthHack << 1;
};
class OrderedHashMapHandler
extern template class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE)
OrderedHashTableHandler<SmallOrderedHashMap, OrderedHashMap>;
class V8_EXPORT_PRIVATE OrderedHashMapHandler
: public OrderedHashTableHandler<SmallOrderedHashMap, OrderedHashMap> {
public:
static Handle<HeapObject> Add(Isolate* isolate, Handle<HeapObject> table,
......@@ -659,7 +670,10 @@ class OrderedHashMapHandler
Isolate* isolate, Handle<SmallOrderedHashMap> table);
};
class OrderedHashSetHandler
extern template class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE)
OrderedHashTableHandler<SmallOrderedHashSet, OrderedHashSet>;
class V8_EXPORT_PRIVATE OrderedHashSetHandler
: public OrderedHashTableHandler<SmallOrderedHashSet, OrderedHashSet> {
public:
static Handle<HeapObject> Add(Isolate* isolate, Handle<HeapObject> table,
......@@ -673,16 +687,14 @@ class OrderedNameDictionary
public:
DECL_CAST(OrderedNameDictionary)
static Handle<OrderedNameDictionary> Add(Isolate* isolate,
Handle<OrderedNameDictionary> table,
Handle<Name> key,
Handle<Object> value,
PropertyDetails details);
V8_EXPORT_PRIVATE static Handle<OrderedNameDictionary> Add(
Isolate* isolate, Handle<OrderedNameDictionary> table, Handle<Name> key,
Handle<Object> value, PropertyDetails details);
void SetEntry(Isolate* isolate, int entry, Object key, Object value,
PropertyDetails details);
V8_EXPORT_PRIVATE void SetEntry(Isolate* isolate, int entry, Object key,
Object value, PropertyDetails details);
static Handle<OrderedNameDictionary> DeleteEntry(
V8_EXPORT_PRIVATE static Handle<OrderedNameDictionary> DeleteEntry(
Isolate* isolate, Handle<OrderedNameDictionary> table, int entry);
static Handle<OrderedNameDictionary> Allocate(
......@@ -718,7 +730,10 @@ class OrderedNameDictionary
OrderedHashTable<OrderedNameDictionary, 3>);
};
class OrderedNameDictionaryHandler
extern template class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE)
OrderedHashTableHandler<SmallOrderedNameDictionary, OrderedNameDictionary>;
class V8_EXPORT_PRIVATE OrderedNameDictionaryHandler
: public OrderedHashTableHandler<SmallOrderedNameDictionary,
OrderedNameDictionary> {
public:
......@@ -775,7 +790,7 @@ class SmallOrderedNameDictionary
Isolate* isolate, Handle<SmallOrderedNameDictionary> table,
int new_capacity);
static Handle<SmallOrderedNameDictionary> DeleteEntry(
V8_EXPORT_PRIVATE static Handle<SmallOrderedNameDictionary> DeleteEntry(
Isolate* isolate, Handle<SmallOrderedNameDictionary> table, int entry);
// Set the value for entry.
......@@ -799,12 +814,12 @@ class SmallOrderedNameDictionary
// Adds |value| to |table|, if the capacity isn't enough, a new
// table is created. The original |table| is returned if there is
// capacity to store |value| otherwise the new table is returned.
static MaybeHandle<SmallOrderedNameDictionary> Add(
V8_EXPORT_PRIVATE static MaybeHandle<SmallOrderedNameDictionary> Add(
Isolate* isolate, Handle<SmallOrderedNameDictionary> table,
Handle<Name> key, Handle<Object> value, PropertyDetails details);
void SetEntry(Isolate* isolate, int entry, Object key, Object value,
PropertyDetails details);
V8_EXPORT_PRIVATE void SetEntry(Isolate* isolate, int entry, Object key,
Object value, PropertyDetails details);
static inline RootIndex GetMapRootIndex();
......
......@@ -69,7 +69,7 @@ class PrototypeInfo : public Struct {
// A growing array with an additional API for marking slots "empty". When adding
// new elements, we reuse the empty slots instead of growing the array.
class PrototypeUsers : public WeakArrayList {
class V8_EXPORT_PRIVATE PrototypeUsers : public WeakArrayList {
public:
static Handle<WeakArrayList> Add(Isolate* isolate,
Handle<WeakArrayList> array,
......
......@@ -70,12 +70,12 @@ class ScopeInfo : public FixedArray {
bool HasNewTarget() const;
// Is this scope the scope of a named function expression?
bool HasFunctionName() const;
V8_EXPORT_PRIVATE bool HasFunctionName() const;
// See SharedFunctionInfo::HasSharedName.
bool HasSharedFunctionName() const;
V8_EXPORT_PRIVATE bool HasSharedFunctionName() const;
bool HasInferredFunctionName() const;
V8_EXPORT_PRIVATE bool HasInferredFunctionName() const;
void SetFunctionName(Object name);
void SetInferredFunctionName(String name);
......@@ -92,7 +92,7 @@ class ScopeInfo : public FixedArray {
inline bool HasSimpleParameters() const;
// Return the function_name if present.
Object FunctionName() const;
V8_EXPORT_PRIVATE Object FunctionName() const;
// The function's name if it is non-empty, otherwise the inferred name or an
// empty string.
......@@ -100,7 +100,7 @@ class ScopeInfo : public FixedArray {
// Return the function's inferred name if present.
// See SharedFunctionInfo::function_identifier.
Object InferredFunctionName() const;
V8_EXPORT_PRIVATE Object InferredFunctionName() const;
// Position information accessors.
int StartPosition() const;
......
......@@ -139,7 +139,7 @@ class Script : public Struct {
bool ContainsAsmModule();
// Init line_ends array with source code positions of line ends.
static void InitLineEnds(Handle<Script> script);
V8_EXPORT_PRIVATE static void InitLineEnds(Handle<Script> script);
// Carries information about a source position.
struct PositionInfo {
......@@ -163,15 +163,16 @@ class Script : public Struct {
// callsites.
static bool GetPositionInfo(Handle<Script> script, int position,
PositionInfo* info, OffsetFlag offset_flag);
bool GetPositionInfo(int position, PositionInfo* info,
OffsetFlag offset_flag) const;
V8_EXPORT_PRIVATE bool GetPositionInfo(int position, PositionInfo* info,
OffsetFlag offset_flag) const;
bool IsUserJavaScript();
// Wrappers for GetPositionInfo
static int GetColumnNumber(Handle<Script> script, int code_offset);
int GetColumnNumber(int code_pos) const;
static int GetLineNumber(Handle<Script> script, int code_offset);
V8_EXPORT_PRIVATE static int GetLineNumber(Handle<Script> script,
int code_offset);
int GetLineNumber(int code_pos) const;
// Look through the list of existing shared function infos to find one
......@@ -192,7 +193,7 @@ class Script : public Struct {
std::unique_ptr<v8::tracing::TracedValue> TraceIDRef() const;
// Iterate over all script objects on the heap.
class Iterator {
class V8_EXPORT_PRIVATE Iterator {
public:
explicit Iterator(Isolate* isolate);
Script Next();
......
......@@ -234,7 +234,7 @@ class SharedFunctionInfo : public HeapObject {
inline void SetName(String name);
// Get the code object which represents the execution of this function.
Code GetCode() const;
V8_EXPORT_PRIVATE Code GetCode() const;
// Get the abstract code associated with the function, which will either be
// a Code object or a BytecodeArray.
......@@ -384,7 +384,7 @@ class SharedFunctionInfo : public HeapObject {
// Break infos are contained in DebugInfo, this is a convenience method
// to simplify access.
bool HasBreakInfo() const;
V8_EXPORT_PRIVATE bool HasBreakInfo() const;
bool BreakAtEntry() const;
// Coverage infos are contained in DebugInfo, this is a convenience method
......@@ -540,8 +540,8 @@ class SharedFunctionInfo : public HeapObject {
// Flush compiled data from this function, setting it back to CompileLazy and
// clearing any compiled metadata.
static void DiscardCompiled(Isolate* isolate,
Handle<SharedFunctionInfo> shared_info);
V8_EXPORT_PRIVATE static void DiscardCompiled(
Isolate* isolate, Handle<SharedFunctionInfo> shared_info);
// Discard the compiled metadata. If called during GC then
// |gc_notify_updated_slot| should be used to record any slot updates.
......@@ -583,7 +583,7 @@ class SharedFunctionInfo : public HeapObject {
Isolate* isolate, Handle<SharedFunctionInfo> shared_info);
// Hash based on function literal id and script id.
uint32_t Hash();
V8_EXPORT_PRIVATE uint32_t Hash();
inline bool construct_as_builtin() const;
......@@ -619,10 +619,10 @@ class SharedFunctionInfo : public HeapObject {
// Iterate over all shared function infos in a given script.
class ScriptIterator {
public:
ScriptIterator(Isolate* isolate, Script script);
V8_EXPORT_PRIVATE ScriptIterator(Isolate* isolate, Script script);
ScriptIterator(Isolate* isolate,
Handle<WeakFixedArray> shared_function_infos);
SharedFunctionInfo Next();
V8_EXPORT_PRIVATE SharedFunctionInfo Next();
int CurrentIndex() const { return index_ - 1; }
// Reset the iterator to run on |script|.
......@@ -638,8 +638,8 @@ class SharedFunctionInfo : public HeapObject {
// Iterate over all shared function infos on the heap.
class GlobalIterator {
public:
explicit GlobalIterator(Isolate* isolate);
SharedFunctionInfo Next();
V8_EXPORT_PRIVATE explicit GlobalIterator(Isolate* isolate);
V8_EXPORT_PRIVATE SharedFunctionInfo Next();
private:
Script::Iterator script_iterator_;
......
......@@ -87,7 +87,8 @@ class Smi : public Object {
// 1 if x > y.
// Returns the result (a tagged Smi) as a raw Address for ExternalReference
// usage.
static Address LexicographicCompare(Isolate* isolate, Smi x, Smi y);
V8_EXPORT_PRIVATE static Address LexicographicCompare(Isolate* isolate, Smi x,
Smi y);
DECL_CAST(Smi)
......
......@@ -78,8 +78,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.
static Address LookupStringIfExists_NoAllocate(Isolate* isolate,
Address raw_string);
V8_EXPORT_PRIVATE static Address LookupStringIfExists_NoAllocate(
Isolate* isolate, Address raw_string);
static void EnsureCapacityForDeserialization(Isolate* isolate, int expected);
......
......@@ -198,7 +198,8 @@ class String : public Name {
// If the string isn't flat, and therefore doesn't have flat content, the
// returned structure will report so, and can't provide a vector of either
// kind.
FlatContent GetFlatContent(const DisallowHeapAllocation& no_gc);
V8_EXPORT_PRIVATE FlatContent
GetFlatContent(const DisallowHeapAllocation& no_gc);
// Returns the parent of a sliced string or first part of a flat cons string.
// Requires: StringShape(this).IsIndirect() && this->IsFlat()
......@@ -266,13 +267,14 @@ class String : public Name {
inline bool Equals(String other);
inline static bool Equals(Isolate* isolate, Handle<String> one,
Handle<String> two);
bool IsUtf8EqualTo(Vector<const char> str, bool allow_prefix_match = false);
V8_EXPORT_PRIVATE bool IsUtf8EqualTo(Vector<const char> str,
bool allow_prefix_match = false);
// Dispatches to Is{One,Two}ByteEqualTo.
template <typename Char>
bool IsEqualTo(Vector<const Char> str);
bool IsOneByteEqualTo(Vector<const uint8_t> str);
V8_EXPORT_PRIVATE bool IsOneByteEqualTo(Vector<const uint8_t> str);
bool IsTwoByteEqualTo(Vector<const uc16> str);
// Return a UTF8 representation of the string. The string is null
......@@ -286,7 +288,7 @@ class String : public Name {
std::unique_ptr<char[]> ToCString(AllowNullsFlag allow_nulls,
RobustnessFlag robustness_flag, int offset,
int length, int* length_output = nullptr);
std::unique_ptr<char[]> ToCString(
V8_EXPORT_PRIVATE std::unique_ptr<char[]> ToCString(
AllowNullsFlag allow_nulls = DISALLOW_NULLS,
RobustnessFlag robustness_flag = FAST_STRING_TRAVERSAL,
int* length_output = nullptr);
......@@ -294,8 +296,10 @@ class String : public Name {
bool ComputeArrayIndex(uint32_t* index);
// Externalization.
bool MakeExternal(v8::String::ExternalStringResource* resource);
bool MakeExternal(v8::String::ExternalOneByteStringResource* resource);
V8_EXPORT_PRIVATE bool MakeExternal(
v8::String::ExternalStringResource* resource);
V8_EXPORT_PRIVATE bool MakeExternal(
v8::String::ExternalOneByteStringResource* resource);
bool SupportsExternalization();
// Conversion.
......@@ -309,7 +313,7 @@ class String : public Name {
DECL_CAST(String)
void PrintOn(FILE* out);
V8_EXPORT_PRIVATE void PrintOn(FILE* out);
// For use during stack traces. Performs rudimentary sanity check.
bool LooksValid();
......@@ -358,7 +362,8 @@ class String : public Name {
// Helper function for flattening strings.
template <typename sinkchar>
static void WriteToFlat(String source, sinkchar* sink, int from, int to);
V8_EXPORT_PRIVATE static void WriteToFlat(String source, sinkchar* sink,
int from, int to);
// The return value may point to the first aligned word containing the first
// non-one-byte character, rather than directly to the non-one-byte character.
......@@ -433,21 +438,21 @@ class String : public Name {
friend class StringTableInsertionKey;
friend class InternalizedStringKey;
static Handle<String> SlowFlatten(Isolate* isolate, Handle<ConsString> cons,
AllocationType allocation);
V8_EXPORT_PRIVATE static Handle<String> SlowFlatten(
Isolate* isolate, Handle<ConsString> cons, AllocationType allocation);
// Slow case of String::Equals. This implementation works on any strings
// but it is most efficient on strings that are almost flat.
bool SlowEquals(String other);
V8_EXPORT_PRIVATE bool SlowEquals(String other);
static bool SlowEquals(Isolate* isolate, Handle<String> one,
Handle<String> two);
V8_EXPORT_PRIVATE static bool SlowEquals(Isolate* isolate, Handle<String> one,
Handle<String> two);
// Slow case of AsArrayIndex.
V8_EXPORT_PRIVATE bool SlowAsArrayIndex(uint32_t* index);
// Compute and set the hash code.
uint32_t ComputeAndSetHash();
V8_EXPORT_PRIVATE uint32_t ComputeAndSetHash();
OBJECT_CONSTRUCTORS(String, Name);
};
......@@ -797,7 +802,7 @@ class ExternalTwoByteString : public ExternalString {
// A flat string reader provides random access to the contents of a
// string independent of the character width of the string. The handle
// must be valid as long as the reader is being used.
class FlatStringReader : public Relocatable {
class V8_EXPORT_PRIVATE FlatStringReader : public Relocatable {
public:
FlatStringReader(Isolate* isolate, Handle<String> str);
FlatStringReader(Isolate* isolate, Vector<const char> input);
......@@ -849,8 +854,8 @@ class ConsStringIterator {
inline void AdjustMaximumDepth();
inline void Pop();
inline bool StackBlown() { return maximum_depth_ - depth_ == kStackSize; }
void Initialize(ConsString cons_string, int offset);
String Continue(int* offset_out);
V8_EXPORT_PRIVATE void Initialize(ConsString cons_string, int offset);
V8_EXPORT_PRIVATE String Continue(int* offset_out);
String NextLeaf(bool* blew_stack);
String Search(int* offset_out);
......
......@@ -3359,7 +3359,7 @@ TEST(SmallOrderedHashMapAllocate) {
reinterpret_cast<void*>(actual->address()),
SmallOrderedHashMap::SizeFor(capacity)));
#ifdef VERIFY_HEAP
actual->SmallOrderedHashTableVerify(isolate);
actual->SmallOrderedHashMapVerify(isolate);
#endif
capacity = capacity << 1;
}
......@@ -3398,7 +3398,7 @@ TEST(SmallOrderedHashSetAllocate) {
reinterpret_cast<void*>(actual->address()),
SmallOrderedHashSet::SizeFor(capacity)));
#ifdef VERIFY_HEAP
actual->SmallOrderedHashTableVerify(isolate);
actual->SmallOrderedHashSetVerify(isolate);
#endif
capacity = capacity << 1;
}
......
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