Chromium Code Reviews| 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 NoCodeAgeSequence { | |
| 124 public: | |
| 125 NoCodeAgeSequence(); | |
| 126 | |
| 127 uint32_t length() const { return sequence_.length(); } | |
| 128 bool Match(byte* candidate) const { | |
|
Sven Panne
2014/05/05 07:54:14
"IsPrefixOf" describes the intent more closely.
mvstanton
2014/05/06 09:55:45
I ended up generalizing the class, and the notion
| |
| 129 return memcmp(candidate, sequence_.start(), sequence_.length()) == 0; | |
| 130 } | |
| 131 void CopyTo(byte* new_buffer) const { | |
| 132 CopyBytes(new_buffer, sequence_.start(), sequence_.length()); | |
| 133 } | |
| 134 | |
| 135 protected: | |
| 136 const EmbeddedVector<byte, kNoCodeAgeSequenceLength> sequence_; | |
| 137 }; | |
| 138 | |
| 123 } } // namespace v8::internal | 139 } } // namespace v8::internal |
| 124 | 140 |
| 125 #endif // V8_CODEGEN_H_ | 141 #endif // V8_CODEGEN_H_ |
| OLD | NEW |