| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
| 6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 11134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11145 DECL_BOOLEAN_ACCESSORS(hidden_prototype) | 11145 DECL_BOOLEAN_ACCESSORS(hidden_prototype) |
| 11146 DECL_BOOLEAN_ACCESSORS(undetectable) | 11146 DECL_BOOLEAN_ACCESSORS(undetectable) |
| 11147 // If the bit is set, object instances created by this function | 11147 // If the bit is set, object instances created by this function |
| 11148 // requires access check. | 11148 // requires access check. |
| 11149 DECL_BOOLEAN_ACCESSORS(needs_access_check) | 11149 DECL_BOOLEAN_ACCESSORS(needs_access_check) |
| 11150 DECL_BOOLEAN_ACCESSORS(read_only_prototype) | 11150 DECL_BOOLEAN_ACCESSORS(read_only_prototype) |
| 11151 DECL_BOOLEAN_ACCESSORS(remove_prototype) | 11151 DECL_BOOLEAN_ACCESSORS(remove_prototype) |
| 11152 DECL_BOOLEAN_ACCESSORS(do_not_cache) | 11152 DECL_BOOLEAN_ACCESSORS(do_not_cache) |
| 11153 DECL_BOOLEAN_ACCESSORS(accept_any_receiver) | 11153 DECL_BOOLEAN_ACCESSORS(accept_any_receiver) |
| 11154 | 11154 |
| 11155 DECL_ACCESSORS(cache_property, Object) |
| 11156 |
| 11155 DECLARE_CAST(FunctionTemplateInfo) | 11157 DECLARE_CAST(FunctionTemplateInfo) |
| 11156 | 11158 |
| 11157 // Dispatched behavior. | 11159 // Dispatched behavior. |
| 11158 DECLARE_PRINTER(FunctionTemplateInfo) | 11160 DECLARE_PRINTER(FunctionTemplateInfo) |
| 11159 DECLARE_VERIFIER(FunctionTemplateInfo) | 11161 DECLARE_VERIFIER(FunctionTemplateInfo) |
| 11160 | 11162 |
| 11161 static const int kCallCodeOffset = TemplateInfo::kHeaderSize; | 11163 static const int kCallCodeOffset = TemplateInfo::kHeaderSize; |
| 11162 static const int kPrototypeTemplateOffset = | 11164 static const int kPrototypeTemplateOffset = |
| 11163 kCallCodeOffset + kPointerSize; | 11165 kCallCodeOffset + kPointerSize; |
| 11164 static const int kParentTemplateOffset = | 11166 static const int kParentTemplateOffset = |
| 11165 kPrototypeTemplateOffset + kPointerSize; | 11167 kPrototypeTemplateOffset + kPointerSize; |
| 11166 static const int kNamedPropertyHandlerOffset = | 11168 static const int kNamedPropertyHandlerOffset = |
| 11167 kParentTemplateOffset + kPointerSize; | 11169 kParentTemplateOffset + kPointerSize; |
| 11168 static const int kIndexedPropertyHandlerOffset = | 11170 static const int kIndexedPropertyHandlerOffset = |
| 11169 kNamedPropertyHandlerOffset + kPointerSize; | 11171 kNamedPropertyHandlerOffset + kPointerSize; |
| 11170 static const int kInstanceTemplateOffset = | 11172 static const int kInstanceTemplateOffset = |
| 11171 kIndexedPropertyHandlerOffset + kPointerSize; | 11173 kIndexedPropertyHandlerOffset + kPointerSize; |
| 11172 static const int kClassNameOffset = kInstanceTemplateOffset + kPointerSize; | 11174 static const int kClassNameOffset = kInstanceTemplateOffset + kPointerSize; |
| 11173 static const int kSignatureOffset = kClassNameOffset + kPointerSize; | 11175 static const int kSignatureOffset = kClassNameOffset + kPointerSize; |
| 11174 static const int kInstanceCallHandlerOffset = kSignatureOffset + kPointerSize; | 11176 static const int kInstanceCallHandlerOffset = kSignatureOffset + kPointerSize; |
| 11175 static const int kAccessCheckInfoOffset = | 11177 static const int kAccessCheckInfoOffset = |
| 11176 kInstanceCallHandlerOffset + kPointerSize; | 11178 kInstanceCallHandlerOffset + kPointerSize; |
| 11177 static const int kSharedFunctionInfoOffset = | 11179 static const int kSharedFunctionInfoOffset = |
| 11178 kAccessCheckInfoOffset + kPointerSize; | 11180 kAccessCheckInfoOffset + kPointerSize; |
| 11179 static const int kFlagOffset = kSharedFunctionInfoOffset + kPointerSize; | 11181 static const int kFlagOffset = kSharedFunctionInfoOffset + kPointerSize; |
| 11180 static const int kLengthOffset = kFlagOffset + kPointerSize; | 11182 static const int kLengthOffset = kFlagOffset + kPointerSize; |
| 11181 static const int kSize = kLengthOffset + kPointerSize; | 11183 static const int kCachePropertyOffset = kLengthOffset + kPointerSize; |
| 11184 static const int kSize = kCachePropertyOffset + kPointerSize; |
| 11182 | 11185 |
| 11183 static Handle<SharedFunctionInfo> GetOrCreateSharedFunctionInfo( | 11186 static Handle<SharedFunctionInfo> GetOrCreateSharedFunctionInfo( |
| 11184 Isolate* isolate, Handle<FunctionTemplateInfo> info); | 11187 Isolate* isolate, Handle<FunctionTemplateInfo> info); |
| 11185 // Returns parent function template or null. | 11188 // Returns parent function template or null. |
| 11186 inline FunctionTemplateInfo* GetParent(Isolate* isolate); | 11189 inline FunctionTemplateInfo* GetParent(Isolate* isolate); |
| 11187 // Returns true if |object| is an instance of this function template. | 11190 // Returns true if |object| is an instance of this function template. |
| 11188 inline bool IsTemplateFor(JSObject* object); | 11191 inline bool IsTemplateFor(JSObject* object); |
| 11189 bool IsTemplateFor(Map* map); | 11192 bool IsTemplateFor(Map* map); |
| 11190 inline bool instantiated(); | 11193 inline bool instantiated(); |
| 11191 | 11194 |
| 11195 // Helper function for cached accessors. |
| 11196 static MaybeHandle<Name> TryGetCachePropertyName(Isolate* isolate, |
| 11197 Handle<Object> getter); |
| 11198 |
| 11192 private: | 11199 private: |
| 11193 // Bit position in the flag, from least significant bit position. | 11200 // Bit position in the flag, from least significant bit position. |
| 11194 static const int kHiddenPrototypeBit = 0; | 11201 static const int kHiddenPrototypeBit = 0; |
| 11195 static const int kUndetectableBit = 1; | 11202 static const int kUndetectableBit = 1; |
| 11196 static const int kNeedsAccessCheckBit = 2; | 11203 static const int kNeedsAccessCheckBit = 2; |
| 11197 static const int kReadOnlyPrototypeBit = 3; | 11204 static const int kReadOnlyPrototypeBit = 3; |
| 11198 static const int kRemovePrototypeBit = 4; | 11205 static const int kRemovePrototypeBit = 4; |
| 11199 static const int kDoNotCacheBit = 5; | 11206 static const int kDoNotCacheBit = 5; |
| 11200 static const int kAcceptAnyReceiver = 6; | 11207 static const int kAcceptAnyReceiver = 6; |
| 11201 | 11208 |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11449 } | 11456 } |
| 11450 return value; | 11457 return value; |
| 11451 } | 11458 } |
| 11452 }; | 11459 }; |
| 11453 | 11460 |
| 11454 | 11461 |
| 11455 } // NOLINT, false-positive due to second-order macros. | 11462 } // NOLINT, false-positive due to second-order macros. |
| 11456 } // NOLINT, false-positive due to second-order macros. | 11463 } // NOLINT, false-positive due to second-order macros. |
| 11457 | 11464 |
| 11458 #endif // V8_OBJECTS_H_ | 11465 #endif // V8_OBJECTS_H_ |
| OLD | NEW |