OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 ELEMENTS_TRANSITION = 7, | 66 ELEMENTS_TRANSITION = 7, |
67 CONSTANT_TRANSITION = 8, // only in fast mode | 67 CONSTANT_TRANSITION = 8, // only in fast mode |
68 NULL_DESCRIPTOR = 9, // only in fast mode | 68 NULL_DESCRIPTOR = 9, // only in fast mode |
69 // There are no IC stubs for NULL_DESCRIPTORS. Therefore, | 69 // There are no IC stubs for NULL_DESCRIPTORS. Therefore, |
70 // NULL_DESCRIPTOR can be used as the type flag for IC stubs for | 70 // NULL_DESCRIPTOR can be used as the type flag for IC stubs for |
71 // nonexistent properties. | 71 // nonexistent properties. |
72 NONEXISTENT = NULL_DESCRIPTOR | 72 NONEXISTENT = NULL_DESCRIPTOR |
73 }; | 73 }; |
74 | 74 |
75 | 75 |
| 76 inline bool IsRealProperty(PropertyType type) { |
| 77 switch (type) { |
| 78 case NORMAL: |
| 79 case FIELD: |
| 80 case CONSTANT_FUNCTION: |
| 81 case CALLBACKS: |
| 82 case HANDLER: |
| 83 case INTERCEPTOR: |
| 84 return true; |
| 85 case MAP_TRANSITION: |
| 86 case ELEMENTS_TRANSITION: |
| 87 case CONSTANT_TRANSITION: |
| 88 case NULL_DESCRIPTOR: |
| 89 return false; |
| 90 } |
| 91 UNREACHABLE(); // keep the compiler happy |
| 92 return false; |
| 93 } |
| 94 |
| 95 |
76 // PropertyDetails captures type and attributes for a property. | 96 // PropertyDetails captures type and attributes for a property. |
77 // They are used both in property dictionaries and instance descriptors. | 97 // They are used both in property dictionaries and instance descriptors. |
78 class PropertyDetails BASE_EMBEDDED { | 98 class PropertyDetails BASE_EMBEDDED { |
79 public: | 99 public: |
80 PropertyDetails(PropertyAttributes attributes, | 100 PropertyDetails(PropertyAttributes attributes, |
81 PropertyType type, | 101 PropertyType type, |
82 int index = 0) { | 102 int index = 0) { |
83 ASSERT(TypeField::is_valid(type)); | 103 ASSERT(TypeField::is_valid(type)); |
84 ASSERT(AttributesField::is_valid(attributes)); | 104 ASSERT(AttributesField::is_valid(attributes)); |
85 ASSERT(StorageField::is_valid(index)); | 105 ASSERT(StorageField::is_valid(index)); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 143 |
124 static const int kInitialIndex = 1; | 144 static const int kInitialIndex = 1; |
125 | 145 |
126 private: | 146 private: |
127 uint32_t value_; | 147 uint32_t value_; |
128 }; | 148 }; |
129 | 149 |
130 } } // namespace v8::internal | 150 } } // namespace v8::internal |
131 | 151 |
132 #endif // V8_PROPERTY_DETAILS_H_ | 152 #endif // V8_PROPERTY_DETAILS_H_ |
OLD | NEW |