Index: src/hydrogen.h |
diff --git a/src/hydrogen.h b/src/hydrogen.h |
index 69753d78fb32437af44ec213f7a36330e17b5bff..7eb2c84f024eb5efa79696eb43513a05cf45f60a 100644 |
--- a/src/hydrogen.h |
+++ b/src/hydrogen.h |
@@ -2264,13 +2264,16 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { |
void VisitDataViewInitialize(CallRuntime* expr); |
+ enum PropertyAccessType { LOAD, STORE }; |
class PropertyAccessInfo { |
public: |
PropertyAccessInfo(HOptimizedGraphBuilder* builder, |
+ PropertyAccessType access_type, |
Type* type, |
Handle<String> name) |
: lookup_(builder->isolate()), |
builder_(builder), |
+ access_type_(access_type), |
type_(type), |
name_(name), |
access_(HObjectAccess::ForMap()) { } |
@@ -2278,7 +2281,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { |
// Checkes whether this PropertyAccessInfo can be handled as a monomorphic |
// load named. It additionally fills in the fields necessary to generate the |
// lookup code. |
- bool CanLoadMonomorphic(); |
+ bool CanAccessMonomorphic(); |
// Checks whether all types behave uniform when loading name. If all maps |
// behave the same, a single monomorphic load instruction can be emitted, |
@@ -2286,7 +2289,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { |
// an instance of any of the types. |
// This method skips the first type in types, assuming that this |
// PropertyAccessInfo is built for types->first(). |
- bool CanLoadAsMonomorphic(SmallMapList* types); |
+ bool CanAccessAsMonomorphic(SmallMapList* types); |
Handle<Map> map() { |
if (type_->Is(Type::Number())) { |
@@ -2337,6 +2340,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { |
Handle<JSObject> holder() { return holder_; } |
Handle<JSFunction> accessor() { return accessor_; } |
Handle<Object> constant() { return constant_; } |
+ Handle<Object> transition() { return transition_; } |
HObjectAccess access() { return access_; } |
private: |
@@ -2352,7 +2356,8 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { |
bool LoadResult(Handle<Map> map); |
bool LookupDescriptor(); |
bool LookupInPrototypes(); |
- bool IsCompatibleForLoad(PropertyAccessInfo* other); |
+ bool IsCompatible(PropertyAccessInfo* other); |
+ bool IsLoad() const { return access_type_ == LOAD; } |
void GeneralizeRepresentation(Representation r) { |
access_ = access_.WithRepresentation( |
@@ -2361,11 +2366,13 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { |
LookupResult lookup_; |
HOptimizedGraphBuilder* builder_; |
+ PropertyAccessType access_type_; |
Type* type_; |
Handle<String> name_; |
Handle<JSObject> holder_; |
Handle<JSFunction> accessor_; |
Handle<Object> constant_; |
+ Handle<Map> transition_; |
HObjectAccess access_; |
}; |
@@ -2376,12 +2383,15 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { |
BailoutId return_id, |
bool can_inline_accessor = true); |
+ HInstruction* BuildStoreMonomorphic(PropertyAccessInfo* info, |
+ HValue* checked_object, |
+ HValue* value, |
+ BailoutId ast_id, |
+ BailoutId return_id, |
+ bool can_inline_accessor = true); |
+ |
void HandlePolymorphicStoreNamedField(BailoutId assignment_id, |
- HValue* object, |
- HValue* value, |
- SmallMapList* types, |
- Handle<String> name); |
- bool TryStorePolymorphicAsMonomorphic(BailoutId assignment_id, |
+ BailoutId return_id, |
HValue* object, |
HValue* value, |
SmallMapList* types, |
@@ -2472,18 +2482,13 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { |
BailoutId return_id, |
bool is_uninitialized = false); |
- HInstruction* BuildStoreNamedField(HValue* object, |
- Handle<String> name, |
- HValue* value, |
- Handle<Map> map, |
- LookupResult* lookup); |
+ HInstruction* BuildStoreNamedField(PropertyAccessInfo* info, |
+ HValue* checked_object, |
+ HValue* value); |
HInstruction* BuildStoreNamedGeneric(HValue* object, |
Handle<String> name, |
- HValue* value); |
- HInstruction* BuildStoreNamedMonomorphic(HValue* object, |
- Handle<String> name, |
- HValue* value, |
- Handle<Map> map); |
+ HValue* value, |
+ bool is_uninitialized = false); |
HInstruction* BuildStoreKeyedGeneric(HValue* object, |
HValue* key, |
HValue* value); |