summaryrefslogtreecommitdiff
path: root/deps/v8/src/objects.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/objects.h')
-rw-r--r--deps/v8/src/objects.h639
1 files changed, 475 insertions, 164 deletions
diff --git a/deps/v8/src/objects.h b/deps/v8/src/objects.h
index b7c67030c5..fcc1f9457b 100644
--- a/deps/v8/src/objects.h
+++ b/deps/v8/src/objects.h
@@ -22,7 +22,7 @@
#include "src/property-details.h"
#include "src/unicode-decoder.h"
#include "src/unicode.h"
-#include "src/zone.h"
+#include "src/zone/zone.h"
#if V8_TARGET_ARCH_ARM
#include "src/arm/constants-arm.h" // NOLINT
@@ -57,6 +57,7 @@
// - JSCollection
// - JSSet
// - JSMap
+// - JSStringIterator
// - JSSetIterator
// - JSMapIterator
// - JSWeakCollection
@@ -76,6 +77,7 @@
// - BytecodeArray
// - FixedArray
// - DescriptorArray
+// - FrameArray
// - LiteralsArray
// - HashTable
// - Dictionary
@@ -93,6 +95,8 @@
// - TemplateList
// - TransitionArray
// - ScopeInfo
+// - ModuleInfoEntry
+// - ModuleInfo
// - ScriptContextTable
// - WeakFixedArray
// - FixedDoubleArray
@@ -150,6 +154,7 @@
// - BreakPointInfo
// - CodeCache
// - PrototypeInfo
+// - Module
// - WeakCell
//
// Formats of Object*:
@@ -392,8 +397,10 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
V(TYPE_FEEDBACK_INFO_TYPE) \
V(ALIASED_ARGUMENTS_ENTRY_TYPE) \
V(BOX_TYPE) \
+ V(PROMISE_CONTAINER_TYPE) \
V(PROTOTYPE_INFO_TYPE) \
- V(SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION_TYPE) \
+ V(CONTEXT_EXTENSION_TYPE) \
+ V(MODULE_TYPE) \
\
V(FIXED_ARRAY_TYPE) \
V(FIXED_DOUBLE_ARRAY_TYPE) \
@@ -409,7 +416,6 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
V(JS_ARGUMENTS_TYPE) \
V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \
V(JS_GENERATOR_OBJECT_TYPE) \
- V(JS_MODULE_TYPE) \
V(JS_GLOBAL_OBJECT_TYPE) \
V(JS_GLOBAL_PROXY_TYPE) \
V(JS_API_OBJECT_TYPE) \
@@ -428,6 +434,7 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
V(JS_PROMISE_TYPE) \
V(JS_REGEXP_TYPE) \
V(JS_ERROR_TYPE) \
+ V(JS_STRING_ITERATOR_TYPE) \
\
V(JS_BOUND_FUNCTION_TYPE) \
V(JS_FUNCTION_TYPE) \
@@ -496,6 +503,7 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
// manually.
#define STRUCT_LIST(V) \
V(BOX, Box, box) \
+ V(PROMISE_CONTAINER, PromiseContainer, promise_container) \
V(ACCESSOR_INFO, AccessorInfo, accessor_info) \
V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \
V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \
@@ -511,9 +519,8 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
V(DEBUG_INFO, DebugInfo, debug_info) \
V(BREAK_POINT_INFO, BreakPointInfo, break_point_info) \
V(PROTOTYPE_INFO, PrototypeInfo, prototype_info) \
- V(SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION, \
- SloppyBlockWithEvalContextExtension, \
- sloppy_block_with_eval_context_extension)
+ V(MODULE, Module, module) \
+ V(CONTEXT_EXTENSION, ContextExtension, context_extension)
// We use the full 8 bits of the instance_type field to encode heap object
// instance types. The high-order bit (bit 7) is set if the object is not a
@@ -678,6 +685,7 @@ enum InstanceType {
TYPE_FEEDBACK_INFO_TYPE,
ALIASED_ARGUMENTS_ENTRY_TYPE,
BOX_TYPE,
+ PROMISE_CONTAINER_TYPE,
DEBUG_INFO_TYPE,
BREAK_POINT_INFO_TYPE,
FIXED_ARRAY_TYPE,
@@ -687,7 +695,8 @@ enum InstanceType {
TRANSITION_ARRAY_TYPE,
PROPERTY_CELL_TYPE,
PROTOTYPE_INFO_TYPE,
- SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION_TYPE,
+ CONTEXT_EXTENSION_TYPE,
+ MODULE_TYPE,
// All the following types are subtypes of JSReceiver, which corresponds to
// objects in the JS sense. The first and the last type in this range are
@@ -708,7 +717,6 @@ enum InstanceType {
JS_ARGUMENTS_TYPE,
JS_CONTEXT_EXTENSION_OBJECT_TYPE,
JS_GENERATOR_OBJECT_TYPE,
- JS_MODULE_TYPE,
JS_ARRAY_TYPE,
JS_ARRAY_BUFFER_TYPE,
JS_TYPED_ARRAY_TYPE,
@@ -722,6 +730,7 @@ enum InstanceType {
JS_PROMISE_TYPE,
JS_REGEXP_TYPE,
JS_ERROR_TYPE,
+ JS_STRING_ITERATOR_TYPE,
JS_BOUND_FUNCTION_TYPE,
JS_FUNCTION_TYPE, // LAST_JS_OBJECT_TYPE, LAST_JS_RECEIVER_TYPE
@@ -789,7 +798,6 @@ std::ostream& operator<<(std::ostream& os, InstanceType instance_type);
V(FAST_PROPERTIES_SUB_TYPE) \
V(FAST_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE) \
V(HANDLER_TABLE_SUB_TYPE) \
- V(INTRINSIC_FUNCTION_NAMES_SUB_TYPE) \
V(JS_COLLECTION_SUB_TYPE) \
V(JS_WEAK_COLLECTION_SUB_TYPE) \
V(LITERALS_ARRAY_SUB_TYPE) \
@@ -862,7 +870,7 @@ enum class ComparisonResult {
INLINE(static type* cast(Object* object)); \
INLINE(static const type* cast(const Object* object));
-
+class AbstractCode;
class AccessorPair;
class AllocationSite;
class AllocationSiteCreationContext;
@@ -878,6 +886,9 @@ class LayoutDescriptor;
class LiteralsArray;
class LookupIterator;
class FieldType;
+class ModuleDescriptor;
+class ModuleInfoEntry;
+class ModuleInfo;
class ObjectHashTable;
class ObjectVisitor;
class PropertyCell;
@@ -961,6 +972,7 @@ template <class C> inline bool Is(Object* obj);
V(JSGeneratorObject) \
V(Map) \
V(DescriptorArray) \
+ V(FrameArray) \
V(TransitionArray) \
V(LiteralsArray) \
V(TypeFeedbackMetadata) \
@@ -977,6 +989,8 @@ template <class C> inline bool Is(Object* obj);
V(ScriptContextTable) \
V(NativeContext) \
V(ScopeInfo) \
+ V(ModuleInfoEntry) \
+ V(ModuleInfo) \
V(JSBoundFunction) \
V(JSFunction) \
V(Code) \
@@ -998,6 +1012,7 @@ template <class C> inline bool Is(Object* obj);
V(JSProxy) \
V(JSError) \
V(JSPromise) \
+ V(JSStringIterator) \
V(JSSet) \
V(JSMap) \
V(JSSetIterator) \
@@ -1287,7 +1302,8 @@ class Object {
MUST_USE_RESULT static MaybeHandle<Object> InstanceOf(
Isolate* isolate, Handle<Object> object, Handle<Object> callable);
- MUST_USE_RESULT static MaybeHandle<Object> GetProperty(LookupIterator* it);
+ V8_EXPORT_PRIVATE MUST_USE_RESULT static MaybeHandle<Object> GetProperty(
+ LookupIterator* it);
// ES6 [[Set]] (when passed DONT_THROW)
// Invariants for this and related functions (unless stated otherwise):
@@ -1313,10 +1329,6 @@ class Object {
LookupIterator* it, Handle<Object> value, LanguageMode language_mode,
StoreFromKeyed store_mode);
- MUST_USE_RESULT static MaybeHandle<Object> ReadAbsentProperty(
- LookupIterator* it);
- MUST_USE_RESULT static MaybeHandle<Object> ReadAbsentProperty(
- Isolate* isolate, Handle<Object> receiver, Handle<Object> name);
MUST_USE_RESULT static Maybe<bool> CannotCreateProperty(
Isolate* isolate, Handle<Object> receiver, Handle<Object> name,
Handle<Object> value, ShouldThrow should_throw);
@@ -1848,6 +1860,8 @@ enum class KeyCollectionMode {
static_cast<int>(v8::KeyCollectionMode::kIncludePrototypes)
};
+enum class AllocationSiteUpdateMode { kUpdate, kCheckOnly };
+
// JSReceiver includes types on which properties can be defined, i.e.,
// JSObject and JSProxy.
class JSReceiver: public HeapObject {
@@ -1952,7 +1966,7 @@ class JSReceiver: public HeapObject {
PropertyDescriptor* desc, PropertyDescriptor* current,
ShouldThrow should_throw, Handle<Name> property_name = Handle<Name>());
- MUST_USE_RESULT static Maybe<bool> GetOwnPropertyDescriptor(
+ V8_EXPORT_PRIVATE MUST_USE_RESULT static Maybe<bool> GetOwnPropertyDescriptor(
Isolate* isolate, Handle<JSReceiver> object, Handle<Object> key,
PropertyDescriptor* desc);
MUST_USE_RESULT static Maybe<bool> GetOwnPropertyDescriptor(
@@ -2060,7 +2074,7 @@ class JSObject: public JSReceiver {
// [elements]: The elements (properties with names that are integers).
//
// Elements can be in two general modes: fast and slow. Each mode
- // corrensponds to a set of object representations of elements that
+ // corresponds to a set of object representations of elements that
// have something in common.
//
// In the fast mode elements is a FixedArray and so each element can
@@ -2298,7 +2312,9 @@ class JSObject: public JSReceiver {
}
// These methods do not perform access checks!
- static void UpdateAllocationSite(Handle<JSObject> object,
+ template <AllocationSiteUpdateMode update_or_check =
+ AllocationSiteUpdateMode::kUpdate>
+ static bool UpdateAllocationSite(Handle<JSObject> object,
ElementsKind to_kind);
// Lookup interceptors are used for handling properties controlled by host
@@ -2604,6 +2620,10 @@ class JSDataPropertyDescriptor: public JSObject {
// as specified by ES6 section 25.1.1.3 The IteratorResult Interface
class JSIteratorResult: public JSObject {
public:
+ DECL_ACCESSORS(value, Object)
+
+ DECL_ACCESSORS(done, Object)
+
// Offsets of object fields.
static const int kValueOffset = JSObject::kHeaderSize;
static const int kDoneOffset = kValueOffset + kPointerSize;
@@ -2895,7 +2915,6 @@ class WeakFixedArray : public FixedArray {
DISALLOW_IMPLICIT_CONSTRUCTORS(WeakFixedArray);
};
-
// Generic array grows dynamically with O(1) amortized insertion.
class ArrayList : public FixedArray {
public:
@@ -2925,6 +2944,82 @@ class ArrayList : public FixedArray {
DISALLOW_IMPLICIT_CONSTRUCTORS(ArrayList);
};
+#define FRAME_ARRAY_FIELD_LIST(V) \
+ V(WasmObject, Object) \
+ V(WasmFunctionIndex, Smi) \
+ V(Receiver, Object) \
+ V(Function, JSFunction) \
+ V(Code, AbstractCode) \
+ V(Offset, Smi) \
+ V(Flags, Smi)
+
+// Container object for data collected during simple stack trace captures.
+class FrameArray : public FixedArray {
+ public:
+#define DECLARE_FRAME_ARRAY_ACCESSORS(name, type) \
+ inline type* name(int frame_ix) const; \
+ inline void Set##name(int frame_ix, type* value);
+ FRAME_ARRAY_FIELD_LIST(DECLARE_FRAME_ARRAY_ACCESSORS)
+#undef DECLARE_FRAME_ARRAY_ACCESSORS
+
+ inline bool IsWasmFrame(int frame_ix) const;
+ inline int FrameCount() const;
+
+ void ShrinkToFit();
+
+ // Flags.
+ static const int kIsWasmFrame = 1 << 0;
+ static const int kIsStrict = 1 << 1;
+ static const int kForceConstructor = 1 << 2;
+
+ static Handle<FrameArray> AppendJSFrame(Handle<FrameArray> in,
+ Handle<Object> receiver,
+ Handle<JSFunction> function,
+ Handle<AbstractCode> code, int offset,
+ int flags);
+ static Handle<FrameArray> AppendWasmFrame(Handle<FrameArray> in,
+ Handle<Object> wasm_object,
+ int wasm_function_index,
+ Handle<AbstractCode> code,
+ int offset, int flags);
+
+ DECLARE_CAST(FrameArray)
+
+ private:
+ // The underlying fixed array embodies a captured stack trace. Frame i
+ // occupies indices
+ //
+ // kFirstIndex + 1 + [i * kElementsPerFrame, (i + 1) * kElementsPerFrame[,
+ //
+ // with internal offsets as below:
+
+ static const int kWasmObjectOffset = 0;
+ static const int kWasmFunctionIndexOffset = 1;
+
+ static const int kReceiverOffset = 0;
+ static const int kFunctionOffset = 1;
+
+ static const int kCodeOffset = 2;
+ static const int kOffsetOffset = 3;
+
+ static const int kFlagsOffset = 4;
+
+ static const int kElementsPerFrame = 5;
+
+ // Array layout indices.
+
+ static const int kFrameCountIndex = 0;
+ static const int kFirstIndex = 1;
+
+ static int LengthFor(int frame_count) {
+ return kFirstIndex + frame_count * kElementsPerFrame;
+ }
+
+ static Handle<FrameArray> EnsureSpace(Handle<FrameArray> array, int length);
+
+ friend class Factory;
+ DISALLOW_IMPLICIT_CONSTRUCTORS(FrameArray);
+};
// DescriptorArrays are fixed arrays used to hold instance descriptors.
// The format of the these objects is:
@@ -3410,7 +3505,8 @@ class StringTable: public HashTable<StringTable,
public:
// Find string in the string table. If it is not there yet, it is
// added. The return value is the string found.
- static Handle<String> LookupString(Isolate* isolate, Handle<String> key);
+ V8_EXPORT_PRIVATE static Handle<String> LookupString(Isolate* isolate,
+ Handle<String> key);
static Handle<String> LookupKey(Isolate* isolate, HashTableKey* key);
static String* LookupKeyIfExists(Isolate* isolate, HashTableKey* key);
@@ -4236,6 +4332,8 @@ class ScopeInfo : public FixedArray {
// Return the function_name if present.
String* FunctionName();
+ ModuleInfo* ModuleDescriptorInfo();
+
// Return the name of the given parameter.
String* ParameterName(int var);
@@ -4279,15 +4377,11 @@ class ScopeInfo : public FixedArray {
VariableMode* mode, InitializationFlag* init_flag,
MaybeAssignedFlag* maybe_assigned_flag);
- // Similar to ContextSlotIndex() but this method searches only among
- // global slots of the serialized scope info. Returns the context slot index
- // for a given slot name if the slot is present; otherwise returns a
- // value < 0. The name must be an internalized string. If the slot is present
- // and mode != NULL, sets *mode to the corresponding mode for that variable.
- static int ContextGlobalSlotIndex(Handle<ScopeInfo> scope_info,
- Handle<String> name, VariableMode* mode,
- InitializationFlag* init_flag,
- MaybeAssignedFlag* maybe_assigned_flag);
+ // Lookup metadata of a MODULE-allocated variable. Return a negative value if
+ // there is no module variable with the given name.
+ int ModuleIndex(Handle<String> name, VariableMode* mode,
+ InitializationFlag* init_flag,
+ MaybeAssignedFlag* maybe_assigned_flag);
// Lookup the name of a certain context slot by its index.
String* ContextSlotName(int slot_index);
@@ -4301,7 +4395,7 @@ class ScopeInfo : public FixedArray {
// slot index if the function name is present and context-allocated (named
// function expressions, only), otherwise returns a value < 0. The name
// must be an internalized string.
- int FunctionContextSlotIndex(String* name, VariableMode* mode);
+ int FunctionContextSlotIndex(String* name);
// Lookup support for serialized scope info. Returns the receiver context
// slot index if scope has a "this" binding, and the binding is
@@ -4310,7 +4404,27 @@ class ScopeInfo : public FixedArray {
FunctionKind function_kind();
- static Handle<ScopeInfo> Create(Isolate* isolate, Zone* zone, Scope* scope);
+ // Returns true if this ScopeInfo is linked to a outer ScopeInfo.
+ bool HasOuterScopeInfo();
+
+ // Returns true if this ScopeInfo was created for a debug-evaluate scope.
+ bool IsDebugEvaluateScope();
+
+ // Can be used to mark a ScopeInfo that looks like a with-scope as actually
+ // being a debug-evaluate scope.
+ void SetIsDebugEvaluateScope();
+
+ // Return the outer ScopeInfo if present.
+ ScopeInfo* OuterScopeInfo();
+
+#ifdef DEBUG
+ bool Equals(ScopeInfo* other) const;
+#endif
+
+ static Handle<ScopeInfo> Create(Isolate* isolate, Zone* zone, Scope* scope,
+ MaybeHandle<ScopeInfo> outer_scope);
+ static Handle<ScopeInfo> CreateForWithScope(
+ Isolate* isolate, MaybeHandle<ScopeInfo> outer_scope);
static Handle<ScopeInfo> CreateGlobalThisBinding(Isolate* isolate);
// Serializes empty scope info.
@@ -4322,18 +4436,16 @@ class ScopeInfo : public FixedArray {
// The layout of the static part of a ScopeInfo is as follows. Each entry is
// numeric and occupies one array slot.
- // 1. A set of properties of the scope
- // 2. The number of parameters. This only applies to function scopes. For
- // non-function scopes this is 0.
- // 3. The number of non-parameter variables allocated on the stack.
- // 4. The number of non-parameter and parameter variables allocated in the
- // context.
+// 1. A set of properties of the scope.
+// 2. The number of parameters. For non-function scopes this is 0.
+// 3. The number of non-parameter variables allocated on the stack.
+// 4. The number of non-parameter and parameter variables allocated in the
+// context.
#define FOR_EACH_SCOPE_INFO_NUMERIC_FIELD(V) \
V(Flags) \
V(ParameterCount) \
V(StackLocalCount) \
- V(ContextLocalCount) \
- V(ContextGlobalCount)
+ V(ContextLocalCount)
#define FIELD_ACCESSORS(name) \
inline void Set##name(int value); \
@@ -4350,7 +4462,7 @@ class ScopeInfo : public FixedArray {
private:
// The layout of the variable part of a ScopeInfo is as follows:
- // 1. ParameterEntries:
+ // 1. ParameterNames:
// This part stores the names of the parameters for function scopes. One
// slot is used per parameter, so in total this part occupies
// ParameterCount() slots in the array. For other scopes than function
@@ -4358,40 +4470,48 @@ class ScopeInfo : public FixedArray {
// 2. StackLocalFirstSlot:
// Index of a first stack slot for stack local. Stack locals belonging to
// this scope are located on a stack at slots starting from this index.
- // 3. StackLocalEntries:
+ // 3. StackLocalNames:
// Contains the names of local variables that are allocated on the stack,
- // in increasing order of the stack slot index. First local variable has
- // a stack slot index defined in StackLocalFirstSlot (point 2 above).
+ // in increasing order of the stack slot index. First local variable has a
+ // stack slot index defined in StackLocalFirstSlot (point 2 above).
// One slot is used per stack local, so in total this part occupies
// StackLocalCount() slots in the array.
- // 4. ContextLocalNameEntries:
+ // 4. ContextLocalNames:
// Contains the names of local variables and parameters that are allocated
// in the context. They are stored in increasing order of the context slot
// index starting with Context::MIN_CONTEXT_SLOTS. One slot is used per
// context local, so in total this part occupies ContextLocalCount() slots
// in the array.
- // 5. ContextLocalInfoEntries:
+ // 5. ContextLocalInfos:
// Contains the variable modes and initialization flags corresponding to
- // the context locals in ContextLocalNameEntries. One slot is used per
+ // the context locals in ContextLocalNames. One slot is used per
// context local, so in total this part occupies ContextLocalCount()
// slots in the array.
- // 6. RecieverEntryIndex:
+ // 6. ReceiverInfo:
// If the scope binds a "this" value, one slot is reserved to hold the
// context or stack slot index for the variable.
- // 7. FunctionNameEntryIndex:
+ // 7. FunctionNameInfo:
// If the scope belongs to a named function expression this part contains
// information about the function variable. It always occupies two array
// slots: a. The name of the function variable.
// b. The context or stack slot index for the variable.
- int ParameterEntriesIndex();
+ // 8. OuterScopeInfoIndex:
+ // The outer scope's ScopeInfo or the hole if there's none.
+ // 9. ModuleInfo, ModuleVariableCount, and ModuleVariables:
+ // For a module scope, this part contains the ModuleInfo, the number of
+ // MODULE-allocated variables, and the metadata of those variables. For
+ // non-module scopes it is empty.
+ int ParameterNamesIndex();
int StackLocalFirstSlotIndex();
- int StackLocalEntriesIndex();
- int ContextLocalNameEntriesIndex();
- int ContextGlobalNameEntriesIndex();
- int ContextLocalInfoEntriesIndex();
- int ContextGlobalInfoEntriesIndex();
- int ReceiverEntryIndex();
- int FunctionNameEntryIndex();
+ int StackLocalNamesIndex();
+ int ContextLocalNamesIndex();
+ int ContextLocalInfosIndex();
+ int ReceiverInfoIndex();
+ int FunctionNameInfoIndex();
+ int OuterScopeInfoIndex();
+ int ModuleInfoIndex();
+ int ModuleVariableCountIndex();
+ int ModuleVariablesIndex();
int Lookup(Handle<String> name, int start, int end, VariableMode* mode,
VariableLocation* location, InitializationFlag* init_flag,
@@ -4416,26 +4536,77 @@ class ScopeInfo : public FixedArray {
: public BitField<bool, ReceiverVariableField::kNext, 1> {};
class FunctionVariableField
: public BitField<VariableAllocationInfo, HasNewTargetField::kNext, 2> {};
- class FunctionVariableMode
- : public BitField<VariableMode, FunctionVariableField::kNext, 3> {};
- class AsmModuleField : public BitField<bool, FunctionVariableMode::kNext, 1> {
- };
+ class AsmModuleField
+ : public BitField<bool, FunctionVariableField::kNext, 1> {};
class AsmFunctionField : public BitField<bool, AsmModuleField::kNext, 1> {};
class HasSimpleParametersField
: public BitField<bool, AsmFunctionField::kNext, 1> {};
class FunctionKindField
- : public BitField<FunctionKind, HasSimpleParametersField::kNext, 9> {};
+ : public BitField<FunctionKind, HasSimpleParametersField::kNext, 10> {};
+ class HasOuterScopeInfoField
+ : public BitField<bool, FunctionKindField::kNext, 1> {};
+ class IsDebugEvaluateScopeField
+ : public BitField<bool, HasOuterScopeInfoField::kNext, 1> {};
- // BitFields representing the encoded information for context locals in the
- // ContextLocalInfoEntries part.
- class ContextLocalMode: public BitField<VariableMode, 0, 3> {};
- class ContextLocalInitFlag: public BitField<InitializationFlag, 3, 1> {};
- class ContextLocalMaybeAssignedFlag
- : public BitField<MaybeAssignedFlag, 4, 1> {};
+ // Properties of variables.
+ class VariableModeField : public BitField<VariableMode, 0, 3> {};
+ class InitFlagField : public BitField<InitializationFlag, 3, 1> {};
+ class MaybeAssignedFlagField : public BitField<MaybeAssignedFlag, 4, 1> {};
friend class ScopeIterator;
};
+class ModuleInfoEntry : public FixedArray {
+ public:
+ DECLARE_CAST(ModuleInfoEntry)
+ static Handle<ModuleInfoEntry> New(Isolate* isolate,
+ Handle<Object> export_name,
+ Handle<Object> local_name,
+ Handle<Object> import_name,
+ Handle<Object> module_request);
+ inline Object* export_name() const;
+ inline Object* local_name() const;
+ inline Object* import_name() const;
+ inline Object* module_request() const;
+
+ private:
+ friend class Factory;
+ enum {
+ kExportNameIndex,
+ kLocalNameIndex,
+ kImportNameIndex,
+ kModuleRequestIndex,
+ kLength
+ };
+};
+
+// ModuleInfo is to ModuleDescriptor what ScopeInfo is to Scope.
+class ModuleInfo : public FixedArray {
+ public:
+ DECLARE_CAST(ModuleInfo)
+ static Handle<ModuleInfo> New(Isolate* isolate, Zone* zone,
+ ModuleDescriptor* descr);
+ inline FixedArray* module_requests() const;
+ inline FixedArray* special_exports() const;
+ inline FixedArray* regular_exports() const;
+ inline FixedArray* namespace_imports() const;
+ inline FixedArray* regular_imports() const;
+
+#ifdef DEBUG
+ inline bool Equals(ModuleInfo* other) const;
+#endif
+
+ private:
+ friend class Factory;
+ enum {
+ kModuleRequestsIndex,
+ kSpecialExportsIndex,
+ kRegularExportsIndex,
+ kNamespaceImportsIndex,
+ kRegularImportsIndex,
+ kLength
+ };
+};
// The cache for maps used by normalized (dictionary mode) objects.
// Such maps do not have property descriptors, so a typical program
@@ -4487,6 +4658,9 @@ class HandlerTable : public FixedArray {
// catching are part of a desugaring and should therefore not
// be visible to the user (we won't notify the debugger of such
// exceptions).
+ ASYNC_AWAIT, // The exception will be caught and cause a promise rejection
+ // in the desugaring of an async function, so special
+ // async/await handling in the debugger can take place.
};
// Getters for handler table based on ranges.
@@ -4539,8 +4713,8 @@ class HandlerTable : public FixedArray {
static const int kReturnEntrySize = 2;
// Encoding of the {handler} field.
- class HandlerPredictionField : public BitField<CatchPrediction, 0, 2> {};
- class HandlerOffsetField : public BitField<int, 2, 30> {};
+ class HandlerPredictionField : public BitField<CatchPrediction, 0, 3> {};
+ class HandlerOffsetField : public BitField<int, 3, 29> {};
};
// ByteArray represents fixed sized byte arrays. Used for the relocation info
@@ -4684,6 +4858,13 @@ class BytecodeArray : public FixedArrayBase {
// Maximal length of a single BytecodeArray.
static const int kMaxLength = kMaxSize - kHeaderSize;
+ static const int kPointerFieldsBeginOffset = kConstantPoolOffset;
+ static const int kPointerFieldsEndOffset = kFrameSizeOffset;
+
+ typedef FixedBodyDescriptor<kPointerFieldsBeginOffset,
+ kPointerFieldsEndOffset, kHeaderSize>
+ MarkingBodyDescriptor;
+
class BodyDescriptor;
private:
@@ -4721,6 +4902,7 @@ class FreeSpace: public HeapObject {
// Size is smi tagged when it is stored.
static const int kSizeOffset = HeapObject::kHeaderSize;
static const int kNextOffset = POINTER_SIZE_ALIGN(kSizeOffset + kPointerSize);
+ static const int kSize = kNextOffset + kPointerSize;
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(FreeSpace);
@@ -6226,6 +6408,7 @@ class Map: public HeapObject {
inline bool IsJSFunctionMap();
inline bool IsStringMap();
inline bool IsJSProxyMap();
+ inline bool IsModuleMap();
inline bool IsJSGlobalProxyMap();
inline bool IsJSGlobalObjectMap();
inline bool IsJSTypedArrayMap();
@@ -6482,6 +6665,34 @@ class Struct: public HeapObject {
DECLARE_CAST(Struct)
};
+// A container struct to hold state required for
+// PromiseResolveThenableJob. {before, after}_debug_event could
+// potentially be undefined if the debugger is turned off.
+class PromiseContainer : public Struct {
+ public:
+ DECL_ACCESSORS(thenable, JSReceiver)
+ DECL_ACCESSORS(then, JSReceiver)
+ DECL_ACCESSORS(resolve, JSFunction)
+ DECL_ACCESSORS(reject, JSFunction)
+ DECL_ACCESSORS(before_debug_event, Object)
+ DECL_ACCESSORS(after_debug_event, Object)
+
+ static const int kThenableOffset = Struct::kHeaderSize;
+ static const int kThenOffset = kThenableOffset + kPointerSize;
+ static const int kResolveOffset = kThenOffset + kPointerSize;
+ static const int kRejectOffset = kResolveOffset + kPointerSize;
+ static const int kBeforeDebugEventOffset = kRejectOffset + kPointerSize;
+ static const int kAfterDebugEventOffset =
+ kBeforeDebugEventOffset + kPointerSize;
+ static const int kSize = kAfterDebugEventOffset + kPointerSize;
+
+ DECLARE_CAST(PromiseContainer)
+ DECLARE_PRINTER(PromiseContainer)
+ DECLARE_VERIFIER(PromiseContainer)
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(PromiseContainer);
+};
// A simple one-element struct, useful where smis need to be boxed.
class Box : public Struct {
@@ -6559,28 +6770,29 @@ class PrototypeInfo : public Struct {
// Pair used to store both a ScopeInfo and an extension object in the extension
-// slot of a block context. Needed in the rare case where a declaration block
-// scope (a "varblock" as used to desugar parameter destructuring) also contains
-// a sloppy direct eval. (In no other case both are needed at the same time.)
-class SloppyBlockWithEvalContextExtension : public Struct {
+// slot of a block, catch, or with context. Needed in the rare case where a
+// declaration block scope (a "varblock" as used to desugar parameter
+// destructuring) also contains a sloppy direct eval, or for with and catch
+// scopes. (In no other case both are needed at the same time.)
+class ContextExtension : public Struct {
public:
// [scope_info]: Scope info.
DECL_ACCESSORS(scope_info, ScopeInfo)
// [extension]: Extension object.
- DECL_ACCESSORS(extension, JSObject)
+ DECL_ACCESSORS(extension, Object)
- DECLARE_CAST(SloppyBlockWithEvalContextExtension)
+ DECLARE_CAST(ContextExtension)
// Dispatched behavior.
- DECLARE_PRINTER(SloppyBlockWithEvalContextExtension)
- DECLARE_VERIFIER(SloppyBlockWithEvalContextExtension)
+ DECLARE_PRINTER(ContextExtension)
+ DECLARE_VERIFIER(ContextExtension)
static const int kScopeInfoOffset = HeapObject::kHeaderSize;
static const int kExtensionOffset = kScopeInfoOffset + kPointerSize;
static const int kSize = kExtensionOffset + kPointerSize;
private:
- DISALLOW_IMPLICIT_CONSTRUCTORS(SloppyBlockWithEvalContextExtension);
+ DISALLOW_IMPLICIT_CONSTRUCTORS(ContextExtension);
};
@@ -6803,6 +7015,15 @@ class Script: public Struct {
V(Array.prototype, push, ArrayPush) \
V(Array.prototype, pop, ArrayPop) \
V(Array.prototype, shift, ArrayShift) \
+ V(Date.prototype, getDate, DateGetDate) \
+ V(Date.prototype, getDay, DateGetDay) \
+ V(Date.prototype, getFullYear, DateGetFullYear) \
+ V(Date.prototype, getHours, DateGetHours) \
+ V(Date.prototype, getMilliseconds, DateGetMilliseconds) \
+ V(Date.prototype, getMinutes, DateGetMinutes) \
+ V(Date.prototype, getMonth, DateGetMonth) \
+ V(Date.prototype, getSeconds, DateGetSeconds) \
+ V(Date.prototype, getTime, DateGetTime) \
V(Function.prototype, apply, FunctionApply) \
V(Function.prototype, call, FunctionCall) \
V(Object.prototype, hasOwnProperty, ObjectHasOwnProperty) \
@@ -6847,6 +7068,10 @@ class Script: public Struct {
V(Math, clz32, MathClz32) \
V(Math, fround, MathFround) \
V(Math, trunc, MathTrunc) \
+ V(Number, isFinite, NumberIsFinite) \
+ V(Number, isInteger, NumberIsInteger) \
+ V(Number, isNaN, NumberIsNaN) \
+ V(Number, isSafeInteger, NumberIsSafeInteger) \
V(Number, parseInt, NumberParseInt) \
V(Number.prototype, toString, NumberToString)
@@ -6869,16 +7094,20 @@ enum BuiltinFunctionId {
kDataViewBuffer,
kDataViewByteLength,
kDataViewByteOffset,
+ kFunctionHasInstance,
kGlobalDecodeURI,
kGlobalDecodeURIComponent,
kGlobalEncodeURI,
kGlobalEncodeURIComponent,
kGlobalEscape,
kGlobalUnescape,
+ kGlobalIsFinite,
+ kGlobalIsNaN,
kTypedArrayByteLength,
kTypedArrayByteOffset,
kTypedArrayLength,
kSharedArrayBufferByteLength,
+ kStringIteratorNext,
};
@@ -6984,6 +7213,10 @@ class SharedFunctionInfo: public HeapObject {
// [scope_info]: Scope info.
DECL_ACCESSORS(scope_info, ScopeInfo)
+ // The outer scope info for the purpose of parsing this function, or the hole
+ // value if it isn't yet known.
+ DECL_ACCESSORS(outer_scope_info, HeapObject)
+
// [construct stub]: Code stub for constructing instances of this function.
DECL_ACCESSORS(construct_stub, Code)
@@ -7191,30 +7424,11 @@ class SharedFunctionInfo: public HeapObject {
// Indicates that code for this function cannot be flushed.
DECL_BOOLEAN_ACCESSORS(dont_flush)
- // Indicates that this function is a generator.
- DECL_BOOLEAN_ACCESSORS(is_generator)
-
- // Indicates that this function is an async function.
- DECL_BOOLEAN_ACCESSORS(is_async)
-
- // Indicates that this function can be suspended, either via YieldExpressions
- // or AwaitExpressions.
- inline bool is_resumable() const;
-
- // Indicates that this function is an arrow function.
- DECL_BOOLEAN_ACCESSORS(is_arrow)
-
- // Indicates that this function is a concise method.
- DECL_BOOLEAN_ACCESSORS(is_concise_method)
-
- // Indicates that this function is a getter.
- DECL_BOOLEAN_ACCESSORS(is_getter_function)
-
- // Indicates that this function is a setter.
- DECL_BOOLEAN_ACCESSORS(is_setter_function)
-
- // Indicates that this function is a default constructor.
- DECL_BOOLEAN_ACCESSORS(is_default_constructor)
+ // Indicates that this is a constructor for a base class with instance fields.
+ DECL_BOOLEAN_ACCESSORS(requires_class_field_init)
+ // Indicates that this is a synthesized function to set up class instance
+ // fields.
+ DECL_BOOLEAN_ACCESSORS(is_class_field_initializer)
// Indicates that this function is an asm function.
DECL_BOOLEAN_ACCESSORS(asm_function)
@@ -7231,7 +7445,7 @@ class SharedFunctionInfo: public HeapObject {
// Indicates that asm->wasm conversion failed and should not be re-attempted.
DECL_BOOLEAN_ACCESSORS(is_asm_wasm_broken)
- inline FunctionKind kind();
+ inline FunctionKind kind() const;
inline void set_kind(FunctionKind kind);
// Indicates whether or not the code in the shared function support
@@ -7331,11 +7545,12 @@ class SharedFunctionInfo: public HeapObject {
// Layout description.
// Pointer fields.
- static const int kNameOffset = HeapObject::kHeaderSize;
- static const int kCodeOffset = kNameOffset + kPointerSize;
- static const int kOptimizedCodeMapOffset = kCodeOffset + kPointerSize;
+ static const int kCodeOffset = HeapObject::kHeaderSize;
+ static const int kNameOffset = kCodeOffset + kPointerSize;
+ static const int kOptimizedCodeMapOffset = kNameOffset + kPointerSize;
static const int kScopeInfoOffset = kOptimizedCodeMapOffset + kPointerSize;
- static const int kConstructStubOffset = kScopeInfoOffset + kPointerSize;
+ static const int kOuterScopeInfoOffset = kScopeInfoOffset + kPointerSize;
+ static const int kConstructStubOffset = kOuterScopeInfoOffset + kPointerSize;
static const int kInstanceClassNameOffset =
kConstructStubOffset + kPointerSize;
static const int kFunctionDataOffset =
@@ -7457,9 +7672,12 @@ class SharedFunctionInfo: public HeapObject {
static const int kAlignedSize = POINTER_SIZE_ALIGN(kSize);
+ typedef FixedBodyDescriptor<kCodeOffset,
+ kLastPointerFieldOffset + kPointerSize, kSize>
+ BodyDescriptor;
typedef FixedBodyDescriptor<kNameOffset,
- kLastPointerFieldOffset + kPointerSize,
- kSize> BodyDescriptor;
+ kLastPointerFieldOffset + kPointerSize, kSize>
+ BodyDescriptorWeakCode;
// Bit positions in start_position_and_type.
// The source code start position is in the 30 most significant bits of
@@ -7491,38 +7709,19 @@ class SharedFunctionInfo: public HeapObject {
kDontFlush,
// byte 2
kFunctionKind,
- kIsArrow = kFunctionKind,
- kIsGenerator,
- kIsConciseMethod,
- kIsDefaultConstructor,
- kIsSubclassConstructor,
- kIsBaseConstructor,
- kIsGetterFunction,
- kIsSetterFunction,
+ // rest of byte 2 and first two bits of byte 3 are used by FunctionKind
// byte 3
- kIsAsyncFunction,
- kDeserialized,
+ kDeserialized = kFunctionKind + 10,
kIsDeclaration,
kIsAsmWasmBroken,
+ kRequiresClassFieldInit,
+ kIsClassFieldInitializer,
kCompilerHintsCount, // Pseudo entry
};
// kFunctionKind has to be byte-aligned
STATIC_ASSERT((kFunctionKind % kBitsPerByte) == 0);
-// Make sure that FunctionKind and byte 2 are in sync:
-#define ASSERT_FUNCTION_KIND_ORDER(functionKind, compilerFunctionKind) \
- STATIC_ASSERT(FunctionKind::functionKind == \
- 1 << (compilerFunctionKind - kFunctionKind))
- ASSERT_FUNCTION_KIND_ORDER(kArrowFunction, kIsArrow);
- ASSERT_FUNCTION_KIND_ORDER(kGeneratorFunction, kIsGenerator);
- ASSERT_FUNCTION_KIND_ORDER(kConciseMethod, kIsConciseMethod);
- ASSERT_FUNCTION_KIND_ORDER(kDefaultConstructor, kIsDefaultConstructor);
- ASSERT_FUNCTION_KIND_ORDER(kSubclassConstructor, kIsSubclassConstructor);
- ASSERT_FUNCTION_KIND_ORDER(kBaseConstructor, kIsBaseConstructor);
- ASSERT_FUNCTION_KIND_ORDER(kGetterFunction, kIsGetterFunction);
- ASSERT_FUNCTION_KIND_ORDER(kSetterFunction, kIsSetterFunction);
-#undef ASSERT_FUNCTION_KIND_ORDER
-
- class FunctionKindBits : public BitField<FunctionKind, kIsArrow, 9> {};
+
+ class FunctionKindBits : public BitField<FunctionKind, kFunctionKind, 10> {};
class DeoptCountBits : public BitField<int, 0, 4> {};
class OptReenableTriesBits : public BitField<int, 4, 18> {};
@@ -7554,21 +7753,10 @@ class SharedFunctionInfo: public HeapObject {
static const int kHasDuplicateParametersBit =
kHasDuplicateParameters + kCompilerHintsSmiTagSize;
- static const int kIsArrowBit = kIsArrow + kCompilerHintsSmiTagSize;
- static const int kIsGeneratorBit = kIsGenerator + kCompilerHintsSmiTagSize;
- static const int kIsConciseMethodBit =
- kIsConciseMethod + kCompilerHintsSmiTagSize;
- static const int kIsAsyncFunctionBit =
- kIsAsyncFunction + kCompilerHintsSmiTagSize;
-
- static const int kAccessorFunctionBits =
- FunctionKind::kAccessorFunction
- << (kFunctionKind + kCompilerHintsSmiTagSize);
- static const int kClassConstructorBits =
- FunctionKind::kClassConstructor
- << (kFunctionKind + kCompilerHintsSmiTagSize);
- static const int kFunctionKindMaskBits = FunctionKindBits::kMask
- << kCompilerHintsSmiTagSize;
+ static const int kFunctionKindShift =
+ kFunctionKind + kCompilerHintsSmiTagSize;
+ static const int kAllFunctionKindBitsMask = FunctionKindBits::kMask
+ << kCompilerHintsSmiTagSize;
// Constants for optimizing codegen for strict mode function and
// native tests.
@@ -7687,6 +7875,100 @@ class JSGeneratorObject: public JSObject {
DISALLOW_IMPLICIT_CONSTRUCTORS(JSGeneratorObject);
};
+// A Module object is a mapping from export names to cells
+// This is still very much in flux.
+class Module : public Struct {
+ public:
+ DECLARE_CAST(Module)
+ DECLARE_VERIFIER(Module)
+ DECLARE_PRINTER(Module)
+
+ // The code representing this Module, either a
+ // SharedFunctionInfo or a JSFunction depending
+ // on whether it's been instantiated.
+ DECL_ACCESSORS(code, Object)
+
+ DECL_ACCESSORS(exports, ObjectHashTable)
+
+ // [[RequestedModules]]: Modules imported or re-exported by this module.
+ // Corresponds 1-to-1 to the module specifier strings in
+ // ModuleInfo::module_requests.
+ DECL_ACCESSORS(requested_modules, FixedArray)
+
+ // [[Evaluated]]: Whether this module has been evaluated. Modules
+ // are only evaluated a single time.
+ DECL_BOOLEAN_ACCESSORS(evaluated)
+
+ // Storage for [[Evaluated]]
+ DECL_INT_ACCESSORS(flags)
+
+ // Embedder-specified data
+ DECL_ACCESSORS(embedder_data, Object)
+
+ // Get the SharedFunctionInfo associated with the code.
+ inline SharedFunctionInfo* shared() const;
+
+ // Get the ModuleInfo associated with the code.
+ inline ModuleInfo* info() const;
+
+ // Compute a hash for this object.
+ inline uint32_t Hash() const;
+
+ // Implementation of spec operation ModuleDeclarationInstantiation.
+ // Returns false if an exception occurred during instantiation, true
+ // otherwise.
+ static MUST_USE_RESULT bool Instantiate(Handle<Module> module,
+ v8::Local<v8::Context> context,
+ v8::Module::ResolveCallback callback,
+ v8::Local<v8::Value> callback_data);
+
+ // Implementation of spec operation ModuleEvaluation.
+ static MUST_USE_RESULT MaybeHandle<Object> Evaluate(Handle<Module> module);
+
+ static Handle<Object> LoadExport(Handle<Module> module, Handle<String> name);
+ static void StoreExport(Handle<Module> module, Handle<String> name,
+ Handle<Object> value);
+
+ static Handle<Object> LoadImport(Handle<Module> module, Handle<String> name,
+ int module_request);
+
+ static const int kCodeOffset = HeapObject::kHeaderSize;
+ static const int kExportsOffset = kCodeOffset + kPointerSize;
+ static const int kRequestedModulesOffset = kExportsOffset + kPointerSize;
+ static const int kFlagsOffset = kRequestedModulesOffset + kPointerSize;
+ static const int kEmbedderDataOffset = kFlagsOffset + kPointerSize;
+ static const int kSize = kEmbedderDataOffset + kPointerSize;
+
+ private:
+ enum { kEvaluatedBit };
+
+ static void CreateExport(Handle<Module> module, Handle<FixedArray> names);
+ static void CreateIndirectExport(Handle<Module> module, Handle<String> name,
+ Handle<ModuleInfoEntry> entry);
+
+ // The [must_resolve] argument indicates whether or not an exception should be
+ // thrown in case the module does not provide an export named [name]
+ // (including when a cycle is detected). An exception is always thrown in the
+ // case of conflicting star exports.
+ //
+ // If [must_resolve] is true, a null result indicates an exception. If
+ // [must_resolve] is false, a null result may or may not indicate an
+ // exception (so check manually!).
+ class ResolveSet;
+ static MUST_USE_RESULT MaybeHandle<Cell> ResolveExport(
+ Handle<Module> module, Handle<String> name, bool must_resolve,
+ ResolveSet* resolve_set);
+ static MUST_USE_RESULT MaybeHandle<Cell> ResolveImport(
+ Handle<Module> module, Handle<String> name, int module_request,
+ bool must_resolve, ResolveSet* resolve_set);
+
+ // Helper for ResolveExport.
+ static MUST_USE_RESULT MaybeHandle<Cell> ResolveExportUsingStarExports(
+ Handle<Module> module, Handle<String> name, bool must_resolve,
+ ResolveSet* resolve_set);
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(Module);
+};
// JSBoundFunction describes a bound function exotic object.
class JSBoundFunction : public JSObject {
@@ -8219,7 +8501,8 @@ class JSRegExp: public JSObject {
DECL_ACCESSORS(flags, Object)
DECL_ACCESSORS(source, Object)
- static MaybeHandle<JSRegExp> New(Handle<String> source, Flags flags);
+ V8_EXPORT_PRIVATE static MaybeHandle<JSRegExp> New(Handle<String> source,
+ Flags flags);
static Handle<JSRegExp> Copy(Handle<JSRegExp> regexp);
static MaybeHandle<JSRegExp> Initialize(Handle<JSRegExp> regexp,
@@ -8585,7 +8868,9 @@ class AllocationSite: public Struct {
inline bool SitePointsToLiteral();
- static void DigestTransitionFeedback(Handle<AllocationSite> site,
+ template <AllocationSiteUpdateMode update_or_check =
+ AllocationSiteUpdateMode::kUpdate>
+ static bool DigestTransitionFeedback(Handle<AllocationSite> site,
ElementsKind to_kind);
DECLARE_PRINTER(AllocationSite)
@@ -8612,6 +8897,10 @@ class AllocationSite: public Struct {
static const int kPointerFieldsBeginOffset = kTransitionInfoOffset;
static const int kPointerFieldsEndOffset = kWeakNextOffset;
+ typedef FixedBodyDescriptor<kPointerFieldsBeginOffset,
+ kPointerFieldsEndOffset, kSize>
+ MarkingBodyDescriptor;
+
// For other visitors, use the fixed body descriptor below.
typedef FixedBodyDescriptor<HeapObject::kHeaderSize, kSize, kSize>
BodyDescriptor;
@@ -8674,8 +8963,7 @@ class AliasedArgumentsEntry: public Struct {
enum AllowNullsFlag {ALLOW_NULLS, DISALLOW_NULLS};
enum RobustnessFlag {ROBUST_STRING_TRAVERSAL, FAST_STRING_TRAVERSAL};
-
-class StringHasher {
+class V8_EXPORT_PRIVATE StringHasher {
public:
explicit inline StringHasher(int length, uint32_t seed);
@@ -9123,6 +9411,9 @@ class String: public Name {
static int IndexOf(Isolate* isolate, Handle<String> sub, Handle<String> pat,
int start_index);
+ static Object* LastIndexOf(Isolate* isolate, Handle<Object> receiver,
+ Handle<Object> search, Handle<Object> position);
+
// String equality operations.
inline bool Equals(String* other);
inline static bool Equals(Handle<String> one, Handle<String> two);
@@ -9295,7 +9586,7 @@ class String: public Name {
static bool SlowEquals(Handle<String> one, Handle<String> two);
// Slow case of AsArrayIndex.
- bool SlowAsArrayIndex(uint32_t* index);
+ V8_EXPORT_PRIVATE bool SlowAsArrayIndex(uint32_t* index);
// Compute and set the hash code.
uint32_t ComputeAndSetHash();
@@ -9860,9 +10151,6 @@ class PropertyCell : public HeapObject {
static const int kDependentCodeOffset = kValueOffset + kPointerSize;
static const int kSize = kDependentCodeOffset + kPointerSize;
- static const int kPointerFieldsBeginOffset = kValueOffset;
- static const int kPointerFieldsEndOffset = kSize;
-
typedef FixedBodyDescriptor<kValueOffset,
kSize,
kSize> BodyDescriptor;
@@ -10055,6 +10343,28 @@ class JSMap : public JSCollection {
DISALLOW_IMPLICIT_CONSTRUCTORS(JSMap);
};
+class JSStringIterator : public JSObject {
+ public:
+ // Dispatched behavior.
+ DECLARE_PRINTER(JSStringIterator)
+ DECLARE_VERIFIER(JSStringIterator)
+
+ DECLARE_CAST(JSStringIterator)
+
+ // [string]: the [[IteratedString]] internal field.
+ DECL_ACCESSORS(string, String)
+
+ // [index]: The [[StringIteratorNextIndex]] internal field.
+ inline int index() const;
+ inline void set_index(int value);
+
+ static const int kStringOffset = JSObject::kHeaderSize;
+ static const int kNextIndexOffset = kStringOffset + kPointerSize;
+ static const int kSize = kNextIndexOffset + kPointerSize;
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(JSStringIterator);
+};
// OrderedHashTableIterator is an iterator that iterates over the keys and
// values of an OrderedHashTable.
@@ -10480,12 +10790,9 @@ class JSArray: public JSObject {
static const int kLengthOffset = JSObject::kHeaderSize;
static const int kSize = kLengthOffset + kPointerSize;
- // 600 * KB is the Page::kMaxRegularHeapObjectSize defined in spaces.h which
- // we do not want to include in objects.h
- // Note that Page::kMaxRegularHeapObjectSize has to be in sync with
- // kInitialMaxFastElementArray which is checked in a DCHECK in heap.cc.
static const int kInitialMaxFastElementArray =
- (600 * KB - FixedArray::kHeaderSize - kSize - AllocationMemento::kSize) /
+ (kMaxRegularHeapObjectSize - FixedArray::kHeaderSize - kSize -
+ AllocationMemento::kSize) /
kPointerSize;
private:
@@ -10684,8 +10991,10 @@ class InterceptorInfo: public Struct {
DECL_ACCESSORS(getter, Object)
DECL_ACCESSORS(setter, Object)
DECL_ACCESSORS(query, Object)
+ DECL_ACCESSORS(descriptor, Object)
DECL_ACCESSORS(deleter, Object)
DECL_ACCESSORS(enumerator, Object)
+ DECL_ACCESSORS(definer, Object)
DECL_ACCESSORS(data, Object)
DECL_BOOLEAN_ACCESSORS(can_intercept_symbols)
DECL_BOOLEAN_ACCESSORS(all_can_read)
@@ -10703,9 +11012,11 @@ class InterceptorInfo: public Struct {
static const int kGetterOffset = HeapObject::kHeaderSize;
static const int kSetterOffset = kGetterOffset + kPointerSize;
static const int kQueryOffset = kSetterOffset + kPointerSize;
- static const int kDeleterOffset = kQueryOffset + kPointerSize;
+ static const int kDescriptorOffset = kQueryOffset + kPointerSize;
+ static const int kDeleterOffset = kDescriptorOffset + kPointerSize;
static const int kEnumeratorOffset = kDeleterOffset + kPointerSize;
- static const int kDataOffset = kEnumeratorOffset + kPointerSize;
+ static const int kDefinerOffset = kEnumeratorOffset + kPointerSize;
+ static const int kDataOffset = kDefinerOffset + kPointerSize;
static const int kFlagsOffset = kDataOffset + kPointerSize;
static const int kSize = kFlagsOffset + kPointerSize;