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

Unified Diff: src/lookup.h

Issue 494153002: Avoid one repeated property lookup when computing store ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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
« src/ic.cc ('K') | « src/ic.cc ('k') | src/lookup.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lookup.h
diff --git a/src/lookup.h b/src/lookup.h
index e09eeeea244e74b18c81a80d01db51c3eb3300a7..76797425c41c3d91b7c450cf92bb932344d9cac6 100644
--- a/src/lookup.h
+++ b/src/lookup.h
@@ -37,6 +37,7 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {
JSPROXY,
NOT_FOUND,
PROPERTY,
+ TRANSITION,
// Set state_ to BEFORE_PROPERTY to ensure that the next lookup will be a
// PROPERTY lookup.
BEFORE_PROPERTY = INTERCEPTOR
@@ -114,7 +115,12 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {
Handle<Object> GetReceiver() const {
return maybe_receiver_.ToHandleChecked();
}
+ Handle<JSObject> GetPropertyTarget() const;
Toon Verwaest 2014/08/21 15:07:06 GetStoreTarget() ?
Jakob Kummerow 2014/08/21 16:14:53 Done.
Handle<Map> holder_map() const { return holder_map_; }
+ Handle<Map> transition_map() const {
+ DCHECK_EQ(TRANSITION, state_);
+ return transition_map_;
+ }
template <class T>
Handle<T> GetHolder() const {
DCHECK(IsFound());
@@ -132,10 +138,23 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {
// below can be used. It ensures that we are able to provide a definite
// answer, and loads extra information about the property.
bool HasProperty();
+ // has_property returns the cached result from the last HasProperty call.
+ bool has_property() const { return has_property_; }
Toon Verwaest 2014/08/21 15:07:06 This shouldn't be necessary
Jakob Kummerow 2014/08/21 16:14:53 Done.
void PrepareForDataProperty(Handle<Object> value);
- void TransitionToDataProperty(Handle<Object> value,
- PropertyAttributes attributes,
- Object::StoreFromKeyed store_mode);
+ void PrepareTransitionToDataProperty(Handle<Object> value,
+ PropertyAttributes attributes,
+ Object::StoreFromKeyed store_mode);
+ bool IsCacheableTransition() {
+ bool cacheable =
+ state_ == TRANSITION && transition_map()->GetBackPointer()->IsMap();
+ if (cacheable) {
+ property_details_ = transition_map_->GetLastDescriptorDetails();
+ LoadPropertyKind();
+ has_property_ = true;
+ }
+ return cacheable;
+ }
+ void ApplyTransitionToDataProperty();
void ReconfigureDataProperty(Handle<Object> value,
PropertyAttributes attributes);
void TransitionToAccessorProperty(AccessorComponent component,
@@ -159,6 +178,7 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {
return property_details().representation();
}
FieldIndex GetFieldIndex() const;
+ Handle<HeapType> GetFieldType() const;
int GetConstantIndex() const;
Handle<PropertyCell> GetPropertyCell() const;
Handle<Object> GetAccessors() const;
@@ -174,6 +194,7 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {
inline State LookupInHolder(Map* map);
Handle<Object> FetchValue() const;
void ReloadPropertyInformation();
+ void LoadPropertyKind();
bool IsBootstrapping() const;
@@ -227,6 +248,7 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {
Isolate* isolate_;
Handle<Name> name_;
Handle<Map> holder_map_;
+ Handle<Map> transition_map_;
MaybeHandle<Object> maybe_receiver_;
MaybeHandle<JSReceiver> maybe_holder_;
« src/ic.cc ('K') | « src/ic.cc ('k') | src/lookup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698