Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index fbe06c70286654161b6de8b58c639e3f2613cb31..2dc33e2458d3722d7d5cdc1bb785a1ea02c6c96b 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -857,6 +857,7 @@ class ElementsAccessor; |
| class FixedArrayBase; |
| class GlobalObject; |
| class ObjectVisitor; |
|
Hannes Payer (out of office)
2014/11/06 12:29:46
Can we fix the alphabetic order here. Move ObjectV
Igor Sheludko
2014/11/07 08:03:53
Done.
|
| +class LayoutDescriptor; |
| class LookupIterator; |
| class StringStream; |
| class TypeFeedbackVector; |
| @@ -932,6 +933,7 @@ template <class C> inline bool Is(Object* obj); |
| V(JSContextExtensionObject) \ |
| V(JSGeneratorObject) \ |
| V(JSModule) \ |
| + V(LayoutDescriptor) \ |
| V(Map) \ |
| V(DescriptorArray) \ |
| V(TransitionArray) \ |
| @@ -2059,12 +2061,18 @@ class JSObject: public JSReceiver { |
| static void MigrateSlowToFast(Handle<JSObject> object, |
| int unused_property_fields); |
| + inline bool IsUnboxedDoubleField(FieldIndex index); |
| + |
| // Access fast-case object properties at index. |
| static Handle<Object> FastPropertyAt(Handle<JSObject> object, |
| Representation representation, |
| FieldIndex index); |
| inline Object* RawFastPropertyAt(FieldIndex index); |
| + inline double RawFastDoublePropertyAt(FieldIndex index); |
| + |
| inline void FastPropertyAtPut(FieldIndex index, Object* value); |
| + inline void RawFastPropertyAtPut(FieldIndex index, Object* value); |
| + inline void RawFastDoublePropertyAtPut(FieldIndex index, double value); |
| void WriteToField(int descriptor, Object* value); |
| // Access to in object properties. |
| @@ -3128,9 +3136,7 @@ class DescriptorArray: public FixedArray { |
| // Transfer a complete descriptor from the src descriptor array to this |
| // descriptor array. |
| - void CopyFrom(int index, |
| - DescriptorArray* src, |
| - const WhitenessWitness&); |
| + void CopyFrom(int index, DescriptorArray* src, const WhitenessWitness&); |
| inline void Set(int descriptor_number, |
| Descriptor* desc, |
| @@ -4813,6 +4819,7 @@ TYPED_ARRAYS(FIXED_TYPED_ARRAY_TRAITS) |
| #undef FIXED_TYPED_ARRAY_TRAITS |
| + |
| // DeoptimizationInputData is a fixed array used to hold the deoptimization |
| // data for code generated by the Hydrogen/Lithium compiler. It also |
| // contains information about functions that were inlined. If N different |
| @@ -5903,7 +5910,19 @@ class Map: public HeapObject { |
| // [instance descriptors]: describes the object. |
| DECL_ACCESSORS(instance_descriptors, DescriptorArray) |
| - inline void InitializeDescriptors(DescriptorArray* descriptors); |
| + |
| + // [layout descriptor]: describes the object layout. |
| + DECL_ACCESSORS(layout_descriptor, LayoutDescriptor) |
| + // |layout descriptor| accessor which can be used from GC. |
| + inline LayoutDescriptor* layout_descriptor_gc_safe(); |
| + |
| + // |layout descriptor| accessor that returns a handle. |
| + inline Handle<LayoutDescriptor> GetLayoutDescriptor(); |
| + |
| + inline void UpdateDescriptors(DescriptorArray* descriptors, |
| + LayoutDescriptor* layout_descriptor); |
| + inline void InitializeDescriptors(DescriptorArray* descriptors, |
| + LayoutDescriptor* layout_descriptor); |
| // [stub cache]: contains stubs compiled for this map. |
| DECL_ACCESSORS(code_cache, Object) |
| @@ -6231,7 +6250,13 @@ class Map: public HeapObject { |
| kConstructorOffset + kPointerSize; |
| static const int kDescriptorsOffset = |
| kTransitionsOrBackPointerOffset + kPointerSize; |
| +#if V8_DOUBLE_FIELDS_UNBOXING |
| + static const int kLayoutDecriptorOffset = kDescriptorsOffset + kPointerSize; |
| + static const int kCodeCacheOffset = kLayoutDecriptorOffset + kPointerSize; |
| +#else |
| + static const int kLayoutDecriptorOffset = 1; // Must not be ever accessed. |
| static const int kCodeCacheOffset = kDescriptorsOffset + kPointerSize; |
| +#endif |
| static const int kDependentCodeOffset = kCodeCacheOffset + kPointerSize; |
| static const int kSize = kDependentCodeOffset + kPointerSize; |
| @@ -6309,6 +6334,9 @@ class Map: public HeapObject { |
| // The "shared" flags of both this map and |other| are ignored. |
| bool EquivalentToForNormalization(Map* other, PropertyNormalizationMode mode); |
| + // Returns true if given field is unboxed double. |
| + inline bool IsUnboxedDoubleField(FieldIndex index); |
| + |
| private: |
| static void ConnectElementsTransition(Handle<Map> parent, Handle<Map> child); |
| static void ConnectTransition(Handle<Map> parent, Handle<Map> child, |
| @@ -6320,16 +6348,14 @@ class Map: public HeapObject { |
| Handle<DescriptorArray> descriptors, |
| Descriptor* descriptor); |
| static Handle<Map> CopyInstallDescriptors( |
| - Handle<Map> map, |
| - int new_descriptor, |
| - Handle<DescriptorArray> descriptors); |
| + Handle<Map> map, int new_descriptor, Handle<DescriptorArray> descriptors, |
| + Handle<LayoutDescriptor> layout_descriptor); |
| static Handle<Map> CopyAddDescriptor(Handle<Map> map, |
| Descriptor* descriptor, |
| TransitionFlag flag); |
| static Handle<Map> CopyReplaceDescriptors( |
| - Handle<Map> map, |
| - Handle<DescriptorArray> descriptors, |
| - TransitionFlag flag, |
| + Handle<Map> map, Handle<DescriptorArray> descriptors, |
| + Handle<LayoutDescriptor> layout_descriptor, TransitionFlag flag, |
| MaybeHandle<Name> maybe_name, |
| SimpleTransitionFlag simple_flag = FULL_TRANSITION); |
| static Handle<Map> CopyReplaceDescriptor(Handle<Map> map, |
| @@ -6359,7 +6385,9 @@ class Map: public HeapObject { |
| void ZapTransitions(); |
| void DeprecateTransitionTree(); |
| - void DeprecateTarget(Name* key, DescriptorArray* new_descriptors); |
| + void DeprecateTarget(Handle<Name> key, |
| + Handle<DescriptorArray> new_descriptors, |
| + Handle<LayoutDescriptor> new_layout_descriptor); |
| Map* FindLastMatchMap(int verbatim, int length, DescriptorArray* descriptors); |
| @@ -6390,6 +6418,7 @@ class Map: public HeapObject { |
| static const int kFastPropertiesSoftLimit = 12; |
| static const int kMaxFastProperties = 128; |
| + friend class TestAccessor; |
|
Hannes Payer (out of office)
2014/11/06 12:29:46
Uff, do we really have to add test dependencies to
Igor Sheludko
2014/11/07 08:03:53
Done.
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(Map); |
| }; |