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_PROPERTY_DETAILS_H_ | 5 #ifndef V8_PROPERTY_DETAILS_H_ |
6 #define V8_PROPERTY_DETAILS_H_ | 6 #define V8_PROPERTY_DETAILS_H_ |
7 | 7 |
8 #include "include/v8.h" | 8 #include "include/v8.h" |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/utils.h" | 10 #include "src/utils.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 SEALED = DONT_DELETE, | 24 SEALED = DONT_DELETE, |
25 FROZEN = SEALED | READ_ONLY, | 25 FROZEN = SEALED | READ_ONLY, |
26 | 26 |
27 ABSENT = 64, // Used in runtime to indicate a property is absent. | 27 ABSENT = 64, // Used in runtime to indicate a property is absent. |
28 // ABSENT can never be stored in or returned from a descriptor's attributes | 28 // ABSENT can never be stored in or returned from a descriptor's attributes |
29 // bitfield. It is only used as a return value meaning the attributes of | 29 // bitfield. It is only used as a return value meaning the attributes of |
30 // a non-existent property. | 30 // a non-existent property. |
31 }; | 31 }; |
32 | 32 |
33 | |
34 enum PropertyFilter { | 33 enum PropertyFilter { |
35 ALL_PROPERTIES = 0, | 34 ALL_PROPERTIES = 0, |
36 ONLY_WRITABLE = 1, | 35 ONLY_WRITABLE = 1, |
37 ONLY_ENUMERABLE = 2, | 36 ONLY_ENUMERABLE = 2, |
38 ONLY_CONFIGURABLE = 4, | 37 ONLY_CONFIGURABLE = 4, |
39 SKIP_STRINGS = 8, | 38 SKIP_STRINGS = 8, |
40 SKIP_SYMBOLS = 16, | 39 SKIP_SYMBOLS = 16, |
41 ONLY_ALL_CAN_READ = 32, | 40 ONLY_ALL_CAN_READ = 32, |
| 41 USE_ACCESS_CHECK_INTERCEPTOR = 64, |
42 ENUMERABLE_STRINGS = ONLY_ENUMERABLE | SKIP_SYMBOLS, | 42 ENUMERABLE_STRINGS = ONLY_ENUMERABLE | SKIP_SYMBOLS, |
43 }; | 43 }; |
44 // Enable fast comparisons of PropertyAttributes against PropertyFilters. | 44 // Enable fast comparisons of PropertyAttributes against PropertyFilters. |
45 STATIC_ASSERT(ALL_PROPERTIES == static_cast<PropertyFilter>(NONE)); | 45 STATIC_ASSERT(ALL_PROPERTIES == static_cast<PropertyFilter>(NONE)); |
46 STATIC_ASSERT(ONLY_WRITABLE == static_cast<PropertyFilter>(READ_ONLY)); | 46 STATIC_ASSERT(ONLY_WRITABLE == static_cast<PropertyFilter>(READ_ONLY)); |
47 STATIC_ASSERT(ONLY_ENUMERABLE == static_cast<PropertyFilter>(DONT_ENUM)); | 47 STATIC_ASSERT(ONLY_ENUMERABLE == static_cast<PropertyFilter>(DONT_ENUM)); |
48 STATIC_ASSERT(ONLY_CONFIGURABLE == static_cast<PropertyFilter>(DONT_DELETE)); | 48 STATIC_ASSERT(ONLY_CONFIGURABLE == static_cast<PropertyFilter>(DONT_DELETE)); |
49 STATIC_ASSERT(((SKIP_STRINGS | SKIP_SYMBOLS | ONLY_ALL_CAN_READ) & | 49 STATIC_ASSERT(((SKIP_STRINGS | SKIP_SYMBOLS | ONLY_ALL_CAN_READ | |
| 50 USE_ACCESS_CHECK_INTERCEPTOR) & |
50 ALL_ATTRIBUTES_MASK) == 0); | 51 ALL_ATTRIBUTES_MASK) == 0); |
51 STATIC_ASSERT(ALL_PROPERTIES == | 52 STATIC_ASSERT(ALL_PROPERTIES == |
52 static_cast<PropertyFilter>(v8::PropertyFilter::ALL_PROPERTIES)); | 53 static_cast<PropertyFilter>(v8::PropertyFilter::ALL_PROPERTIES)); |
53 STATIC_ASSERT(ONLY_WRITABLE == | 54 STATIC_ASSERT(ONLY_WRITABLE == |
54 static_cast<PropertyFilter>(v8::PropertyFilter::ONLY_WRITABLE)); | 55 static_cast<PropertyFilter>(v8::PropertyFilter::ONLY_WRITABLE)); |
55 STATIC_ASSERT(ONLY_ENUMERABLE == | 56 STATIC_ASSERT(ONLY_ENUMERABLE == |
56 static_cast<PropertyFilter>(v8::PropertyFilter::ONLY_ENUMERABLE)); | 57 static_cast<PropertyFilter>(v8::PropertyFilter::ONLY_ENUMERABLE)); |
57 STATIC_ASSERT(ONLY_CONFIGURABLE == static_cast<PropertyFilter>( | 58 STATIC_ASSERT(ONLY_CONFIGURABLE == static_cast<PropertyFilter>( |
58 v8::PropertyFilter::ONLY_CONFIGURABLE)); | 59 v8::PropertyFilter::ONLY_CONFIGURABLE)); |
59 STATIC_ASSERT(SKIP_STRINGS == | 60 STATIC_ASSERT(SKIP_STRINGS == |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 }; | 395 }; |
395 | 396 |
396 | 397 |
397 std::ostream& operator<<(std::ostream& os, | 398 std::ostream& operator<<(std::ostream& os, |
398 const PropertyAttributes& attributes); | 399 const PropertyAttributes& attributes); |
399 std::ostream& operator<<(std::ostream& os, const PropertyDetails& details); | 400 std::ostream& operator<<(std::ostream& os, const PropertyDetails& details); |
400 } // namespace internal | 401 } // namespace internal |
401 } // namespace v8 | 402 } // namespace v8 |
402 | 403 |
403 #endif // V8_PROPERTY_DETAILS_H_ | 404 #endif // V8_PROPERTY_DETAILS_H_ |
OLD | NEW |