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_HYDROGEN_INSTRUCTIONS_H_ | 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ |
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ | 6 #define V8_HYDROGEN_INSTRUCTIONS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/v8.h" | 10 #include "src/v8.h" |
(...skipping 6349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6360 Representation::Smi()); | 6360 Representation::Smi()); |
6361 } | 6361 } |
6362 | 6362 |
6363 template <typename CollectionType> | 6363 template <typename CollectionType> |
6364 static HObjectAccess ForOrderedHashTableNumberOfDeletedElements() { | 6364 static HObjectAccess ForOrderedHashTableNumberOfDeletedElements() { |
6365 return HObjectAccess(kInobject, | 6365 return HObjectAccess(kInobject, |
6366 CollectionType::kNumberOfDeletedElementsOffset, | 6366 CollectionType::kNumberOfDeletedElementsOffset, |
6367 Representation::Smi()); | 6367 Representation::Smi()); |
6368 } | 6368 } |
6369 | 6369 |
| 6370 template <typename CollectionType> |
| 6371 static HObjectAccess ForOrderedHashTableBucket(int bucket) { |
| 6372 return HObjectAccess(kInobject, CollectionType::kHashTableStartOffset + |
| 6373 (bucket * kPointerSize), |
| 6374 Representation::Smi()); |
| 6375 } |
| 6376 |
| 6377 // Access into the data table of an OrderedHashTable with a |
| 6378 // known-at-compile-time bucket count. |
| 6379 template <typename CollectionType, int kBucketCount> |
| 6380 static HObjectAccess ForOrderedHashTableDataTableIndex(int index) { |
| 6381 return HObjectAccess(kInobject, CollectionType::kHashTableStartOffset + |
| 6382 (kBucketCount * kPointerSize) + |
| 6383 (index * kPointerSize)); |
| 6384 } |
| 6385 |
6370 inline bool Equals(HObjectAccess that) const { | 6386 inline bool Equals(HObjectAccess that) const { |
6371 return value_ == that.value_; // portion and offset must match | 6387 return value_ == that.value_; // portion and offset must match |
6372 } | 6388 } |
6373 | 6389 |
6374 protected: | 6390 protected: |
6375 void SetGVNFlags(HValue *instr, PropertyAccessType access_type); | 6391 void SetGVNFlags(HValue *instr, PropertyAccessType access_type); |
6376 | 6392 |
6377 private: | 6393 private: |
6378 // internal use only; different parts of an object or array | 6394 // internal use only; different parts of an object or array |
6379 enum Portion { | 6395 enum Portion { |
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8007 }; | 8023 }; |
8008 | 8024 |
8009 | 8025 |
8010 | 8026 |
8011 #undef DECLARE_INSTRUCTION | 8027 #undef DECLARE_INSTRUCTION |
8012 #undef DECLARE_CONCRETE_INSTRUCTION | 8028 #undef DECLARE_CONCRETE_INSTRUCTION |
8013 | 8029 |
8014 } } // namespace v8::internal | 8030 } } // namespace v8::internal |
8015 | 8031 |
8016 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 8032 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |