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 2489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2500 inline int number_of_entries() { return number_of_descriptors(); } | 2500 inline int number_of_entries() { return number_of_descriptors(); } |
2501 | 2501 |
2502 bool HasEnumCache() { | 2502 bool HasEnumCache() { |
2503 return !IsEmpty() && !get(kEnumCacheIndex)->IsSmi(); | 2503 return !IsEmpty() && !get(kEnumCacheIndex)->IsSmi(); |
2504 } | 2504 } |
2505 | 2505 |
2506 void CopyEnumCacheFrom(DescriptorArray* array) { | 2506 void CopyEnumCacheFrom(DescriptorArray* array) { |
2507 set(kEnumCacheIndex, array->get(kEnumCacheIndex)); | 2507 set(kEnumCacheIndex, array->get(kEnumCacheIndex)); |
2508 } | 2508 } |
2509 | 2509 |
2510 Object* GetEnumCache() { | 2510 FixedArray* GetEnumCache() { |
2511 ASSERT(HasEnumCache()); | 2511 ASSERT(HasEnumCache()); |
2512 FixedArray* bridge = FixedArray::cast(get(kEnumCacheIndex)); | 2512 FixedArray* bridge = FixedArray::cast(get(kEnumCacheIndex)); |
2513 return bridge->get(kEnumCacheBridgeCacheIndex); | 2513 return FixedArray::cast(bridge->get(kEnumCacheBridgeCacheIndex)); |
2514 } | |
2515 | |
2516 bool HasEnumIndicesCache() { | |
2517 if (IsEmpty()) return false;; | |
Jakob Kummerow
2012/09/19 07:58:41
nit: ;;
| |
2518 Object* object = get(kEnumCacheIndex); | |
2519 if (object->IsSmi()) return false; | |
2520 FixedArray* bridge = FixedArray::cast(object); | |
2521 return bridge->get(kEnumCacheBridgeIndicesCacheIndex)->IsSmi(); | |
2522 } | |
2523 | |
2524 FixedArray* GetEnumIndicesCache() { | |
2525 ASSERT(HasEnumIndicesCache()); | |
2526 FixedArray* bridge = FixedArray::cast(get(kEnumCacheIndex)); | |
2527 return FixedArray::cast(bridge->get(kEnumCacheBridgeIndicesCacheIndex)); | |
2514 } | 2528 } |
2515 | 2529 |
2516 Object** GetEnumCacheSlot() { | 2530 Object** GetEnumCacheSlot() { |
2517 ASSERT(HasEnumCache()); | 2531 ASSERT(HasEnumCache()); |
2518 return HeapObject::RawField(reinterpret_cast<HeapObject*>(this), | 2532 return HeapObject::RawField(reinterpret_cast<HeapObject*>(this), |
2519 kEnumCacheOffset); | 2533 kEnumCacheOffset); |
2520 } | 2534 } |
2521 | 2535 |
2522 void ClearEnumCache(); | 2536 void ClearEnumCache(); |
2523 | 2537 |
(...skipping 6468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8992 } else { | 9006 } else { |
8993 value &= ~(1 << bit_position); | 9007 value &= ~(1 << bit_position); |
8994 } | 9008 } |
8995 return value; | 9009 return value; |
8996 } | 9010 } |
8997 }; | 9011 }; |
8998 | 9012 |
8999 } } // namespace v8::internal | 9013 } } // namespace v8::internal |
9000 | 9014 |
9001 #endif // V8_OBJECTS_H_ | 9015 #endif // V8_OBJECTS_H_ |
OLD | NEW |