OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 3568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3579 // fails, this fields hold an exception object that should be | 3579 // fails, this fields hold an exception object that should be |
3580 // thrown if the regexp is used again. | 3580 // thrown if the regexp is used again. |
3581 static const int kIrregexpUC16CodeIndex = kDataIndex + 1; | 3581 static const int kIrregexpUC16CodeIndex = kDataIndex + 1; |
3582 // Maximal number of registers used by either ASCII or UC16. | 3582 // Maximal number of registers used by either ASCII or UC16. |
3583 // Only used to check that there is enough stack space | 3583 // Only used to check that there is enough stack space |
3584 static const int kIrregexpMaxRegisterCountIndex = kDataIndex + 2; | 3584 static const int kIrregexpMaxRegisterCountIndex = kDataIndex + 2; |
3585 // Number of captures in the compiled regexp. | 3585 // Number of captures in the compiled regexp. |
3586 static const int kIrregexpCaptureCountIndex = kDataIndex + 3; | 3586 static const int kIrregexpCaptureCountIndex = kDataIndex + 3; |
3587 | 3587 |
3588 static const int kIrregexpDataSize = kIrregexpCaptureCountIndex + 1; | 3588 static const int kIrregexpDataSize = kIrregexpCaptureCountIndex + 1; |
| 3589 |
| 3590 // Offsets directly into the data fixed array. |
| 3591 static const int kDataTagOffset = |
| 3592 FixedArray::kHeaderSize + kTagIndex * kPointerSize; |
| 3593 static const int kDataAsciiCodeOffset = |
| 3594 FixedArray::kHeaderSize + kIrregexpASCIICodeIndex * kPointerSize; |
| 3595 static const int kIrregexpCaptureCountOffset = |
| 3596 FixedArray::kHeaderSize + kIrregexpCaptureCountIndex * kPointerSize; |
3589 }; | 3597 }; |
3590 | 3598 |
3591 | 3599 |
3592 class CompilationCacheShape { | 3600 class CompilationCacheShape { |
3593 public: | 3601 public: |
3594 static inline bool IsMatch(HashTableKey* key, Object* value) { | 3602 static inline bool IsMatch(HashTableKey* key, Object* value) { |
3595 return key->IsMatch(value); | 3603 return key->IsMatch(value); |
3596 } | 3604 } |
3597 | 3605 |
3598 static inline uint32_t Hash(HashTableKey* key) { | 3606 static inline uint32_t Hash(HashTableKey* key) { |
(...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4883 } else { | 4891 } else { |
4884 value &= ~(1 << bit_position); | 4892 value &= ~(1 << bit_position); |
4885 } | 4893 } |
4886 return value; | 4894 return value; |
4887 } | 4895 } |
4888 }; | 4896 }; |
4889 | 4897 |
4890 } } // namespace v8::internal | 4898 } } // namespace v8::internal |
4891 | 4899 |
4892 #endif // V8_OBJECTS_H_ | 4900 #endif // V8_OBJECTS_H_ |
OLD | NEW |