| Index: src/property.h
|
| diff --git a/src/property.h b/src/property.h
|
| index f64f9df849f0ef5af68824c4a4ebe96edb4e3830..21bc2fcb9c3d62c4ace6277888f890c1f82761e6 100644
|
| --- a/src/property.h
|
| +++ b/src/property.h
|
| @@ -119,7 +119,6 @@ class LookupResult V8_FINAL BASE_EMBEDDED {
|
| lookup_type_(NOT_FOUND),
|
| holder_(NULL),
|
| transition_(NULL),
|
| - cacheable_(true),
|
| details_(NONE, NORMAL, Representation::None()) {
|
| isolate->set_top_lookup_result(this);
|
| }
|
| @@ -139,30 +138,6 @@ class LookupResult V8_FINAL BASE_EMBEDDED {
|
| number_ = number;
|
| }
|
|
|
| - bool CanHoldValue(Handle<Object> value) const {
|
| - switch (type()) {
|
| - case NORMAL:
|
| - return true;
|
| - case FIELD:
|
| - return value->FitsRepresentation(representation()) &&
|
| - GetFieldType()->NowContains(value);
|
| - case CONSTANT: {
|
| - Map* map =
|
| - lookup_type_ == DESCRIPTOR_TYPE ? holder_->map() : transition_;
|
| - Object* constant = GetConstantFromMap(map);
|
| - DCHECK(constant != *value ||
|
| - value->FitsRepresentation(representation()));
|
| - return constant == *value;
|
| - }
|
| - case CALLBACKS:
|
| - case HANDLER:
|
| - case INTERCEPTOR:
|
| - return true;
|
| - }
|
| - UNREACHABLE();
|
| - return true;
|
| - }
|
| -
|
| void TransitionResult(JSObject* holder, Map* target) {
|
| lookup_type_ = TRANSITION_TYPE;
|
| number_ = target->LastAdded();
|
| @@ -171,29 +146,6 @@ class LookupResult V8_FINAL BASE_EMBEDDED {
|
| transition_ = target;
|
| }
|
|
|
| - void DictionaryResult(JSObject* holder, int entry) {
|
| - lookup_type_ = DICTIONARY_TYPE;
|
| - holder_ = holder;
|
| - transition_ = NULL;
|
| - details_ = holder->property_dictionary()->DetailsAt(entry);
|
| - number_ = entry;
|
| - }
|
| -
|
| - void HandlerResult(JSProxy* proxy) {
|
| - lookup_type_ = HANDLER_TYPE;
|
| - holder_ = proxy;
|
| - transition_ = NULL;
|
| - details_ = PropertyDetails(NONE, HANDLER, Representation::Tagged());
|
| - cacheable_ = false;
|
| - }
|
| -
|
| - void InterceptorResult(JSObject* holder) {
|
| - lookup_type_ = INTERCEPTOR_TYPE;
|
| - holder_ = holder;
|
| - transition_ = NULL;
|
| - details_ = PropertyDetails(NONE, INTERCEPTOR, Representation::Tagged());
|
| - }
|
| -
|
| void NotFound() {
|
| lookup_type_ = NOT_FOUND;
|
| details_ = PropertyDetails(NONE, NORMAL, Representation::None());
|
| @@ -201,40 +153,11 @@ class LookupResult V8_FINAL BASE_EMBEDDED {
|
| transition_ = NULL;
|
| }
|
|
|
| - JSObject* holder() const {
|
| - DCHECK(IsFound());
|
| - return JSObject::cast(holder_);
|
| - }
|
| -
|
| - JSProxy* proxy() const {
|
| - DCHECK(IsHandler());
|
| - return JSProxy::cast(holder_);
|
| - }
|
| -
|
| - PropertyType type() const {
|
| - DCHECK(IsFound());
|
| - return details_.type();
|
| - }
|
| -
|
| Representation representation() const {
|
| DCHECK(IsFound());
|
| return details_.representation();
|
| }
|
|
|
| - PropertyAttributes GetAttributes() const {
|
| - DCHECK(IsFound());
|
| - return details_.attributes();
|
| - }
|
| -
|
| - PropertyDetails GetPropertyDetails() const {
|
| - return details_;
|
| - }
|
| -
|
| - bool IsFastPropertyType() const {
|
| - DCHECK(IsFound());
|
| - return IsTransition() || type() != NORMAL;
|
| - }
|
| -
|
| // Property callbacks does not include transitions to callbacks.
|
| bool IsPropertyCallbacks() const {
|
| DCHECK(!(details_.type() == CALLBACKS && !IsFound()));
|
| @@ -248,36 +171,23 @@ class LookupResult V8_FINAL BASE_EMBEDDED {
|
|
|
| bool IsField() const {
|
| DCHECK(!(details_.type() == FIELD && !IsFound()));
|
| - return IsDescriptorOrDictionary() && type() == FIELD;
|
| - }
|
| -
|
| - bool IsNormal() const {
|
| - return IsFound() && IsDescriptorOrDictionary() && type() == NORMAL;
|
| + return lookup_type_ == DESCRIPTOR_TYPE && details_.type() == FIELD;
|
| }
|
|
|
| bool IsConstant() const {
|
| DCHECK(!(details_.type() == CONSTANT && !IsFound()));
|
| - return IsDescriptorOrDictionary() && type() == CONSTANT;
|
| + return lookup_type_ == DESCRIPTOR_TYPE && details_.type() == CONSTANT;
|
| }
|
|
|
| bool IsConfigurable() const { return details_.IsConfigurable(); }
|
| - bool IsDontEnum() const { return details_.IsDontEnum(); }
|
| bool IsFound() const { return lookup_type_ != NOT_FOUND; }
|
| - bool IsDescriptorOrDictionary() const {
|
| - return lookup_type_ == DESCRIPTOR_TYPE || lookup_type_ == DICTIONARY_TYPE;
|
| - }
|
| bool IsTransition() const { return lookup_type_ == TRANSITION_TYPE; }
|
| - bool IsHandler() const { return lookup_type_ == HANDLER_TYPE; }
|
| - bool IsInterceptor() const { return lookup_type_ == INTERCEPTOR_TYPE; }
|
|
|
| // Is the result is a property excluding transitions and the null descriptor?
|
| bool IsProperty() const {
|
| return IsFound() && !IsTransition();
|
| }
|
|
|
| - bool IsCacheable() const { return cacheable_; }
|
| - void DisallowCaching() { cacheable_ = false; }
|
| -
|
| Map* GetTransitionTarget() const {
|
| DCHECK(IsTransition());
|
| return transition_;
|
| @@ -287,32 +197,12 @@ class LookupResult V8_FINAL BASE_EMBEDDED {
|
| return IsTransition() && details_.type() == FIELD;
|
| }
|
|
|
| - bool IsTransitionToConstant() const {
|
| - return IsTransition() && details_.type() == CONSTANT;
|
| - }
|
| -
|
| - int GetDescriptorIndex() const {
|
| - DCHECK(lookup_type_ == DESCRIPTOR_TYPE);
|
| - return number_;
|
| - }
|
| -
|
| - FieldIndex GetFieldIndex() const {
|
| - DCHECK(lookup_type_ == DESCRIPTOR_TYPE ||
|
| - lookup_type_ == TRANSITION_TYPE);
|
| - return FieldIndex::ForLookupResult(this);
|
| - }
|
| -
|
| int GetLocalFieldIndexFromMap(Map* map) const {
|
| return GetFieldIndexFromMap(map) - map->inobject_properties();
|
| }
|
|
|
| - int GetDictionaryEntry() const {
|
| - DCHECK(lookup_type_ == DICTIONARY_TYPE);
|
| - return number_;
|
| - }
|
| -
|
| Object* GetConstantFromMap(Map* map) const {
|
| - DCHECK(type() == CONSTANT);
|
| + DCHECK(details_.type() == CONSTANT);
|
| return GetValueFromMap(map);
|
| }
|
|
|
| @@ -330,26 +220,12 @@ class LookupResult V8_FINAL BASE_EMBEDDED {
|
| return map->instance_descriptors()->GetFieldIndex(number_);
|
| }
|
|
|
| - HeapType* GetFieldType() const {
|
| - DCHECK(type() == FIELD);
|
| - if (lookup_type_ == DESCRIPTOR_TYPE) {
|
| - return GetFieldTypeFromMap(holder()->map());
|
| - }
|
| - DCHECK(lookup_type_ == TRANSITION_TYPE);
|
| - return GetFieldTypeFromMap(transition_);
|
| - }
|
| -
|
| HeapType* GetFieldTypeFromMap(Map* map) const {
|
| - DCHECK(lookup_type_ == DESCRIPTOR_TYPE ||
|
| - lookup_type_ == TRANSITION_TYPE);
|
| + DCHECK_NE(NOT_FOUND, lookup_type_);
|
| DCHECK(number_ < map->NumberOfOwnDescriptors());
|
| return map->instance_descriptors()->GetFieldType(number_);
|
| }
|
|
|
| - Map* GetFieldOwner() const {
|
| - return GetFieldOwnerFromMap(holder()->map());
|
| - }
|
| -
|
| Map* GetFieldOwnerFromMap(Map* map) const {
|
| DCHECK(lookup_type_ == DESCRIPTOR_TYPE ||
|
| lookup_type_ == TRANSITION_TYPE);
|
| @@ -357,12 +233,6 @@ class LookupResult V8_FINAL BASE_EMBEDDED {
|
| return map->FindFieldOwner(number_);
|
| }
|
|
|
| - bool ReceiverIsHolder(Handle<Object> receiver) {
|
| - if (*receiver == holder()) return true;
|
| - if (lookup_type_ == TRANSITION_TYPE) return true;
|
| - return false;
|
| - }
|
| -
|
| void Iterate(ObjectVisitor* visitor);
|
|
|
| private:
|
| @@ -370,19 +240,11 @@ class LookupResult V8_FINAL BASE_EMBEDDED {
|
| LookupResult* next_;
|
|
|
| // Where did we find the result;
|
| - enum {
|
| - NOT_FOUND,
|
| - DESCRIPTOR_TYPE,
|
| - TRANSITION_TYPE,
|
| - DICTIONARY_TYPE,
|
| - HANDLER_TYPE,
|
| - INTERCEPTOR_TYPE
|
| - } lookup_type_;
|
| + enum { NOT_FOUND, DESCRIPTOR_TYPE, TRANSITION_TYPE } lookup_type_;
|
|
|
| JSReceiver* holder_;
|
| Map* transition_;
|
| int number_;
|
| - bool cacheable_;
|
| PropertyDetails details_;
|
| };
|
|
|
|
|