Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index 417411d15524222bfb59708acd5b9a6f8589e24d..889f8262ba035b7a2770e7635de14cddee1368f7 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -4688,6 +4688,10 @@ class Code: public HeapObject { |
| // Get the safepoint entry for the given pc. |
| SafepointEntry GetSafepointEntry(Address pc); |
| + // Find an object in a stub with a specified map |
| + Object* FindNthObject(int n, Map* match_map); |
| + void ReplaceNthObject(int n, Map* match_map, Object* replace_with); |
|
rossberg
2013/06/25 10:47:38
As we discussed earlier, this seems rather fragile
danno
2013/06/28 13:56:05
Yes, I very much plan to clean this up, but it see
|
| + |
| // Find the first map in an IC stub. |
| Map* FindFirstMap(); |
| void FindAllMaps(MapHandleList* maps); |
| @@ -4700,6 +4704,8 @@ class Code: public HeapObject { |
| // Find the first name in an IC stub. |
| Name* FindFirstName(); |
| + void ReplaceNthCell(int n, Cell* replace_with); |
| + |
| class ExtraICStateStrictMode: public BitField<StrictModeFlag, 0, 1> {}; |
| class ExtraICStateKeyedAccessStoreMode: |
| public BitField<KeyedAccessStoreMode, 1, 4> {}; // NOLINT |
| @@ -5030,7 +5036,10 @@ class DependentCode: public FixedArray { |
| // Group of code that depends on elements not being added to objects with |
| // this map. |
| kElementsCantBeAddedGroup, |
| - kGroupCount = kElementsCantBeAddedGroup + 1 |
| + // Group of code that depends on global property values in property cells |
| + // not being changed. |
| + kPropertyCellChangedGroup, |
| + kGroupCount = kPropertyCellChangedGroup + 1 |
| }; |
| // Array for holding the index of the first code object of each group. |
| @@ -5072,6 +5081,9 @@ class DependentCode: public FixedArray { |
| inline void copy(int from, int to); |
| static inline DependentCode* cast(Object* object); |
| + static DependentCode* ForObject(Handle<HeapObject> object, |
| + DependencyGroup group); |
| + |
| private: |
| // Make a room at the end of the given group by moving out the first |
| // code objects of the subsequent groups. |
| @@ -5569,7 +5581,7 @@ class Map: public HeapObject { |
| inline bool CanOmitPrototypeChecks(); |
| void AddDependentCompilationInfo(DependentCode::DependencyGroup group, |
| - CompilationInfo* info); |
| + CompilationInfo* info); |
| void AddDependentCode(DependentCode::DependencyGroup group, |
| Handle<Code> code); |
| @@ -8572,9 +8584,19 @@ class Cell: public HeapObject { |
| class PropertyCell: public Cell { |
| public: |
| + // [type]: type of the global property. |
| Type* type(); |
| void set_type(Type* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
| + // [dependent_code]: dependent code that depends on the type of the global |
| + // property. |
| + DECL_ACCESSORS(dependent_code, DependentCode) |
| + |
| + // Sets the value of the cell and updates the type field to be the union |
| + // of the cell's current type and the value's type. |
| + void set_value_infer_type(Object* value, |
|
rossberg
2013/06/25 10:47:38
This function can also trigger deopts, so I'd pref
danno
2013/06/28 13:56:05
Done.
|
| + WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
| + |
| // Casting. |
| static inline PropertyCell* cast(Object* obj); |
| @@ -8588,12 +8610,21 @@ class PropertyCell: public Cell { |
| // Layout description. |
| static const int kTypeOffset = kValueOffset + kPointerSize; |
| - static const int kSize = kTypeOffset + kPointerSize; |
| + static const int kDependentCodeOffset = kTypeOffset + kPointerSize; |
| + static const int kSize = kDependentCodeOffset + kPointerSize; |
| + |
| + static const int kPointerFieldsBeginOffset = kValueOffset; |
| + static const int kPointerFieldsEndOffset = kDependentCodeOffset; |
| + |
| + typedef FixedBodyDescriptor<kValueOffset, |
| + kSize, |
| + kSize> BodyDescriptor; |
| + |
| + void AddDependentCompilationInfo(CompilationInfo* info); |
| + |
| + void AddDependentCode(Handle<Code> code); |
| - typedef FixedBodyDescriptor< |
| - kValueOffset, |
| - kTypeOffset + kPointerSize, |
| - PropertyCell::kSize> BodyDescriptor; |
| + Type* UnionType(Object* value); |
| private: |
| DECL_ACCESSORS(type_raw, Object) |