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

Unified Diff: src/property.h

Issue 14146005: Track representations of fields (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Make double support consistent. Now DOUBLE always contains smi or heapnumber Created 7 years, 8 months 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.h
diff --git a/src/property.h b/src/property.h
index bbba8aea60d89f432c3ca4eb52b86726e56baf07..1e68c5f4102738c02588235887cde50199b561b3 100644
--- a/src/property.h
+++ b/src/property.h
@@ -65,11 +65,17 @@ class Descriptor BASE_EMBEDDED {
#endif
void SetEnumerationIndex(int index) {
+ StorageType storage = details_.storage_type();
details_ = PropertyDetails(details_.attributes(), details_.type(), index);
+ details_ = details_.set_storage_type(storage);
}
void SetSortedKeyIndex(int index) { details_ = details_.set_pointer(index); }
+ void SetStorageType(StorageType storage) {
+ details_ = details_.set_storage_type(storage);
+ }
+
private:
Name* key_;
Object* value_;
@@ -208,6 +214,10 @@ class LookupResult BASE_EMBEDDED {
number_ = number;
}
+ bool CanStore(Handle<Object> value) {
+ return value->FitsStorage(details_.storage_type());
+ }
+
void TransitionResult(JSObject* holder, int number) {
lookup_type_ = TRANSITION_TYPE;
details_ = PropertyDetails(NONE, TRANSITION);
@@ -256,6 +266,11 @@ class LookupResult BASE_EMBEDDED {
return details_.type();
}
+ StorageType storage_type() {
+ ASSERT(IsFound());
+ return details_.storage_type();
+ }
+
PropertyAttributes GetAttributes() {
ASSERT(!IsTransition());
ASSERT(IsFound());
« src/objects.cc ('K') | « src/objects-inl.h ('k') | src/property-details.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698