Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index 1f6e7cc0878c87a8630b77f4e05bd40f7d89cc18..f3053b2f5d5a700b668504240ad597038c14776e 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -4695,7 +4695,7 @@ class Code: public HeapObject { |
| // in the corresponding group. The subsequent elements contain grouped code |
| // objects. The suffix of the array can be filled with the undefined value if |
| // the number of codes is less than the length of the array. |
| -// |
| +// |
| // All code indexes used in the class are counted starting from the first |
| // code object of the first group. In other words, code index 0 corresponds |
| // to array index n = kCodesStartIndex. |
| @@ -4706,11 +4706,21 @@ class DependentCodes: public FixedArray { |
| // Group of codes that weakly embed this map and depend on being |
| // deoptimized when the map is garbage collected. |
| kWeaklyEmbeddedGroup, |
| - kGroupCount = kWeaklyEmbeddedGroup + 1 |
| + // Group of codes that omitted prototype check for a prototype with this map |
| + // and depend on being deoptimized when map layout changes. |
|
Toon Verwaest
2013/02/13 10:40:07
Group of code that omit run-time prototype checks
ulan
2013/02/13 12:27:38
Done.
|
| + kPrototypeCheckGroup, |
| + kGroupCount = kPrototypeCheckGroup + 1 |
| }; |
| // Array for holding the index of the first code object of each group. |
| // The last element stores the total number of code objects. |
| - typedef int GroupStartIndexes[kGroupCount + 1]; |
| + class GroupStartIndexes { |
| + public: |
| + explicit GroupStartIndexes(DependentCodes* codes); |
| + void Recompute(DependentCodes* codes); |
| + int at(int i) { return start_indexes_[i]; } |
| + private: |
| + int start_indexes_[kGroupCount + 1]; |
| + }; |
| inline int number_of_codes(DependencyGroup group); |
| inline void set_number_of_codes(DependencyGroup group, int value); |
| inline Code* code_at(int i); |
| @@ -4718,7 +4728,6 @@ class DependentCodes: public FixedArray { |
| inline Object** code_slot_at(int i); |
| inline void clear_code_at(int i); |
| static inline DependentCodes* cast(Object* object); |
| - inline void ComputeGroupStartIndexes(GroupStartIndexes starts); |
| bool Contains(DependencyGroup group, Code* code); |
| static Handle<DependentCodes> Insert(Handle<DependentCodes> codes, |
| DependencyGroup group, |
| @@ -5179,9 +5188,16 @@ class Map: public HeapObject { |
| return instance_type() >= FIRST_JS_OBJECT_TYPE; |
| } |
| + |
| + inline void NotifyObjectLayoutChange(); |
| + |
| + inline bool CanOmitPrototypeChecks(); |
| + |
| inline void AddDependentCode(DependentCodes::DependencyGroup group, |
| Handle<Code> code); |
| + void DeoptimizeDependentCodes(DependentCodes::DependencyGroup group); |
| + |
| // Dispatched behavior. |
| DECLARE_PRINTER(Map) |
| DECLARE_VERIFIER(Map) |