| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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]; } |
| 5030 private: | 5032 private: |
| 5031 int start_indexes_[kGroupCount + 1]; | 5033 int start_indexes_[kGroupCount + 1]; |
| 5032 }; | 5034 }; |
| 5033 | 5035 |
| 5034 bool Contains(DependencyGroup group, Code* code); | 5036 bool Contains(DependencyGroup group, Code* code); |
| 5035 static Handle<DependentCode> Insert(Handle<DependentCode> entries, | 5037 static Handle<DependentCode> Insert(Handle<DependentCode> entries, |
| 5036 DependencyGroup group, | 5038 DependencyGroup group, |
| 5037 Handle<Code> value); | 5039 Handle<Object> object); |
| 5040 void UpdateToFinishedCode(DependencyGroup group, |
| 5041 CompilationInfo* info, |
| 5042 Code* code); |
| 5043 void RemoveCompilationInfo(DependentCode::DependencyGroup group, |
| 5044 CompilationInfo* info); |
| 5045 |
| 5038 void DeoptimizeDependentCodeGroup(Isolate* isolate, | 5046 void DeoptimizeDependentCodeGroup(Isolate* isolate, |
| 5039 DependentCode::DependencyGroup group); | 5047 DependentCode::DependencyGroup group); |
| 5040 | 5048 |
| 5041 // The following low-level accessors should only be used by this class | 5049 // The following low-level accessors should only be used by this class |
| 5042 // and the mark compact collector. | 5050 // and the mark compact collector. |
| 5043 inline int number_of_entries(DependencyGroup group); | 5051 inline int number_of_entries(DependencyGroup group); |
| 5044 inline void set_number_of_entries(DependencyGroup group, int value); | 5052 inline void set_number_of_entries(DependencyGroup group, int value); |
| 5053 inline bool is_code_at(int i); |
| 5045 inline Code* code_at(int i); | 5054 inline Code* code_at(int i); |
| 5046 inline void set_code_at(int i, Code* value); | 5055 inline CompilationInfo* compilation_info_at(int i); |
| 5047 inline Object** code_slot_at(int i); | 5056 inline void set_object_at(int i, Object* object); |
| 5048 inline void clear_code_at(int i); | 5057 inline Object** slot_at(int i); |
| 5058 inline Object* object_at(int i); |
| 5059 inline void clear_at(int i); |
| 5060 inline void copy(int from, int to); |
| 5049 static inline DependentCode* cast(Object* object); | 5061 static inline DependentCode* cast(Object* object); |
| 5050 | 5062 |
| 5051 private: | 5063 private: |
| 5052 // Make a room at the end of the given group by moving out the first | 5064 // Make a room at the end of the given group by moving out the first |
| 5053 // code objects of the subsequent groups. | 5065 // code objects of the subsequent groups. |
| 5054 inline void ExtendGroup(DependencyGroup group); | 5066 inline void ExtendGroup(DependencyGroup group); |
| 5055 static const int kCodesStartIndex = kGroupCount; | 5067 static const int kCodesStartIndex = kGroupCount; |
| 5056 }; | 5068 }; |
| 5057 | 5069 |
| 5058 | 5070 |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5547 return instance_type() >= FIRST_JS_OBJECT_TYPE; | 5559 return instance_type() >= FIRST_JS_OBJECT_TYPE; |
| 5548 } | 5560 } |
| 5549 | 5561 |
| 5550 // Fires when the layout of an object with a leaf map changes. | 5562 // Fires when the layout of an object with a leaf map changes. |
| 5551 // This includes adding transitions to the leaf map or changing | 5563 // This includes adding transitions to the leaf map or changing |
| 5552 // the descriptor array. | 5564 // the descriptor array. |
| 5553 inline void NotifyLeafMapLayoutChange(); | 5565 inline void NotifyLeafMapLayoutChange(); |
| 5554 | 5566 |
| 5555 inline bool CanOmitPrototypeChecks(); | 5567 inline bool CanOmitPrototypeChecks(); |
| 5556 | 5568 |
| 5557 inline void AddDependentCode(DependentCode::DependencyGroup group, | 5569 void AddDependentCompilationInfo(DependentCode::DependencyGroup group, |
| 5558 Handle<Code> code); | 5570 CompilationInfo* info); |
| 5571 |
| 5572 void AddDependentCode(DependentCode::DependencyGroup group, |
| 5573 Handle<Code> code); |
| 5559 | 5574 |
| 5560 bool IsMapInArrayPrototypeChain(); | 5575 bool IsMapInArrayPrototypeChain(); |
| 5561 | 5576 |
| 5562 // Dispatched behavior. | 5577 // Dispatched behavior. |
| 5563 DECLARE_PRINTER(Map) | 5578 DECLARE_PRINTER(Map) |
| 5564 DECLARE_VERIFIER(Map) | 5579 DECLARE_VERIFIER(Map) |
| 5565 | 5580 |
| 5566 #ifdef VERIFY_HEAP | 5581 #ifdef VERIFY_HEAP |
| 5567 void SharedMapVerify(); | 5582 void SharedMapVerify(); |
| 5568 void VerifyOmittedPrototypeChecks(); | 5583 void VerifyOmittedPrototypeChecks(); |
| (...skipping 4094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9663 } else { | 9678 } else { |
| 9664 value &= ~(1 << bit_position); | 9679 value &= ~(1 << bit_position); |
| 9665 } | 9680 } |
| 9666 return value; | 9681 return value; |
| 9667 } | 9682 } |
| 9668 }; | 9683 }; |
| 9669 | 9684 |
| 9670 } } // namespace v8::internal | 9685 } } // namespace v8::internal |
| 9671 | 9686 |
| 9672 #endif // V8_OBJECTS_H_ | 9687 #endif // V8_OBJECTS_H_ |
| OLD | NEW |