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 11414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11425 DECL_BOOLEAN_ACCESSORS(hidden_prototype) | 11425 DECL_BOOLEAN_ACCESSORS(hidden_prototype) |
11426 DECL_BOOLEAN_ACCESSORS(undetectable) | 11426 DECL_BOOLEAN_ACCESSORS(undetectable) |
11427 // If the bit is set, object instances created by this function | 11427 // If the bit is set, object instances created by this function |
11428 // requires access check. | 11428 // requires access check. |
11429 DECL_BOOLEAN_ACCESSORS(needs_access_check) | 11429 DECL_BOOLEAN_ACCESSORS(needs_access_check) |
11430 DECL_BOOLEAN_ACCESSORS(read_only_prototype) | 11430 DECL_BOOLEAN_ACCESSORS(read_only_prototype) |
11431 DECL_BOOLEAN_ACCESSORS(remove_prototype) | 11431 DECL_BOOLEAN_ACCESSORS(remove_prototype) |
11432 DECL_BOOLEAN_ACCESSORS(do_not_cache) | 11432 DECL_BOOLEAN_ACCESSORS(do_not_cache) |
11433 DECL_BOOLEAN_ACCESSORS(accept_any_receiver) | 11433 DECL_BOOLEAN_ACCESSORS(accept_any_receiver) |
11434 | 11434 |
| 11435 DECL_ACCESSORS(cache_property, Object) |
| 11436 |
11435 DECLARE_CAST(FunctionTemplateInfo) | 11437 DECLARE_CAST(FunctionTemplateInfo) |
11436 | 11438 |
11437 // Dispatched behavior. | 11439 // Dispatched behavior. |
11438 DECLARE_PRINTER(FunctionTemplateInfo) | 11440 DECLARE_PRINTER(FunctionTemplateInfo) |
11439 DECLARE_VERIFIER(FunctionTemplateInfo) | 11441 DECLARE_VERIFIER(FunctionTemplateInfo) |
11440 | 11442 |
11441 static const int kCallCodeOffset = TemplateInfo::kHeaderSize; | 11443 static const int kCallCodeOffset = TemplateInfo::kHeaderSize; |
11442 static const int kPrototypeTemplateOffset = | 11444 static const int kPrototypeTemplateOffset = |
11443 kCallCodeOffset + kPointerSize; | 11445 kCallCodeOffset + kPointerSize; |
11444 static const int kParentTemplateOffset = | 11446 static const int kParentTemplateOffset = |
11445 kPrototypeTemplateOffset + kPointerSize; | 11447 kPrototypeTemplateOffset + kPointerSize; |
11446 static const int kNamedPropertyHandlerOffset = | 11448 static const int kNamedPropertyHandlerOffset = |
11447 kParentTemplateOffset + kPointerSize; | 11449 kParentTemplateOffset + kPointerSize; |
11448 static const int kIndexedPropertyHandlerOffset = | 11450 static const int kIndexedPropertyHandlerOffset = |
11449 kNamedPropertyHandlerOffset + kPointerSize; | 11451 kNamedPropertyHandlerOffset + kPointerSize; |
11450 static const int kInstanceTemplateOffset = | 11452 static const int kInstanceTemplateOffset = |
11451 kIndexedPropertyHandlerOffset + kPointerSize; | 11453 kIndexedPropertyHandlerOffset + kPointerSize; |
11452 static const int kClassNameOffset = kInstanceTemplateOffset + kPointerSize; | 11454 static const int kClassNameOffset = kInstanceTemplateOffset + kPointerSize; |
11453 static const int kSignatureOffset = kClassNameOffset + kPointerSize; | 11455 static const int kSignatureOffset = kClassNameOffset + kPointerSize; |
11454 static const int kInstanceCallHandlerOffset = kSignatureOffset + kPointerSize; | 11456 static const int kInstanceCallHandlerOffset = kSignatureOffset + kPointerSize; |
11455 static const int kAccessCheckInfoOffset = | 11457 static const int kAccessCheckInfoOffset = |
11456 kInstanceCallHandlerOffset + kPointerSize; | 11458 kInstanceCallHandlerOffset + kPointerSize; |
11457 static const int kSharedFunctionInfoOffset = | 11459 static const int kSharedFunctionInfoOffset = |
11458 kAccessCheckInfoOffset + kPointerSize; | 11460 kAccessCheckInfoOffset + kPointerSize; |
11459 static const int kFlagOffset = kSharedFunctionInfoOffset + kPointerSize; | 11461 static const int kFlagOffset = kSharedFunctionInfoOffset + kPointerSize; |
11460 static const int kLengthOffset = kFlagOffset + kPointerSize; | 11462 static const int kLengthOffset = kFlagOffset + kPointerSize; |
11461 static const int kSize = kLengthOffset + kPointerSize; | 11463 static const int kCachePropertyOffset = kLengthOffset + kPointerSize; |
| 11464 static const int kSize = kCachePropertyOffset + kPointerSize; |
11462 | 11465 |
11463 static Handle<SharedFunctionInfo> GetOrCreateSharedFunctionInfo( | 11466 static Handle<SharedFunctionInfo> GetOrCreateSharedFunctionInfo( |
11464 Isolate* isolate, Handle<FunctionTemplateInfo> info); | 11467 Isolate* isolate, Handle<FunctionTemplateInfo> info); |
11465 // Returns parent function template or null. | 11468 // Returns parent function template or null. |
11466 inline FunctionTemplateInfo* GetParent(Isolate* isolate); | 11469 inline FunctionTemplateInfo* GetParent(Isolate* isolate); |
11467 // Returns true if |object| is an instance of this function template. | 11470 // Returns true if |object| is an instance of this function template. |
11468 inline bool IsTemplateFor(JSObject* object); | 11471 inline bool IsTemplateFor(JSObject* object); |
11469 bool IsTemplateFor(Map* map); | 11472 bool IsTemplateFor(Map* map); |
11470 inline bool instantiated(); | 11473 inline bool instantiated(); |
11471 | 11474 |
| 11475 // Helper function for cached accessors. |
| 11476 static MaybeHandle<Name> TryGetCachePropertyName(Isolate* isolate, |
| 11477 Handle<Object> getter); |
| 11478 |
11472 private: | 11479 private: |
11473 // Bit position in the flag, from least significant bit position. | 11480 // Bit position in the flag, from least significant bit position. |
11474 static const int kHiddenPrototypeBit = 0; | 11481 static const int kHiddenPrototypeBit = 0; |
11475 static const int kUndetectableBit = 1; | 11482 static const int kUndetectableBit = 1; |
11476 static const int kNeedsAccessCheckBit = 2; | 11483 static const int kNeedsAccessCheckBit = 2; |
11477 static const int kReadOnlyPrototypeBit = 3; | 11484 static const int kReadOnlyPrototypeBit = 3; |
11478 static const int kRemovePrototypeBit = 4; | 11485 static const int kRemovePrototypeBit = 4; |
11479 static const int kDoNotCacheBit = 5; | 11486 static const int kDoNotCacheBit = 5; |
11480 static const int kAcceptAnyReceiver = 6; | 11487 static const int kAcceptAnyReceiver = 6; |
11481 | 11488 |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11729 } | 11736 } |
11730 return value; | 11737 return value; |
11731 } | 11738 } |
11732 }; | 11739 }; |
11733 | 11740 |
11734 | 11741 |
11735 } // NOLINT, false-positive due to second-order macros. | 11742 } // NOLINT, false-positive due to second-order macros. |
11736 } // NOLINT, false-positive due to second-order macros. | 11743 } // NOLINT, false-positive due to second-order macros. |
11737 | 11744 |
11738 #endif // V8_OBJECTS_H_ | 11745 #endif // V8_OBJECTS_H_ |
OLD | NEW |