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 2394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2405 } | 2405 } |
2406 | 2406 |
2407 // TODO(1399): It should be possible to make room for bit_field3 in the map | 2407 // TODO(1399): It should be possible to make room for bit_field3 in the map |
2408 // without overloading the instance descriptors field in the map | 2408 // without overloading the instance descriptors field in the map |
2409 // (and storing it in the DescriptorArray when the map has one). | 2409 // (and storing it in the DescriptorArray when the map has one). |
2410 inline int bit_field3_storage(); | 2410 inline int bit_field3_storage(); |
2411 inline void set_bit_field3_storage(int value); | 2411 inline void set_bit_field3_storage(int value); |
2412 | 2412 |
2413 // Initialize or change the enum cache, | 2413 // Initialize or change the enum cache, |
2414 // using the supplied storage for the small "bridge". | 2414 // using the supplied storage for the small "bridge". |
2415 void SetEnumCache(FixedArray* bridge_storage, FixedArray* new_cache); | 2415 void SetEnumCache(FixedArray* bridge_storage, |
| 2416 FixedArray* new_cache, |
| 2417 Object* new_index_cache); |
2416 | 2418 |
2417 // Accessors for fetching instance descriptor at descriptor number. | 2419 // Accessors for fetching instance descriptor at descriptor number. |
2418 inline String* GetKey(int descriptor_number); | 2420 inline String* GetKey(int descriptor_number); |
2419 inline Object* GetValue(int descriptor_number); | 2421 inline Object* GetValue(int descriptor_number); |
2420 inline Smi* GetDetails(int descriptor_number); | 2422 inline Smi* GetDetails(int descriptor_number); |
2421 inline PropertyType GetType(int descriptor_number); | 2423 inline PropertyType GetType(int descriptor_number); |
2422 inline int GetFieldIndex(int descriptor_number); | 2424 inline int GetFieldIndex(int descriptor_number); |
2423 inline JSFunction* GetConstantFunction(int descriptor_number); | 2425 inline JSFunction* GetConstantFunction(int descriptor_number); |
2424 inline Object* GetCallbacksObject(int descriptor_number); | 2426 inline Object* GetCallbacksObject(int descriptor_number); |
2425 inline AccessorDescriptor* GetCallbacks(int descriptor_number); | 2427 inline AccessorDescriptor* GetCallbacks(int descriptor_number); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2509 | 2511 |
2510 // Constant for denoting key was not found. | 2512 // Constant for denoting key was not found. |
2511 static const int kNotFound = -1; | 2513 static const int kNotFound = -1; |
2512 | 2514 |
2513 static const int kBitField3StorageIndex = 0; | 2515 static const int kBitField3StorageIndex = 0; |
2514 static const int kContentArrayIndex = 1; | 2516 static const int kContentArrayIndex = 1; |
2515 static const int kEnumerationIndexIndex = 2; | 2517 static const int kEnumerationIndexIndex = 2; |
2516 static const int kFirstIndex = 3; | 2518 static const int kFirstIndex = 3; |
2517 | 2519 |
2518 // The length of the "bridge" to the enum cache. | 2520 // The length of the "bridge" to the enum cache. |
2519 static const int kEnumCacheBridgeLength = 2; | 2521 static const int kEnumCacheBridgeLength = 3; |
2520 static const int kEnumCacheBridgeEnumIndex = 0; | 2522 static const int kEnumCacheBridgeEnumIndex = 0; |
2521 static const int kEnumCacheBridgeCacheIndex = 1; | 2523 static const int kEnumCacheBridgeCacheIndex = 1; |
| 2524 static const int kEnumCacheBridgeIndicesCacheIndex = 2; |
2522 | 2525 |
2523 // Layout description. | 2526 // Layout description. |
2524 static const int kBitField3StorageOffset = FixedArray::kHeaderSize; | 2527 static const int kBitField3StorageOffset = FixedArray::kHeaderSize; |
2525 static const int kContentArrayOffset = kBitField3StorageOffset + kPointerSize; | 2528 static const int kContentArrayOffset = kBitField3StorageOffset + kPointerSize; |
2526 static const int kEnumerationIndexOffset = kContentArrayOffset + kPointerSize; | 2529 static const int kEnumerationIndexOffset = kContentArrayOffset + kPointerSize; |
2527 static const int kFirstOffset = kEnumerationIndexOffset + kPointerSize; | 2530 static const int kFirstOffset = kEnumerationIndexOffset + kPointerSize; |
2528 | 2531 |
2529 // Layout description for the bridge array. | 2532 // Layout description for the bridge array. |
2530 static const int kEnumCacheBridgeEnumOffset = FixedArray::kHeaderSize; | 2533 static const int kEnumCacheBridgeEnumOffset = FixedArray::kHeaderSize; |
2531 static const int kEnumCacheBridgeCacheOffset = | 2534 static const int kEnumCacheBridgeCacheOffset = |
(...skipping 5770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8302 } else { | 8305 } else { |
8303 value &= ~(1 << bit_position); | 8306 value &= ~(1 << bit_position); |
8304 } | 8307 } |
8305 return value; | 8308 return value; |
8306 } | 8309 } |
8307 }; | 8310 }; |
8308 | 8311 |
8309 } } // namespace v8::internal | 8312 } } // namespace v8::internal |
8310 | 8313 |
8311 #endif // V8_OBJECTS_H_ | 8314 #endif // V8_OBJECTS_H_ |
OLD | NEW |