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 | 9 |
10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
(...skipping 10506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10517 DECL_ACCESSORS(call_code, Object) | 10517 DECL_ACCESSORS(call_code, Object) |
10518 DECL_ACCESSORS(prototype_template, Object) | 10518 DECL_ACCESSORS(prototype_template, Object) |
10519 DECL_ACCESSORS(parent_template, Object) | 10519 DECL_ACCESSORS(parent_template, Object) |
10520 DECL_ACCESSORS(named_property_handler, Object) | 10520 DECL_ACCESSORS(named_property_handler, Object) |
10521 DECL_ACCESSORS(indexed_property_handler, Object) | 10521 DECL_ACCESSORS(indexed_property_handler, Object) |
10522 DECL_ACCESSORS(instance_template, Object) | 10522 DECL_ACCESSORS(instance_template, Object) |
10523 DECL_ACCESSORS(class_name, Object) | 10523 DECL_ACCESSORS(class_name, Object) |
10524 DECL_ACCESSORS(signature, Object) | 10524 DECL_ACCESSORS(signature, Object) |
10525 DECL_ACCESSORS(instance_call_handler, Object) | 10525 DECL_ACCESSORS(instance_call_handler, Object) |
10526 DECL_ACCESSORS(access_check_info, Object) | 10526 DECL_ACCESSORS(access_check_info, Object) |
| 10527 DECL_ACCESSORS(shared_function_info, Object) |
10527 DECL_INT_ACCESSORS(flag) | 10528 DECL_INT_ACCESSORS(flag) |
10528 | 10529 |
10529 inline int length() const; | 10530 inline int length() const; |
10530 inline void set_length(int value); | 10531 inline void set_length(int value); |
10531 | 10532 |
10532 // Following properties use flag bits. | 10533 // Following properties use flag bits. |
10533 DECL_BOOLEAN_ACCESSORS(hidden_prototype) | 10534 DECL_BOOLEAN_ACCESSORS(hidden_prototype) |
10534 DECL_BOOLEAN_ACCESSORS(undetectable) | 10535 DECL_BOOLEAN_ACCESSORS(undetectable) |
10535 // If the bit is set, object instances created by this function | 10536 // If the bit is set, object instances created by this function |
10536 // requires access check. | 10537 // requires access check. |
10537 DECL_BOOLEAN_ACCESSORS(needs_access_check) | 10538 DECL_BOOLEAN_ACCESSORS(needs_access_check) |
10538 DECL_BOOLEAN_ACCESSORS(read_only_prototype) | 10539 DECL_BOOLEAN_ACCESSORS(read_only_prototype) |
10539 DECL_BOOLEAN_ACCESSORS(remove_prototype) | 10540 DECL_BOOLEAN_ACCESSORS(remove_prototype) |
10540 DECL_BOOLEAN_ACCESSORS(do_not_cache) | 10541 DECL_BOOLEAN_ACCESSORS(do_not_cache) |
10541 DECL_BOOLEAN_ACCESSORS(instantiated) | |
10542 DECL_BOOLEAN_ACCESSORS(accept_any_receiver) | 10542 DECL_BOOLEAN_ACCESSORS(accept_any_receiver) |
10543 | 10543 |
10544 DECLARE_CAST(FunctionTemplateInfo) | 10544 DECLARE_CAST(FunctionTemplateInfo) |
10545 | 10545 |
10546 // Dispatched behavior. | 10546 // Dispatched behavior. |
10547 DECLARE_PRINTER(FunctionTemplateInfo) | 10547 DECLARE_PRINTER(FunctionTemplateInfo) |
10548 DECLARE_VERIFIER(FunctionTemplateInfo) | 10548 DECLARE_VERIFIER(FunctionTemplateInfo) |
10549 | 10549 |
10550 static const int kCallCodeOffset = TemplateInfo::kHeaderSize; | 10550 static const int kCallCodeOffset = TemplateInfo::kHeaderSize; |
10551 static const int kPrototypeTemplateOffset = | 10551 static const int kPrototypeTemplateOffset = |
10552 kCallCodeOffset + kPointerSize; | 10552 kCallCodeOffset + kPointerSize; |
10553 static const int kParentTemplateOffset = | 10553 static const int kParentTemplateOffset = |
10554 kPrototypeTemplateOffset + kPointerSize; | 10554 kPrototypeTemplateOffset + kPointerSize; |
10555 static const int kNamedPropertyHandlerOffset = | 10555 static const int kNamedPropertyHandlerOffset = |
10556 kParentTemplateOffset + kPointerSize; | 10556 kParentTemplateOffset + kPointerSize; |
10557 static const int kIndexedPropertyHandlerOffset = | 10557 static const int kIndexedPropertyHandlerOffset = |
10558 kNamedPropertyHandlerOffset + kPointerSize; | 10558 kNamedPropertyHandlerOffset + kPointerSize; |
10559 static const int kInstanceTemplateOffset = | 10559 static const int kInstanceTemplateOffset = |
10560 kIndexedPropertyHandlerOffset + kPointerSize; | 10560 kIndexedPropertyHandlerOffset + kPointerSize; |
10561 static const int kClassNameOffset = kInstanceTemplateOffset + kPointerSize; | 10561 static const int kClassNameOffset = kInstanceTemplateOffset + kPointerSize; |
10562 static const int kSignatureOffset = kClassNameOffset + kPointerSize; | 10562 static const int kSignatureOffset = kClassNameOffset + kPointerSize; |
10563 static const int kInstanceCallHandlerOffset = kSignatureOffset + kPointerSize; | 10563 static const int kInstanceCallHandlerOffset = kSignatureOffset + kPointerSize; |
10564 static const int kAccessCheckInfoOffset = | 10564 static const int kAccessCheckInfoOffset = |
10565 kInstanceCallHandlerOffset + kPointerSize; | 10565 kInstanceCallHandlerOffset + kPointerSize; |
10566 static const int kFlagOffset = kAccessCheckInfoOffset + kPointerSize; | 10566 static const int kSharedFunctionInfoOffset = |
| 10567 kAccessCheckInfoOffset + kPointerSize; |
| 10568 static const int kFlagOffset = kSharedFunctionInfoOffset + kPointerSize; |
10567 static const int kLengthOffset = kFlagOffset + kPointerSize; | 10569 static const int kLengthOffset = kFlagOffset + kPointerSize; |
10568 static const int kSize = kLengthOffset + kPointerSize; | 10570 static const int kSize = kLengthOffset + kPointerSize; |
10569 | 10571 |
| 10572 static Handle<SharedFunctionInfo> GetOrCreateSharedFunctionInfo( |
| 10573 Isolate* isolate, Handle<FunctionTemplateInfo> info); |
10570 // Returns true if |object| is an instance of this function template. | 10574 // Returns true if |object| is an instance of this function template. |
10571 inline bool IsTemplateFor(JSObject* object); | 10575 inline bool IsTemplateFor(JSObject* object); |
10572 bool IsTemplateFor(Map* map); | 10576 bool IsTemplateFor(Map* map); |
| 10577 inline bool instantiated(); |
10573 | 10578 |
10574 private: | 10579 private: |
10575 // Bit position in the flag, from least significant bit position. | 10580 // Bit position in the flag, from least significant bit position. |
10576 static const int kHiddenPrototypeBit = 0; | 10581 static const int kHiddenPrototypeBit = 0; |
10577 static const int kUndetectableBit = 1; | 10582 static const int kUndetectableBit = 1; |
10578 static const int kNeedsAccessCheckBit = 2; | 10583 static const int kNeedsAccessCheckBit = 2; |
10579 static const int kReadOnlyPrototypeBit = 3; | 10584 static const int kReadOnlyPrototypeBit = 3; |
10580 static const int kRemovePrototypeBit = 4; | 10585 static const int kRemovePrototypeBit = 4; |
10581 static const int kDoNotCacheBit = 5; | 10586 static const int kDoNotCacheBit = 5; |
10582 static const int kInstantiatedBit = 6; | 10587 static const int kAcceptAnyReceiver = 6; |
10583 static const int kAcceptAnyReceiver = 7; | |
10584 | 10588 |
10585 DISALLOW_IMPLICIT_CONSTRUCTORS(FunctionTemplateInfo); | 10589 DISALLOW_IMPLICIT_CONSTRUCTORS(FunctionTemplateInfo); |
10586 }; | 10590 }; |
10587 | 10591 |
10588 | 10592 |
10589 class ObjectTemplateInfo: public TemplateInfo { | 10593 class ObjectTemplateInfo: public TemplateInfo { |
10590 public: | 10594 public: |
10591 DECL_ACCESSORS(constructor, Object) | 10595 DECL_ACCESSORS(constructor, Object) |
10592 DECL_ACCESSORS(internal_field_count, Object) | 10596 DECL_ACCESSORS(internal_field_count, Object) |
10593 | 10597 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10826 } | 10830 } |
10827 return value; | 10831 return value; |
10828 } | 10832 } |
10829 }; | 10833 }; |
10830 | 10834 |
10831 | 10835 |
10832 } // NOLINT, false-positive due to second-order macros. | 10836 } // NOLINT, false-positive due to second-order macros. |
10833 } // NOLINT, false-positive due to second-order macros. | 10837 } // NOLINT, false-positive due to second-order macros. |
10834 | 10838 |
10835 #endif // V8_OBJECTS_H_ | 10839 #endif // V8_OBJECTS_H_ |
OLD | NEW |