| Index: src/objects.h
|
| diff --git a/src/objects.h b/src/objects.h
|
| index 8868373799f399cbf3000cb54b93f77f36d6e0e3..bf8d00481965c3c774778420bf684ab6fef39ffc 100644
|
| --- a/src/objects.h
|
| +++ b/src/objects.h
|
| @@ -1542,10 +1542,7 @@ class Object : public MaybeObject {
|
| inline void VerifyApiCallResultType();
|
|
|
| // Prints this object without details.
|
| - inline void ShortPrint() {
|
| - ShortPrint(stdout);
|
| - }
|
| - void ShortPrint(FILE* out);
|
| + void ShortPrint(FILE* out = stdout);
|
|
|
| // Prints this object without details to a message accumulator.
|
| void ShortPrint(StringStream* accumulator);
|
| @@ -1584,10 +1581,7 @@ class Smi: public Object {
|
| static inline Smi* cast(Object* object);
|
|
|
| // Dispatched behavior.
|
| - inline void SmiPrint() {
|
| - SmiPrint(stdout);
|
| - }
|
| - void SmiPrint(FILE* out);
|
| + void SmiPrint(FILE* out = stdout);
|
| void SmiPrint(StringStream* accumulator);
|
|
|
| DECLARE_VERIFIER(Smi)
|
| @@ -1658,10 +1652,7 @@ class Failure: public MaybeObject {
|
| static inline Failure* cast(MaybeObject* object);
|
|
|
| // Dispatched behavior.
|
| - inline void FailurePrint() {
|
| - FailurePrint(stdout);
|
| - }
|
| - void FailurePrint(FILE* out);
|
| + void FailurePrint(FILE* out = stdout);
|
| void FailurePrint(StringStream* accumulator);
|
|
|
| DECLARE_VERIFIER(Failure)
|
| @@ -1790,12 +1781,9 @@ class HeapObject: public Object {
|
| // Dispatched behavior.
|
| void HeapObjectShortPrint(StringStream* accumulator);
|
| #ifdef OBJECT_PRINT
|
| - inline void HeapObjectPrint() {
|
| - HeapObjectPrint(stdout);
|
| - }
|
| - void HeapObjectPrint(FILE* out);
|
| void PrintHeader(FILE* out, const char* id);
|
| #endif
|
| + DECLARE_PRINTER(HeapObject)
|
| DECLARE_VERIFIER(HeapObject)
|
| #ifdef VERIFY_HEAP
|
| inline void VerifyObjectField(int offset);
|
| @@ -1879,10 +1867,7 @@ class HeapNumber: public HeapObject {
|
| // Dispatched behavior.
|
| bool HeapNumberBooleanValue();
|
|
|
| - inline void HeapNumberPrint() {
|
| - HeapNumberPrint(stdout);
|
| - }
|
| - void HeapNumberPrint(FILE* out);
|
| + void HeapNumberPrint(FILE* out = stdout);
|
| void HeapNumberPrint(StringStream* accumulator);
|
| DECLARE_VERIFIER(HeapNumber)
|
|
|
| @@ -1972,6 +1957,11 @@ class JSReceiver: public HeapObject {
|
| Handle<Object> value,
|
| PropertyAttributes attributes,
|
| StrictModeFlag strict_mode);
|
| + static Handle<Object> SetElement(Handle<JSReceiver> object,
|
| + uint32_t index,
|
| + Handle<Object> value,
|
| + PropertyAttributes attributes,
|
| + StrictModeFlag strict_mode);
|
|
|
| MUST_USE_RESULT static MaybeObject* SetPropertyOrFail(
|
| Handle<JSReceiver> object,
|
| @@ -2003,15 +1993,7 @@ class JSReceiver: public HeapObject {
|
| DeleteMode mode = NORMAL_DELETION);
|
| static Handle<Object> DeleteElement(Handle<JSReceiver> object,
|
| uint32_t index,
|
| - DeleteMode mode);
|
| -
|
| - // Set the index'th array element.
|
| - // Can cause GC, or return failure if GC is required.
|
| - MUST_USE_RESULT MaybeObject* SetElement(uint32_t index,
|
| - Object* value,
|
| - PropertyAttributes attributes,
|
| - StrictModeFlag strict_mode,
|
| - bool check_prototype);
|
| + DeleteMode mode = NORMAL_DELETION);
|
|
|
| // Tests for the fast common case for property enumeration.
|
| bool IsSimpleEnum();
|
| @@ -2282,7 +2264,8 @@ class JSObject: public JSReceiver {
|
|
|
| MaybeObject* LookupAccessor(Name* name, AccessorComponent component);
|
|
|
| - MUST_USE_RESULT MaybeObject* DefineAccessor(AccessorInfo* info);
|
| + static Handle<Object> SetAccessor(Handle<JSObject> object,
|
| + Handle<AccessorInfo> info);
|
|
|
| // Used from Object::GetProperty().
|
| MUST_USE_RESULT MaybeObject* GetPropertyWithFailedAccessCheck(
|
| @@ -2333,18 +2316,13 @@ class JSObject: public JSReceiver {
|
| Object* GetHiddenProperty(Name* key);
|
| // Deletes a hidden property. Deleting a non-existing property is
|
| // considered successful.
|
| - void DeleteHiddenProperty(Name* key);
|
| + static void DeleteHiddenProperty(Handle<JSObject> object,
|
| + Handle<Name> key);
|
| // Returns true if the object has a property with the hidden string as name.
|
| bool HasHiddenProperties();
|
|
|
| - static int GetIdentityHash(Handle<JSObject> obj);
|
| - MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag);
|
| - MUST_USE_RESULT MaybeObject* SetIdentityHash(Smi* hash, CreationFlag flag);
|
| -
|
| - static Handle<Object> DeleteElement(Handle<JSObject> obj,
|
| - uint32_t index,
|
| - DeleteMode mode = NORMAL_DELETION);
|
| - MUST_USE_RESULT MaybeObject* DeleteElement(uint32_t index, DeleteMode mode);
|
| + static int GetIdentityHash(Handle<JSObject> object);
|
| + static void SetIdentityHash(Handle<JSObject> object, Smi* hash);
|
|
|
| inline void ValidateElements();
|
|
|
| @@ -2668,19 +2646,9 @@ class JSObject: public JSReceiver {
|
| DECLARE_PRINTER(JSObject)
|
| DECLARE_VERIFIER(JSObject)
|
| #ifdef OBJECT_PRINT
|
| - inline void PrintProperties() {
|
| - PrintProperties(stdout);
|
| - }
|
| - void PrintProperties(FILE* out);
|
| -
|
| - inline void PrintElements() {
|
| - PrintElements(stdout);
|
| - }
|
| - void PrintElements(FILE* out);
|
| - inline void PrintTransitions() {
|
| - PrintTransitions(stdout);
|
| - }
|
| - void PrintTransitions(FILE* out);
|
| + void PrintProperties(FILE* out = stdout);
|
| + void PrintElements(FILE* out = stdout);
|
| + void PrintTransitions(FILE* out = stdout);
|
| #endif
|
|
|
| void PrintElementsTransition(
|
| @@ -2737,10 +2705,9 @@ class JSObject: public JSReceiver {
|
| // don't want to be wasteful with long lived objects.
|
| static const int kMaxUncheckedOldFastElementsLength = 500;
|
|
|
| - // TODO(2790): HAllocate currently always allocates fast backing stores
|
| - // in new space, where on x64 we can only fit ~98K elements. Keep this
|
| - // limit lower than that until HAllocate is made smarter.
|
| - static const int kInitialMaxFastElementArray = 95000;
|
| + // Note that Heap::MaxRegularSpaceAllocationSize() puts a limit on
|
| + // permissible values (see the ASSERT in heap.cc).
|
| + static const int kInitialMaxFastElementArray = 100000;
|
|
|
| static const int kFastPropertiesSoftLimit = 12;
|
| static const int kMaxFastProperties = 64;
|
| @@ -2833,11 +2800,11 @@ class JSObject: public JSReceiver {
|
| Handle<Name> name,
|
| DeleteMode mode);
|
|
|
| - MUST_USE_RESULT MaybeObject* DeleteElementWithInterceptor(uint32_t index);
|
| -
|
| - MUST_USE_RESULT MaybeObject* DeleteFastElement(uint32_t index);
|
| - MUST_USE_RESULT MaybeObject* DeleteDictionaryElement(uint32_t index,
|
| - DeleteMode mode);
|
| + static Handle<Object> DeleteElement(Handle<JSObject> object,
|
| + uint32_t index,
|
| + DeleteMode mode);
|
| + static Handle<Object> DeleteElementWithInterceptor(Handle<JSObject> object,
|
| + uint32_t index);
|
|
|
| bool ReferencesObjectFromElements(FixedArray* elements,
|
| ElementsKind kind,
|
| @@ -2850,14 +2817,14 @@ class JSObject: public JSReceiver {
|
| void GetElementsCapacityAndUsage(int* capacity, int* used);
|
|
|
| bool CanSetCallback(Name* name);
|
| - MUST_USE_RESULT MaybeObject* SetElementCallback(
|
| - uint32_t index,
|
| - Object* structure,
|
| - PropertyAttributes attributes);
|
| - MUST_USE_RESULT MaybeObject* SetPropertyCallback(
|
| - Name* name,
|
| - Object* structure,
|
| - PropertyAttributes attributes);
|
| + static void SetElementCallback(Handle<JSObject> object,
|
| + uint32_t index,
|
| + Handle<Object> structure,
|
| + PropertyAttributes attributes);
|
| + static void SetPropertyCallback(Handle<JSObject> object,
|
| + Handle<Name> name,
|
| + Handle<Object> structure,
|
| + PropertyAttributes attributes);
|
| static void DefineElementAccessor(Handle<JSObject> object,
|
| uint32_t index,
|
| Handle<Object> getter,
|
| @@ -2897,6 +2864,8 @@ class JSObject: public JSReceiver {
|
| MUST_USE_RESULT MaybeObject* SetHiddenPropertiesHashTable(
|
| Object* value);
|
|
|
| + MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag);
|
| +
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject);
|
| };
|
|
|
| @@ -2938,11 +2907,7 @@ class FixedArray: public FixedArrayBase {
|
|
|
| // Setters for frequently used oddballs located in old space.
|
| inline void set_undefined(int index);
|
| - // TODO(isolates): duplicate.
|
| - inline void set_undefined(Heap* heap, int index);
|
| inline void set_null(int index);
|
| - // TODO(isolates): duplicate.
|
| - inline void set_null(Heap* heap, int index);
|
| inline void set_the_hole(int index);
|
|
|
| inline Object** GetFirstElementAddress();
|
| @@ -3275,10 +3240,7 @@ class DescriptorArray: public FixedArray {
|
|
|
| #ifdef OBJECT_PRINT
|
| // Print all the descriptors.
|
| - inline void PrintDescriptors() {
|
| - PrintDescriptors(stdout);
|
| - }
|
| - void PrintDescriptors(FILE* out);
|
| + void PrintDescriptors(FILE* out = stdout);
|
| #endif
|
|
|
| #ifdef DEBUG
|
| @@ -3771,10 +3733,7 @@ class Dictionary: public HashTable<Shape, Key> {
|
| MUST_USE_RESULT MaybeObject* EnsureCapacity(int n, Key key);
|
|
|
| #ifdef OBJECT_PRINT
|
| - inline void Print() {
|
| - Print(stdout);
|
| - }
|
| - void Print(FILE* out);
|
| + void Print(FILE* out = stdout);
|
| #endif
|
| // Returns the key (slow).
|
| Object* SlowReverseLookup(Object* value);
|
| @@ -4856,10 +4815,7 @@ class Code: public HeapObject {
|
| static const char* ICState2String(InlineCacheState state);
|
| static const char* StubType2String(StubType type);
|
| static void PrintExtraICState(FILE* out, Kind kind, ExtraICState extra);
|
| - inline void Disassemble(const char* name) {
|
| - Disassemble(name, stdout);
|
| - }
|
| - void Disassemble(const char* name, FILE* out);
|
| + void Disassemble(const char* name, FILE* out = stdout);
|
| #endif // ENABLE_DISASSEMBLER
|
|
|
| // [instruction_size]: Size of the native instructions
|
| @@ -5801,7 +5757,6 @@ class Map: public HeapObject {
|
| set_bit_field3(EnumLengthBits::update(bit_field3(), length));
|
| }
|
|
|
| - inline bool CanTrackAllocationSite();
|
| inline bool owns_descriptors();
|
| inline void set_owns_descriptors(bool is_shared);
|
| inline bool is_observed();
|
| @@ -7088,10 +7043,7 @@ class JSFunction: public JSObject {
|
| DECL_ACCESSORS(next_function_link, Object)
|
|
|
| // Prints the name of the function using PrintF.
|
| - inline void PrintName() {
|
| - PrintName(stdout);
|
| - }
|
| - void PrintName(FILE* out);
|
| + void PrintName(FILE* out = stdout);
|
|
|
| // Casting.
|
| static inline JSFunction* cast(Object* obj);
|
| @@ -7870,6 +7822,7 @@ class AllocationSite: public Struct {
|
| static inline AllocationSiteMode GetMode(
|
| ElementsKind boilerplate_elements_kind);
|
| static inline AllocationSiteMode GetMode(ElementsKind from, ElementsKind to);
|
| + static inline bool CanTrack(InstanceType type);
|
|
|
| static const int kTransitionInfoOffset = HeapObject::kHeaderSize;
|
| static const int kWeakNextOffset = kTransitionInfoOffset + kPointerSize;
|
| @@ -8066,6 +8019,8 @@ class Name: public HeapObject {
|
| // Casting.
|
| static inline Name* cast(Object* obj);
|
|
|
| + bool IsCacheable(Isolate* isolate);
|
| +
|
| DECLARE_PRINTER(Name)
|
|
|
| // Layout description.
|
| @@ -8335,13 +8290,9 @@ class String: public Name {
|
| // Dispatched behavior.
|
| void StringShortPrint(StringStream* accumulator);
|
| #ifdef OBJECT_PRINT
|
| - inline void StringPrint() {
|
| - StringPrint(stdout);
|
| - }
|
| - void StringPrint(FILE* out);
|
| -
|
| char* ToAsciiArray();
|
| #endif
|
| + DECLARE_PRINTER(String)
|
| DECLARE_VERIFIER(String)
|
|
|
| inline bool IsFlat();
|
| @@ -9085,11 +9036,6 @@ class JSProxy: public JSReceiver {
|
| Object* value,
|
| PropertyAttributes attributes,
|
| StrictModeFlag strict_mode);
|
| - MUST_USE_RESULT MaybeObject* SetElementWithHandler(
|
| - JSReceiver* receiver,
|
| - uint32_t index,
|
| - Object* value,
|
| - StrictModeFlag strict_mode);
|
|
|
| // If the handler defines an accessor property with a setter, invoke it.
|
| // If it defines an accessor property without a setter, or a data property
|
| @@ -9110,10 +9056,8 @@ class JSProxy: public JSReceiver {
|
| JSReceiver* receiver,
|
| uint32_t index);
|
|
|
| - MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag);
|
| -
|
| - // Turn this into an (empty) JSObject.
|
| - void Fix();
|
| + // Turn the proxy into an (empty) JSObject.
|
| + static void Fix(Handle<JSProxy> proxy);
|
|
|
| // Initializes the body after the handler slot.
|
| inline void InitializeBody(int object_size, Object* value);
|
| @@ -9148,13 +9092,23 @@ class JSProxy: public JSReceiver {
|
| private:
|
| friend class JSReceiver;
|
|
|
| - static Handle<Object> DeletePropertyWithHandler(Handle<JSProxy> object,
|
| + static Handle<Object> SetElementWithHandler(Handle<JSProxy> proxy,
|
| + Handle<JSReceiver> receiver,
|
| + uint32_t index,
|
| + Handle<Object> value,
|
| + StrictModeFlag strict_mode);
|
| +
|
| + static Handle<Object> DeletePropertyWithHandler(Handle<JSProxy> proxy,
|
| Handle<Name> name,
|
| DeleteMode mode);
|
| - static Handle<Object> DeleteElementWithHandler(Handle<JSProxy> object,
|
| + static Handle<Object> DeleteElementWithHandler(Handle<JSProxy> proxy,
|
| uint32_t index,
|
| DeleteMode mode);
|
|
|
| + MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag);
|
| + static Handle<Object> GetIdentityHash(Handle<JSProxy> proxy,
|
| + CreationFlag flag);
|
| +
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy);
|
| };
|
|
|
|
|