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 | |
4985 // This class describes the layout of dependent codes array of a map. The | 4983 // This class describes the layout of dependent codes array of a map. The |
4986 // array is partitioned into several groups of dependent codes. Each group | 4984 // array is partitioned into several groups of dependent codes. Each group |
4987 // contains codes with the same dependency on the map. The array has the | 4985 // contains codes with the same dependency on the map. The array has the |
4988 // following layout for n dependency groups: | 4986 // following layout for n dependency groups: |
4989 // | 4987 // |
4990 // +----+----+-----+----+---------+----------+-----+---------+-----------+ | 4988 // +----+----+-----+----+---------+----------+-----+---------+-----------+ |
4991 // | C1 | C2 | ... | Cn | group 1 | group 2 | ... | group n | undefined | | 4989 // | C1 | C2 | ... | Cn | group 1 | group 2 | ... | group n | undefined | |
4992 // +----+----+-----+----+---------+----------+-----+---------+-----------+ | 4990 // +----+----+-----+----+---------+----------+-----+---------+-----------+ |
4993 // | 4991 // |
4994 // The first n elements are Smis, each of them specifies the number of codes | 4992 // The first n elements are Smis, each of them specifies the number of codes |
(...skipping 27 matching lines...) Expand all Loading... |
5022 }; | 5020 }; |
5023 | 5021 |
5024 // Array for holding the index of the first code object of each group. | 5022 // Array for holding the index of the first code object of each group. |
5025 // The last element stores the total number of code objects. | 5023 // The last element stores the total number of code objects. |
5026 class GroupStartIndexes { | 5024 class GroupStartIndexes { |
5027 public: | 5025 public: |
5028 explicit GroupStartIndexes(DependentCode* entries); | 5026 explicit GroupStartIndexes(DependentCode* entries); |
5029 void Recompute(DependentCode* entries); | 5027 void Recompute(DependentCode* entries); |
5030 int at(int i) { return start_indexes_[i]; } | 5028 int at(int i) { return start_indexes_[i]; } |
5031 int number_of_entries() { return start_indexes_[kGroupCount]; } | 5029 int number_of_entries() { return start_indexes_[kGroupCount]; } |
5032 int number_of_code_entries() { | |
5033 return start_indexes_[kGroupCount]; | |
5034 } | |
5035 private: | 5030 private: |
5036 int start_indexes_[kGroupCount + 1]; | 5031 int start_indexes_[kGroupCount + 1]; |
5037 }; | 5032 }; |
5038 | 5033 |
5039 bool Contains(DependencyGroup group, Code* code); | 5034 bool Contains(DependencyGroup group, Code* code); |
5040 static Handle<DependentCode> Insert(Handle<DependentCode> entries, | 5035 static Handle<DependentCode> Insert(Handle<DependentCode> entries, |
5041 DependencyGroup group, | 5036 DependencyGroup group, |
5042 Handle<Object> object); | 5037 Handle<Code> value); |
5043 void UpdateToFinishedCode(DependencyGroup group, | |
5044 CompilationInfo* info, | |
5045 Code* code); | |
5046 void RemoveCompilationInfo(DependentCode::DependencyGroup group, | |
5047 CompilationInfo* info); | |
5048 | |
5049 void DeoptimizeDependentCodeGroup(Isolate* isolate, | 5038 void DeoptimizeDependentCodeGroup(Isolate* isolate, |
5050 DependentCode::DependencyGroup group); | 5039 DependentCode::DependencyGroup group); |
5051 | 5040 |
5052 // The following low-level accessors should only be used by this class | 5041 // The following low-level accessors should only be used by this class |
5053 // and the mark compact collector. | 5042 // and the mark compact collector. |
5054 inline int number_of_entries(DependencyGroup group); | 5043 inline int number_of_entries(DependencyGroup group); |
5055 inline void set_number_of_entries(DependencyGroup group, int value); | 5044 inline void set_number_of_entries(DependencyGroup group, int value); |
5056 inline bool is_code_at(int i); | |
5057 inline Code* code_at(int i); | 5045 inline Code* code_at(int i); |
5058 inline CompilationInfo* compilation_info_at(int i); | 5046 inline void set_code_at(int i, Code* value); |
5059 inline void set_object_at(int i, Object* object); | 5047 inline Object** code_slot_at(int i); |
5060 inline Object** slot_at(int i); | 5048 inline void clear_code_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); | |
5064 static inline DependentCode* cast(Object* object); | 5049 static inline DependentCode* cast(Object* object); |
5065 | 5050 |
5066 private: | 5051 private: |
5067 // Make a room at the end of the given group by moving out the first | 5052 // Make a room at the end of the given group by moving out the first |
5068 // code objects of the subsequent groups. | 5053 // code objects of the subsequent groups. |
5069 inline void ExtendGroup(DependencyGroup group); | 5054 inline void ExtendGroup(DependencyGroup group); |
5070 static const int kCodesStartIndex = kGroupCount; | 5055 static const int kCodesStartIndex = kGroupCount; |
5071 }; | 5056 }; |
5072 | 5057 |
5073 | 5058 |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5562 return instance_type() >= FIRST_JS_OBJECT_TYPE; | 5547 return instance_type() >= FIRST_JS_OBJECT_TYPE; |
5563 } | 5548 } |
5564 | 5549 |
5565 // Fires when the layout of an object with a leaf map changes. | 5550 // Fires when the layout of an object with a leaf map changes. |
5566 // This includes adding transitions to the leaf map or changing | 5551 // This includes adding transitions to the leaf map or changing |
5567 // the descriptor array. | 5552 // the descriptor array. |
5568 inline void NotifyLeafMapLayoutChange(); | 5553 inline void NotifyLeafMapLayoutChange(); |
5569 | 5554 |
5570 inline bool CanOmitPrototypeChecks(); | 5555 inline bool CanOmitPrototypeChecks(); |
5571 | 5556 |
5572 void AddDependentCompilationInfo(DependentCode::DependencyGroup group, | 5557 inline void AddDependentCode(DependentCode::DependencyGroup group, |
5573 CompilationInfo* info); | 5558 Handle<Code> code); |
5574 | |
5575 void AddDependentCode(DependentCode::DependencyGroup group, | |
5576 Handle<Code> code); | |
5577 | 5559 |
5578 bool IsMapInArrayPrototypeChain(); | 5560 bool IsMapInArrayPrototypeChain(); |
5579 | 5561 |
5580 // Dispatched behavior. | 5562 // Dispatched behavior. |
5581 DECLARE_PRINTER(Map) | 5563 DECLARE_PRINTER(Map) |
5582 DECLARE_VERIFIER(Map) | 5564 DECLARE_VERIFIER(Map) |
5583 | 5565 |
5584 #ifdef VERIFY_HEAP | 5566 #ifdef VERIFY_HEAP |
5585 void SharedMapVerify(); | 5567 void SharedMapVerify(); |
5586 void VerifyOmittedPrototypeChecks(); | 5568 void VerifyOmittedPrototypeChecks(); |
(...skipping 4094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9681 } else { | 9663 } else { |
9682 value &= ~(1 << bit_position); | 9664 value &= ~(1 << bit_position); |
9683 } | 9665 } |
9684 return value; | 9666 return value; |
9685 } | 9667 } |
9686 }; | 9668 }; |
9687 | 9669 |
9688 } } // namespace v8::internal | 9670 } } // namespace v8::internal |
9689 | 9671 |
9690 #endif // V8_OBJECTS_H_ | 9672 #endif // V8_OBJECTS_H_ |
OLD | NEW |