OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 4962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4973 static Code* GetCodeAgeStub(Age age, MarkingParity parity); | 4973 static Code* GetCodeAgeStub(Age age, MarkingParity parity); |
4974 | 4974 |
4975 // Code aging -- platform-specific | 4975 // Code aging -- platform-specific |
4976 static void PatchPlatformCodeAge(byte* sequence, Age age, | 4976 static void PatchPlatformCodeAge(byte* sequence, Age age, |
4977 MarkingParity parity); | 4977 MarkingParity parity); |
4978 | 4978 |
4979 DISALLOW_IMPLICIT_CONSTRUCTORS(Code); | 4979 DISALLOW_IMPLICIT_CONSTRUCTORS(Code); |
4980 }; | 4980 }; |
4981 | 4981 |
4982 | 4982 |
| 4983 class CompilationInfo; |
| 4984 |
4983 // This class describes the layout of dependent codes array of a map. The | 4985 // This class describes the layout of dependent codes array of a map. The |
4984 // array is partitioned into several groups of dependent codes. Each group | 4986 // array is partitioned into several groups of dependent codes. Each group |
4985 // contains codes with the same dependency on the map. The array has the | 4987 // contains codes with the same dependency on the map. The array has the |
4986 // following layout for n dependency groups: | 4988 // following layout for n dependency groups: |
4987 // | 4989 // |
4988 // +----+----+-----+----+---------+----------+-----+---------+-----------+ | 4990 // +----+----+-----+----+---------+----------+-----+---------+-----------+ |
4989 // | C1 | C2 | ... | Cn | group 1 | group 2 | ... | group n | undefined | | 4991 // | C1 | C2 | ... | Cn | group 1 | group 2 | ... | group n | undefined | |
4990 // +----+----+-----+----+---------+----------+-----+---------+-----------+ | 4992 // +----+----+-----+----+---------+----------+-----+---------+-----------+ |
4991 // | 4993 // |
4992 // The first n elements are Smis, each of them specifies the number of codes | 4994 // The first n elements are Smis, each of them specifies the number of codes |
(...skipping 27 matching lines...) Expand all Loading... |
5020 }; | 5022 }; |
5021 | 5023 |
5022 // Array for holding the index of the first code object of each group. | 5024 // Array for holding the index of the first code object of each group. |
5023 // The last element stores the total number of code objects. | 5025 // The last element stores the total number of code objects. |
5024 class GroupStartIndexes { | 5026 class GroupStartIndexes { |
5025 public: | 5027 public: |
5026 explicit GroupStartIndexes(DependentCode* entries); | 5028 explicit GroupStartIndexes(DependentCode* entries); |
5027 void Recompute(DependentCode* entries); | 5029 void Recompute(DependentCode* entries); |
5028 int at(int i) { return start_indexes_[i]; } | 5030 int at(int i) { return start_indexes_[i]; } |
5029 int number_of_entries() { return start_indexes_[kGroupCount]; } | 5031 int number_of_entries() { return start_indexes_[kGroupCount]; } |
| 5032 int number_of_code_entries() { |
| 5033 return start_indexes_[kGroupCount]; |
| 5034 } |
5030 private: | 5035 private: |
5031 int start_indexes_[kGroupCount + 1]; | 5036 int start_indexes_[kGroupCount + 1]; |
5032 }; | 5037 }; |
5033 | 5038 |
5034 bool Contains(DependencyGroup group, Code* code); | 5039 bool Contains(DependencyGroup group, Code* code); |
5035 static Handle<DependentCode> Insert(Handle<DependentCode> entries, | 5040 static Handle<DependentCode> Insert(Handle<DependentCode> entries, |
5036 DependencyGroup group, | 5041 DependencyGroup group, |
5037 Handle<Code> value); | 5042 Handle<Object> object); |
| 5043 void UpdateToFinishedCode(DependencyGroup group, |
| 5044 CompilationInfo* info, |
| 5045 Code* code); |
| 5046 void RemoveCompilationInfo(DependentCode::DependencyGroup group, |
| 5047 CompilationInfo* info); |
| 5048 |
5038 void DeoptimizeDependentCodeGroup(Isolate* isolate, | 5049 void DeoptimizeDependentCodeGroup(Isolate* isolate, |
5039 DependentCode::DependencyGroup group); | 5050 DependentCode::DependencyGroup group); |
5040 | 5051 |
5041 // The following low-level accessors should only be used by this class | 5052 // The following low-level accessors should only be used by this class |
5042 // and the mark compact collector. | 5053 // and the mark compact collector. |
5043 inline int number_of_entries(DependencyGroup group); | 5054 inline int number_of_entries(DependencyGroup group); |
5044 inline void set_number_of_entries(DependencyGroup group, int value); | 5055 inline void set_number_of_entries(DependencyGroup group, int value); |
| 5056 inline bool is_code_at(int i); |
5045 inline Code* code_at(int i); | 5057 inline Code* code_at(int i); |
5046 inline void set_code_at(int i, Code* value); | 5058 inline CompilationInfo* compilation_info_at(int i); |
5047 inline Object** code_slot_at(int i); | 5059 inline void set_object_at(int i, Object* object); |
5048 inline void clear_code_at(int i); | 5060 inline Object** slot_at(int i); |
| 5061 inline Object* object_at(int i); |
| 5062 inline void clear_at(int i); |
| 5063 inline void copy(int from, int to); |
5049 static inline DependentCode* cast(Object* object); | 5064 static inline DependentCode* cast(Object* object); |
5050 | 5065 |
5051 private: | 5066 private: |
5052 // Make a room at the end of the given group by moving out the first | 5067 // Make a room at the end of the given group by moving out the first |
5053 // code objects of the subsequent groups. | 5068 // code objects of the subsequent groups. |
5054 inline void ExtendGroup(DependencyGroup group); | 5069 inline void ExtendGroup(DependencyGroup group); |
5055 static const int kCodesStartIndex = kGroupCount; | 5070 static const int kCodesStartIndex = kGroupCount; |
5056 }; | 5071 }; |
5057 | 5072 |
5058 | 5073 |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5547 return instance_type() >= FIRST_JS_OBJECT_TYPE; | 5562 return instance_type() >= FIRST_JS_OBJECT_TYPE; |
5548 } | 5563 } |
5549 | 5564 |
5550 // Fires when the layout of an object with a leaf map changes. | 5565 // Fires when the layout of an object with a leaf map changes. |
5551 // This includes adding transitions to the leaf map or changing | 5566 // This includes adding transitions to the leaf map or changing |
5552 // the descriptor array. | 5567 // the descriptor array. |
5553 inline void NotifyLeafMapLayoutChange(); | 5568 inline void NotifyLeafMapLayoutChange(); |
5554 | 5569 |
5555 inline bool CanOmitPrototypeChecks(); | 5570 inline bool CanOmitPrototypeChecks(); |
5556 | 5571 |
5557 inline void AddDependentCode(DependentCode::DependencyGroup group, | 5572 void AddDependentCompilationInfo(DependentCode::DependencyGroup group, |
5558 Handle<Code> code); | 5573 CompilationInfo* info); |
| 5574 |
| 5575 void AddDependentCode(DependentCode::DependencyGroup group, |
| 5576 Handle<Code> code); |
5559 | 5577 |
5560 bool IsMapInArrayPrototypeChain(); | 5578 bool IsMapInArrayPrototypeChain(); |
5561 | 5579 |
5562 // Dispatched behavior. | 5580 // Dispatched behavior. |
5563 DECLARE_PRINTER(Map) | 5581 DECLARE_PRINTER(Map) |
5564 DECLARE_VERIFIER(Map) | 5582 DECLARE_VERIFIER(Map) |
5565 | 5583 |
5566 #ifdef VERIFY_HEAP | 5584 #ifdef VERIFY_HEAP |
5567 void SharedMapVerify(); | 5585 void SharedMapVerify(); |
5568 void VerifyOmittedPrototypeChecks(); | 5586 void VerifyOmittedPrototypeChecks(); |
(...skipping 4073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9642 } else { | 9660 } else { |
9643 value &= ~(1 << bit_position); | 9661 value &= ~(1 << bit_position); |
9644 } | 9662 } |
9645 return value; | 9663 return value; |
9646 } | 9664 } |
9647 }; | 9665 }; |
9648 | 9666 |
9649 } } // namespace v8::internal | 9667 } } // namespace v8::internal |
9650 | 9668 |
9651 #endif // V8_OBJECTS_H_ | 9669 #endif // V8_OBJECTS_H_ |
OLD | NEW |