| Index: src/objects.h
|
| diff --git a/src/objects.h b/src/objects.h
|
| index 9333e9edc4003e2dd7a9f4bb7884eb6645ed2d6e..cb7b351d6dfd2f031ac867451dd094d09e547ce8 100644
|
| --- a/src/objects.h
|
| +++ b/src/objects.h
|
| @@ -2049,7 +2049,8 @@ class JSObject: public JSReceiver {
|
| // an initial capacity for holding these properties.
|
| static void NormalizeProperties(Handle<JSObject> object,
|
| PropertyNormalizationMode mode,
|
| - int expected_additional_properties);
|
| + int expected_additional_properties,
|
| + const char* reason);
|
|
|
| // Convert and update the elements backing store to be a
|
| // SeededNumberDictionary dictionary. Returns the backing after conversion.
|
| @@ -2058,7 +2059,7 @@ class JSObject: public JSReceiver {
|
|
|
| // Transform slow named properties to fast variants.
|
| static void MigrateSlowToFast(Handle<JSObject> object,
|
| - int unused_property_fields);
|
| + int unused_property_fields, const char* reason);
|
|
|
| // Access fast-case object properties at index.
|
| static Handle<Object> FastPropertyAt(Handle<JSObject> object,
|
| @@ -5878,7 +5879,8 @@ class Map: public HeapObject {
|
| int descriptor_number,
|
| Handle<Object> value);
|
|
|
| - static Handle<Map> Normalize(Handle<Map> map, PropertyNormalizationMode mode);
|
| + static Handle<Map> Normalize(Handle<Map> map, PropertyNormalizationMode mode,
|
| + const char* reason);
|
|
|
| // Returns the constructor name (the name (possibly, inferred name) of the
|
| // function that was used to instantiate the object).
|
| @@ -6087,7 +6089,7 @@ class Map: public HeapObject {
|
|
|
| // Returns a copy of the map, with all transitions dropped from the
|
| // instance descriptors.
|
| - static Handle<Map> Copy(Handle<Map> map);
|
| + static Handle<Map> Copy(Handle<Map> map, const char* reason);
|
| static Handle<Map> Create(Isolate* isolate, int inobject_properties);
|
|
|
| // Returns the next free property index (only valid for FAST MODE).
|
| @@ -6315,6 +6317,11 @@ class Map: public HeapObject {
|
| // The "shared" flags of both this map and |other| are ignored.
|
| bool EquivalentToForNormalization(Map* other, PropertyNormalizationMode mode);
|
|
|
| +#if TRACE_MAPS
|
| + static void TraceTransition(const char* what, Map* from, Map* to, Name* name);
|
| + static void TraceAllTransitions(Map* map);
|
| +#endif
|
| +
|
| private:
|
| static void ConnectElementsTransition(Handle<Map> parent, Handle<Map> child);
|
| static void ConnectTransition(Handle<Map> parent, Handle<Map> child,
|
| @@ -6336,6 +6343,7 @@ class Map: public HeapObject {
|
| Handle<DescriptorArray> descriptors,
|
| TransitionFlag flag,
|
| MaybeHandle<Name> maybe_name,
|
| + const char* reason,
|
| SimpleTransitionFlag simple_flag);
|
| static Handle<Map> CopyReplaceDescriptor(Handle<Map> map,
|
| Handle<DescriptorArray> descriptors,
|
| @@ -6709,6 +6717,13 @@ class SharedFunctionInfo: public HeapObject {
|
| // available.
|
| DECL_ACCESSORS(feedback_vector, TypeFeedbackVector)
|
|
|
| +#if TRACE_MAPS
|
| + // [unique_id] - For --trace-maps purposes, an identifier that's persistent
|
| + // even if the GC moves this SharedFunctionInfo.
|
| + inline int unique_id() const;
|
| + inline void set_unique_id(int value);
|
| +#endif
|
| +
|
| // [instance class name]: class name for instances.
|
| DECL_ACCESSORS(instance_class_name, Object)
|
|
|
| @@ -6955,10 +6970,16 @@ class SharedFunctionInfo: public HeapObject {
|
| static const int kInferredNameOffset = kDebugInfoOffset + kPointerSize;
|
| static const int kFeedbackVectorOffset =
|
| kInferredNameOffset + kPointerSize;
|
| +#if TRACE_MAPS
|
| + static const int kUniqueIdOffset = kFeedbackVectorOffset + kPointerSize;
|
| + static const int kLastPointerFieldOffset = kUniqueIdOffset;
|
| +#else
|
| + static const int kLastPointerFieldOffset = kFeedbackVectorOffset;
|
| +#endif
|
| +
|
| #if V8_HOST_ARCH_32_BIT
|
| // Smi fields.
|
| - static const int kLengthOffset =
|
| - kFeedbackVectorOffset + kPointerSize;
|
| + static const int kLengthOffset = kLastPointerFieldOffset + kPointerSize;
|
| static const int kFormalParameterCountOffset = kLengthOffset + kPointerSize;
|
| static const int kExpectedNofPropertiesOffset =
|
| kFormalParameterCountOffset + kPointerSize;
|
| @@ -6994,8 +7015,7 @@ class SharedFunctionInfo: public HeapObject {
|
| // word is not set and thus this word cannot be treated as pointer
|
| // to HeapObject during old space traversal.
|
| #if V8_TARGET_LITTLE_ENDIAN
|
| - static const int kLengthOffset =
|
| - kFeedbackVectorOffset + kPointerSize;
|
| + static const int kLengthOffset = kLastPointerFieldOffset + kPointerSize;
|
| static const int kFormalParameterCountOffset =
|
| kLengthOffset + kIntSize;
|
|
|
| @@ -7029,7 +7049,7 @@ class SharedFunctionInfo: public HeapObject {
|
|
|
| #elif V8_TARGET_BIG_ENDIAN
|
| static const int kFormalParameterCountOffset =
|
| - kFeedbackVectorOffset + kPointerSize;
|
| + kLastPointerFieldOffset + kPointerSize;
|
| static const int kLengthOffset = kFormalParameterCountOffset + kIntSize;
|
|
|
| static const int kNumLiteralsOffset = kLengthOffset + kIntSize;
|
| @@ -7062,7 +7082,7 @@ class SharedFunctionInfo: public HeapObject {
|
| static const int kAlignedSize = POINTER_SIZE_ALIGN(kSize);
|
|
|
| typedef FixedBodyDescriptor<kNameOffset,
|
| - kFeedbackVectorOffset + kPointerSize,
|
| + kLastPointerFieldOffset + kPointerSize,
|
| kSize> BodyDescriptor;
|
|
|
| // Bit positions in start_position_and_type.
|
| @@ -8578,6 +8598,10 @@ class Name: public HeapObject {
|
| DECLARE_CAST(Name)
|
|
|
| DECLARE_PRINTER(Name)
|
| +#if TRACE_MAPS
|
| + void NameShortPrint();
|
| + int NameShortPrint(Vector<char> str);
|
| +#endif
|
|
|
| // Layout description.
|
| static const int kHashFieldSlot = HeapObject::kHeaderSize;
|
| @@ -8680,6 +8704,10 @@ class Symbol: public Name {
|
|
|
| const char* PrivateSymbolToName() const;
|
|
|
| +#if TRACE_MAPS
|
| + friend class Name; // For PrivateSymbolToName.
|
| +#endif
|
| +
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(Symbol);
|
| };
|
|
|
|
|