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 // Review notes: | 5 // Review notes: |
6 // | 6 // |
7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
10 // | 10 // |
(...skipping 5485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5496 DCHECK((value->IsUndefined() && GetBackPointer()->IsMap()) || | 5496 DCHECK((value->IsUndefined() && GetBackPointer()->IsMap()) || |
5497 (value->IsMap() && GetBackPointer()->IsUndefined())); | 5497 (value->IsMap() && GetBackPointer()->IsUndefined())); |
5498 DCHECK(!value->IsMap() || | 5498 DCHECK(!value->IsMap() || |
5499 Map::cast(value)->GetConstructor() == constructor_or_backpointer()); | 5499 Map::cast(value)->GetConstructor() == constructor_or_backpointer()); |
5500 set_constructor_or_backpointer(value, mode); | 5500 set_constructor_or_backpointer(value, mode); |
5501 } | 5501 } |
5502 | 5502 |
5503 | 5503 |
5504 ACCESSORS(Map, code_cache, Object, kCodeCacheOffset) | 5504 ACCESSORS(Map, code_cache, Object, kCodeCacheOffset) |
5505 ACCESSORS(Map, dependent_code, DependentCode, kDependentCodeOffset) | 5505 ACCESSORS(Map, dependent_code, DependentCode, kDependentCodeOffset) |
| 5506 ACCESSORS(Map, weak_cell_cache, Object, kWeakCellCacheOffset) |
5506 ACCESSORS(Map, constructor_or_backpointer, Object, | 5507 ACCESSORS(Map, constructor_or_backpointer, Object, |
5507 kConstructorOrBackPointerOffset) | 5508 kConstructorOrBackPointerOffset) |
5508 | 5509 |
5509 Object* Map::GetConstructor() const { | 5510 Object* Map::GetConstructor() const { |
5510 Object* maybe_constructor = constructor_or_backpointer(); | 5511 Object* maybe_constructor = constructor_or_backpointer(); |
5511 // Follow any back pointers. | 5512 // Follow any back pointers. |
5512 while (maybe_constructor->IsMap()) { | 5513 while (maybe_constructor->IsMap()) { |
5513 maybe_constructor = | 5514 maybe_constructor = |
5514 Map::cast(maybe_constructor)->constructor_or_backpointer(); | 5515 Map::cast(maybe_constructor)->constructor_or_backpointer(); |
5515 } | 5516 } |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5856 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_generator, kIsGenerator) | 5857 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_generator, kIsGenerator) |
5857 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_concise_method, | 5858 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_concise_method, |
5858 kIsConciseMethod) | 5859 kIsConciseMethod) |
5859 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_accessor_function, | 5860 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_accessor_function, |
5860 kIsAccessorFunction) | 5861 kIsAccessorFunction) |
5861 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_default_constructor, | 5862 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_default_constructor, |
5862 kIsDefaultConstructor) | 5863 kIsDefaultConstructor) |
5863 | 5864 |
5864 ACCESSORS(CodeCache, default_cache, FixedArray, kDefaultCacheOffset) | 5865 ACCESSORS(CodeCache, default_cache, FixedArray, kDefaultCacheOffset) |
5865 ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset) | 5866 ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset) |
5866 ACCESSORS(CodeCache, weak_cell_cache, Object, kWeakCellCacheOffset) | |
5867 | 5867 |
5868 ACCESSORS(PolymorphicCodeCache, cache, Object, kCacheOffset) | 5868 ACCESSORS(PolymorphicCodeCache, cache, Object, kCacheOffset) |
5869 | 5869 |
5870 bool Script::HasValidSource() { | 5870 bool Script::HasValidSource() { |
5871 Object* src = this->source(); | 5871 Object* src = this->source(); |
5872 if (!src->IsString()) return true; | 5872 if (!src->IsString()) return true; |
5873 String* src_str = String::cast(src); | 5873 String* src_str = String::cast(src); |
5874 if (!StringShape(src_str).IsExternal()) return true; | 5874 if (!StringShape(src_str).IsExternal()) return true; |
5875 if (src_str->IsOneByteRepresentation()) { | 5875 if (src_str->IsOneByteRepresentation()) { |
5876 return ExternalOneByteString::cast(src)->resource() != NULL; | 5876 return ExternalOneByteString::cast(src)->resource() != NULL; |
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7629 #undef READ_SHORT_FIELD | 7629 #undef READ_SHORT_FIELD |
7630 #undef WRITE_SHORT_FIELD | 7630 #undef WRITE_SHORT_FIELD |
7631 #undef READ_BYTE_FIELD | 7631 #undef READ_BYTE_FIELD |
7632 #undef WRITE_BYTE_FIELD | 7632 #undef WRITE_BYTE_FIELD |
7633 #undef NOBARRIER_READ_BYTE_FIELD | 7633 #undef NOBARRIER_READ_BYTE_FIELD |
7634 #undef NOBARRIER_WRITE_BYTE_FIELD | 7634 #undef NOBARRIER_WRITE_BYTE_FIELD |
7635 | 7635 |
7636 } } // namespace v8::internal | 7636 } } // namespace v8::internal |
7637 | 7637 |
7638 #endif // V8_OBJECTS_INL_H_ | 7638 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |