OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_CODEGEN_H_ | 5 #ifndef V8_CODEGEN_H_ |
6 #define V8_CODEGEN_H_ | 6 #define V8_CODEGEN_H_ |
7 | 7 |
8 #include "code-stubs.h" | 8 #include "code-stubs.h" |
9 #include "runtime.h" | 9 #include "runtime.h" |
10 | 10 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 AllocationSiteMode mode, | 113 AllocationSiteMode mode, |
114 Label* fail); | 114 Label* fail); |
115 | 115 |
116 private: | 116 private: |
117 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionGenerator); | 117 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionGenerator); |
118 }; | 118 }; |
119 | 119 |
120 static const int kNumberDictionaryProbes = 4; | 120 static const int kNumberDictionaryProbes = 4; |
121 | 121 |
122 | 122 |
| 123 class CodeAgingHelper { |
| 124 public: |
| 125 CodeAgingHelper(); |
| 126 |
| 127 uint32_t young_sequence_length() const { return young_sequence_.length(); } |
| 128 bool IsYoung(byte* candidate) const { |
| 129 return memcmp(candidate, |
| 130 young_sequence_.start(), |
| 131 young_sequence_.length()) == 0; |
| 132 } |
| 133 void CopyYoungSequenceTo(byte* new_buffer) const { |
| 134 CopyBytes(new_buffer, young_sequence_.start(), young_sequence_.length()); |
| 135 } |
| 136 |
| 137 #ifdef DEBUG |
| 138 bool IsOld(byte* candidate) const; |
| 139 #endif |
| 140 |
| 141 protected: |
| 142 const EmbeddedVector<byte, kNoCodeAgeSequenceLength> young_sequence_; |
| 143 #ifdef DEBUG |
| 144 #ifdef V8_TARGET_ARCH_ARM64 |
| 145 const EmbeddedVector<byte, kNoCodeAgeSequenceLength> old_sequence_; |
| 146 #endif |
| 147 #endif |
| 148 }; |
| 149 |
123 } } // namespace v8::internal | 150 } } // namespace v8::internal |
124 | 151 |
125 #endif // V8_CODEGEN_H_ | 152 #endif // V8_CODEGEN_H_ |
OLD | NEW |