Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(897)

Unified Diff: src/property-details.h

Issue 8506004: Made PropertyType handling even more explicit. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/property-details.h
diff --git a/src/property-details.h b/src/property-details.h
index 9df99880846d6df101827163fe738abce670679d..135c2ca01321fb67fbadba602f7f47b6b6fb792e 100644
--- a/src/property-details.h
+++ b/src/property-details.h
@@ -61,12 +61,11 @@ enum PropertyType {
CALLBACKS = 3,
HANDLER = 4, // only in lookup results, not in descriptors
INTERCEPTOR = 5, // only in lookup results, not in descriptors
+ // All properties before MAP_TRANSITION are real.
MAP_TRANSITION = 6, // only in fast mode
ELEMENTS_TRANSITION = 7,
CONSTANT_TRANSITION = 8, // only in fast mode
NULL_DESCRIPTOR = 9, // only in fast mode
- // All properties before MAP_TRANSITION are real.
- FIRST_PHANTOM_PROPERTY_TYPE = MAP_TRANSITION,
// There are no IC stubs for NULL_DESCRIPTORS. Therefore,
// NULL_DESCRIPTOR can be used as the type flag for IC stubs for
// nonexistent properties.
@@ -94,6 +93,26 @@ inline bool IsTransitionType(PropertyType type) {
}
+inline bool IsRealProperty(PropertyType type) {
+ switch (type) {
+ case NORMAL:
+ case FIELD:
+ case CONSTANT_FUNCTION:
+ case CALLBACKS:
+ case HANDLER:
+ case INTERCEPTOR:
+ return true;
+ case MAP_TRANSITION:
+ case ELEMENTS_TRANSITION:
+ case CONSTANT_TRANSITION:
+ case NULL_DESCRIPTOR:
+ return false;
+ }
+ UNREACHABLE(); // keep the compiler happy
+ return false;
+}
+
+
// PropertyDetails captures type and attributes for a property.
// They are used both in property dictionaries and instance descriptors.
class PropertyDetails BASE_EMBEDDED {
@@ -127,7 +146,7 @@ class PropertyDetails BASE_EMBEDDED {
}
bool IsProperty() {
- return type() < FIRST_PHANTOM_PROPERTY_TYPE;
+ return IsRealProperty(type());
}
PropertyAttributes attributes() { return AttributesField::decode(value_); }
« src/profile-generator.cc ('K') | « src/property.h ('k') | src/string-stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698