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 "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
10 #include "src/builtins.h" | 10 #include "src/builtins.h" |
(...skipping 10508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10519 inline bool all_can_read(); | 10519 inline bool all_can_read(); |
10520 inline void set_all_can_read(bool value); | 10520 inline void set_all_can_read(bool value); |
10521 | 10521 |
10522 inline bool all_can_write(); | 10522 inline bool all_can_write(); |
10523 inline void set_all_can_write(bool value); | 10523 inline void set_all_can_write(bool value); |
10524 | 10524 |
10525 inline PropertyAttributes property_attributes(); | 10525 inline PropertyAttributes property_attributes(); |
10526 inline void set_property_attributes(PropertyAttributes attributes); | 10526 inline void set_property_attributes(PropertyAttributes attributes); |
10527 | 10527 |
10528 // Checks whether the given receiver is compatible with this accessor. | 10528 // Checks whether the given receiver is compatible with this accessor. |
| 10529 static bool IsCompatibleReceiverType(Isolate* isolate, |
| 10530 Handle<AccessorInfo> info, |
| 10531 Handle<HeapType> type); |
10529 inline bool IsCompatibleReceiver(Object* receiver); | 10532 inline bool IsCompatibleReceiver(Object* receiver); |
10530 | 10533 |
10531 DECLARE_CAST(AccessorInfo) | 10534 DECLARE_CAST(AccessorInfo) |
10532 | 10535 |
10533 // Dispatched behavior. | 10536 // Dispatched behavior. |
10534 DECLARE_VERIFIER(AccessorInfo) | 10537 DECLARE_VERIFIER(AccessorInfo) |
10535 | 10538 |
10536 // Append all descriptors to the array that are not already there. | 10539 // Append all descriptors to the array that are not already there. |
10537 // Return number added. | 10540 // Return number added. |
10538 static int AppendUnique(Handle<Object> descriptors, | 10541 static int AppendUnique(Handle<Object> descriptors, |
10539 Handle<FixedArray> array, | 10542 Handle<FixedArray> array, |
10540 int valid_descriptors); | 10543 int valid_descriptors); |
10541 | 10544 |
10542 static const int kNameOffset = HeapObject::kHeaderSize; | 10545 static const int kNameOffset = HeapObject::kHeaderSize; |
10543 static const int kFlagOffset = kNameOffset + kPointerSize; | 10546 static const int kFlagOffset = kNameOffset + kPointerSize; |
10544 static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize; | 10547 static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize; |
10545 static const int kSize = kExpectedReceiverTypeOffset + kPointerSize; | 10548 static const int kSize = kExpectedReceiverTypeOffset + kPointerSize; |
10546 | 10549 |
10547 private: | 10550 private: |
| 10551 inline bool HasExpectedReceiverType() { |
| 10552 return expected_receiver_type()->IsFunctionTemplateInfo(); |
| 10553 } |
10548 // Bit positions in flag. | 10554 // Bit positions in flag. |
10549 static const int kAllCanReadBit = 0; | 10555 static const int kAllCanReadBit = 0; |
10550 static const int kAllCanWriteBit = 1; | 10556 static const int kAllCanWriteBit = 1; |
10551 class AttributesField: public BitField<PropertyAttributes, 2, 3> {}; | 10557 class AttributesField: public BitField<PropertyAttributes, 2, 3> {}; |
10552 | 10558 |
10553 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorInfo); | 10559 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorInfo); |
10554 }; | 10560 }; |
10555 | 10561 |
10556 | 10562 |
10557 enum AccessorDescriptorType { | 10563 enum AccessorDescriptorType { |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11209 } else { | 11215 } else { |
11210 value &= ~(1 << bit_position); | 11216 value &= ~(1 << bit_position); |
11211 } | 11217 } |
11212 return value; | 11218 return value; |
11213 } | 11219 } |
11214 }; | 11220 }; |
11215 | 11221 |
11216 } } // namespace v8::internal | 11222 } } // namespace v8::internal |
11217 | 11223 |
11218 #endif // V8_OBJECTS_H_ | 11224 #endif // V8_OBJECTS_H_ |
OLD | NEW |