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 #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/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 10488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10499 DECL_ACCESSORS(name, Object) | 10499 DECL_ACCESSORS(name, Object) |
10500 DECL_ACCESSORS(flag, Smi) | 10500 DECL_ACCESSORS(flag, Smi) |
10501 DECL_ACCESSORS(expected_receiver_type, Object) | 10501 DECL_ACCESSORS(expected_receiver_type, Object) |
10502 | 10502 |
10503 inline bool all_can_read(); | 10503 inline bool all_can_read(); |
10504 inline void set_all_can_read(bool value); | 10504 inline void set_all_can_read(bool value); |
10505 | 10505 |
10506 inline bool all_can_write(); | 10506 inline bool all_can_write(); |
10507 inline void set_all_can_write(bool value); | 10507 inline void set_all_can_write(bool value); |
10508 | 10508 |
10509 inline bool is_special_data_property(); | |
10510 inline void set_is_special_data_property(bool value); | |
10511 | |
10512 inline PropertyAttributes property_attributes(); | 10509 inline PropertyAttributes property_attributes(); |
10513 inline void set_property_attributes(PropertyAttributes attributes); | 10510 inline void set_property_attributes(PropertyAttributes attributes); |
10514 | 10511 |
10515 // Checks whether the given receiver is compatible with this accessor. | 10512 // Checks whether the given receiver is compatible with this accessor. |
10516 static bool IsCompatibleReceiverMap(Isolate* isolate, | 10513 static bool IsCompatibleReceiverMap(Isolate* isolate, |
10517 Handle<AccessorInfo> info, | 10514 Handle<AccessorInfo> info, |
10518 Handle<Map> map); | 10515 Handle<Map> map); |
10519 inline bool IsCompatibleReceiver(Object* receiver); | 10516 inline bool IsCompatibleReceiver(Object* receiver); |
10520 | 10517 |
10521 DECLARE_CAST(AccessorInfo) | 10518 DECLARE_CAST(AccessorInfo) |
(...skipping 12 matching lines...) Expand all Loading... |
10534 static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize; | 10531 static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize; |
10535 static const int kSize = kExpectedReceiverTypeOffset + kPointerSize; | 10532 static const int kSize = kExpectedReceiverTypeOffset + kPointerSize; |
10536 | 10533 |
10537 private: | 10534 private: |
10538 inline bool HasExpectedReceiverType() { | 10535 inline bool HasExpectedReceiverType() { |
10539 return expected_receiver_type()->IsFunctionTemplateInfo(); | 10536 return expected_receiver_type()->IsFunctionTemplateInfo(); |
10540 } | 10537 } |
10541 // Bit positions in flag. | 10538 // Bit positions in flag. |
10542 static const int kAllCanReadBit = 0; | 10539 static const int kAllCanReadBit = 0; |
10543 static const int kAllCanWriteBit = 1; | 10540 static const int kAllCanWriteBit = 1; |
10544 static const int kSpecialDataProperty = 2; | 10541 class AttributesField: public BitField<PropertyAttributes, 2, 3> {}; |
10545 class AttributesField : public BitField<PropertyAttributes, 3, 3> {}; | |
10546 | 10542 |
10547 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorInfo); | 10543 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorInfo); |
10548 }; | 10544 }; |
10549 | 10545 |
10550 | 10546 |
10551 // An accessor must have a getter, but can have no setter. | 10547 // An accessor must have a getter, but can have no setter. |
10552 // | 10548 // |
10553 // When setting a property, V8 searches accessors in prototypes. | 10549 // When setting a property, V8 searches accessors in prototypes. |
10554 // If an accessor was found and it does not have a setter, | 10550 // If an accessor was found and it does not have a setter, |
10555 // the request is ignored. | 10551 // the request is ignored. |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11105 } else { | 11101 } else { |
11106 value &= ~(1 << bit_position); | 11102 value &= ~(1 << bit_position); |
11107 } | 11103 } |
11108 return value; | 11104 return value; |
11109 } | 11105 } |
11110 }; | 11106 }; |
11111 | 11107 |
11112 } } // namespace v8::internal | 11108 } } // namespace v8::internal |
11113 | 11109 |
11114 #endif // V8_OBJECTS_H_ | 11110 #endif // V8_OBJECTS_H_ |
OLD | NEW |