| 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 | |
| 96 // PropertyDetails captures type and attributes for a property. | 76 // PropertyDetails captures type and attributes for a property. |
| 97 // They are used both in property dictionaries and instance descriptors. | 77 // They are used both in property dictionaries and instance descriptors. |
| 98 class PropertyDetails BASE_EMBEDDED { | 78 class PropertyDetails BASE_EMBEDDED { |
| 99 public: | 79 public: |
| 100 PropertyDetails(PropertyAttributes attributes, | 80 PropertyDetails(PropertyAttributes attributes, |
| 101 PropertyType type, | 81 PropertyType type, |
| 102 int index = 0) { | 82 int index = 0) { |
| 103 ASSERT(TypeField::is_valid(type)); | 83 ASSERT(TypeField::is_valid(type)); |
| 104 ASSERT(AttributesField::is_valid(attributes)); | 84 ASSERT(AttributesField::is_valid(attributes)); |
| 105 ASSERT(StorageField::is_valid(index)); | 85 ASSERT(StorageField::is_valid(index)); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 123 |
| 144 static const int kInitialIndex = 1; | 124 static const int kInitialIndex = 1; |
| 145 | 125 |
| 146 private: | 126 private: |
| 147 uint32_t value_; | 127 uint32_t value_; |
| 148 }; | 128 }; |
| 149 | 129 |
| 150 } } // namespace v8::internal | 130 } } // namespace v8::internal |
| 151 | 131 |
| 152 #endif // V8_PROPERTY_DETAILS_H_ | 132 #endif // V8_PROPERTY_DETAILS_H_ |
| OLD | NEW |