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 4593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4604 static const int kLiteralArrayIndex = 2; | 4604 static const int kLiteralArrayIndex = 2; |
4605 static const int kOsrAstIdIndex = 3; | 4605 static const int kOsrAstIdIndex = 3; |
4606 static const int kOsrPcOffsetIndex = 4; | 4606 static const int kOsrPcOffsetIndex = 4; |
4607 static const int kFirstDeoptEntryIndex = 5; | 4607 static const int kFirstDeoptEntryIndex = 5; |
4608 | 4608 |
4609 // Offsets of deopt entry elements relative to the start of the entry. | 4609 // Offsets of deopt entry elements relative to the start of the entry. |
4610 static const int kAstIdRawOffset = 0; | 4610 static const int kAstIdRawOffset = 0; |
4611 static const int kTranslationIndexOffset = 1; | 4611 static const int kTranslationIndexOffset = 1; |
4612 static const int kArgumentsStackHeightOffset = 2; | 4612 static const int kArgumentsStackHeightOffset = 2; |
4613 static const int kPcOffset = 3; | 4613 static const int kPcOffset = 3; |
4614 static const int kDeoptEntrySize = 4; | 4614 static const int kModeOffset = 4; |
| 4615 static const int kDeoptEntrySize = 5; |
4615 | 4616 |
4616 // Simple element accessors. | 4617 // Simple element accessors. |
4617 #define DEFINE_ELEMENT_ACCESSORS(name, type) \ | 4618 #define DEFINE_ELEMENT_ACCESSORS(name, type) \ |
4618 type* name() { \ | 4619 type* name() { \ |
4619 return type::cast(get(k##name##Index)); \ | 4620 return type::cast(get(k##name##Index)); \ |
4620 } \ | 4621 } \ |
4621 void Set##name(type* value) { \ | 4622 void Set##name(type* value) { \ |
4622 set(k##name##Index, value); \ | 4623 set(k##name##Index, value); \ |
4623 } | 4624 } |
4624 | 4625 |
(...skipping 11 matching lines...) Expand all Loading... |
4636 return type::cast(get(IndexForEntry(i) + k##name##Offset)); \ | 4637 return type::cast(get(IndexForEntry(i) + k##name##Offset)); \ |
4637 } \ | 4638 } \ |
4638 void Set##name(int i, type* value) { \ | 4639 void Set##name(int i, type* value) { \ |
4639 set(IndexForEntry(i) + k##name##Offset, value); \ | 4640 set(IndexForEntry(i) + k##name##Offset, value); \ |
4640 } | 4641 } |
4641 | 4642 |
4642 DEFINE_ENTRY_ACCESSORS(AstIdRaw, Smi) | 4643 DEFINE_ENTRY_ACCESSORS(AstIdRaw, Smi) |
4643 DEFINE_ENTRY_ACCESSORS(TranslationIndex, Smi) | 4644 DEFINE_ENTRY_ACCESSORS(TranslationIndex, Smi) |
4644 DEFINE_ENTRY_ACCESSORS(ArgumentsStackHeight, Smi) | 4645 DEFINE_ENTRY_ACCESSORS(ArgumentsStackHeight, Smi) |
4645 DEFINE_ENTRY_ACCESSORS(Pc, Smi) | 4646 DEFINE_ENTRY_ACCESSORS(Pc, Smi) |
| 4647 DEFINE_ENTRY_ACCESSORS(Mode, Smi) |
4646 | 4648 |
4647 #undef DEFINE_ENTRY_ACCESSORS | 4649 #undef DEFINE_ENTRY_ACCESSORS |
4648 | 4650 |
4649 BailoutId AstId(int i) { | 4651 BailoutId AstId(int i) { |
4650 return BailoutId(AstIdRaw(i)->value()); | 4652 return BailoutId(AstIdRaw(i)->value()); |
4651 } | 4653 } |
4652 | 4654 |
4653 void SetAstId(int i, BailoutId value) { | 4655 void SetAstId(int i, BailoutId value) { |
4654 SetAstIdRaw(i, Smi::FromInt(value.ToInt())); | 4656 SetAstIdRaw(i, Smi::FromInt(value.ToInt())); |
4655 } | 4657 } |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5162 kCodeAgeCount = kAfterLastCodeAge - 1 | 5164 kCodeAgeCount = kAfterLastCodeAge - 1 |
5163 }; | 5165 }; |
5164 #undef DECLARE_CODE_AGE_ENUM | 5166 #undef DECLARE_CODE_AGE_ENUM |
5165 | 5167 |
5166 // Code aging. Indicates how many full GCs this code has survived without | 5168 // Code aging. Indicates how many full GCs this code has survived without |
5167 // being entered through the prologue. Used to determine when it is | 5169 // being entered through the prologue. Used to determine when it is |
5168 // relatively safe to flush this code object and replace it with the lazy | 5170 // relatively safe to flush this code object and replace it with the lazy |
5169 // compilation stub. | 5171 // compilation stub. |
5170 static void MakeCodeAgeSequenceYoung(byte* sequence); | 5172 static void MakeCodeAgeSequenceYoung(byte* sequence); |
5171 void MakeOlder(MarkingParity); | 5173 void MakeOlder(MarkingParity); |
5172 static bool IsYoungSequence(byte* sequence); | 5174 static bool IsYoungSequence(byte* sequence, bool thumb_mode = false); |
5173 bool IsOld(); | 5175 bool IsOld(); |
5174 int GetAge(); | 5176 int GetAge(); |
5175 | 5177 |
5176 void PrintDeoptLocation(int bailout_id); | 5178 void PrintDeoptLocation(int bailout_id); |
5177 bool CanDeoptAt(Address pc); | 5179 bool CanDeoptAt(Address pc); |
5178 | 5180 |
5179 #ifdef VERIFY_HEAP | 5181 #ifdef VERIFY_HEAP |
5180 void VerifyEmbeddedMapsDependency(); | 5182 void VerifyEmbeddedMapsDependency(); |
5181 #endif | 5183 #endif |
5182 | 5184 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5305 TypeField::kMask | CacheHolderField::kMask; | 5307 TypeField::kMask | CacheHolderField::kMask; |
5306 | 5308 |
5307 private: | 5309 private: |
5308 friend class RelocIterator; | 5310 friend class RelocIterator; |
5309 | 5311 |
5310 // Code aging | 5312 // Code aging |
5311 byte* FindCodeAgeSequence(); | 5313 byte* FindCodeAgeSequence(); |
5312 static void GetCodeAgeAndParity(Code* code, Age* age, | 5314 static void GetCodeAgeAndParity(Code* code, Age* age, |
5313 MarkingParity* parity); | 5315 MarkingParity* parity); |
5314 static void GetCodeAgeAndParity(byte* sequence, Age* age, | 5316 static void GetCodeAgeAndParity(byte* sequence, Age* age, |
5315 MarkingParity* parity); | 5317 MarkingParity* parity, |
| 5318 bool thumb_mode = false); |
5316 static Code* GetCodeAgeStub(Age age, MarkingParity parity); | 5319 static Code* GetCodeAgeStub(Age age, MarkingParity parity); |
5317 | 5320 |
5318 // Code aging -- platform-specific | 5321 // Code aging -- platform-specific |
5319 static void PatchPlatformCodeAge(byte* sequence, Age age, | 5322 static void PatchPlatformCodeAge(byte* sequence, Age age, |
5320 MarkingParity parity); | 5323 MarkingParity parity, |
| 5324 bool is_thumb_mode = false); |
5321 | 5325 |
5322 DISALLOW_IMPLICIT_CONSTRUCTORS(Code); | 5326 DISALLOW_IMPLICIT_CONSTRUCTORS(Code); |
5323 }; | 5327 }; |
5324 | 5328 |
5325 | 5329 |
5326 class CompilationInfo; | 5330 class CompilationInfo; |
5327 | 5331 |
5328 // This class describes the layout of dependent codes array of a map. The | 5332 // This class describes the layout of dependent codes array of a map. The |
5329 // array is partitioned into several groups of dependent codes. Each group | 5333 // array is partitioned into several groups of dependent codes. Each group |
5330 // contains codes with the same dependency on the map. The array has the | 5334 // contains codes with the same dependency on the map. The array has the |
(...skipping 4850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10181 } else { | 10185 } else { |
10182 value &= ~(1 << bit_position); | 10186 value &= ~(1 << bit_position); |
10183 } | 10187 } |
10184 return value; | 10188 return value; |
10185 } | 10189 } |
10186 }; | 10190 }; |
10187 | 10191 |
10188 } } // namespace v8::internal | 10192 } } // namespace v8::internal |
10189 | 10193 |
10190 #endif // V8_OBJECTS_H_ | 10194 #endif // V8_OBJECTS_H_ |
OLD | NEW |