Commit d2d3fc0e authored by verwaest@chromium.org's avatar verwaest@chromium.org

Use PropertyAccessType for keyed accesses rather than "bool is_store"

BUG=
R=ishell@chromium.org

Review URL: https://codereview.chromium.org/137883008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19221 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 23bfeabc
......@@ -552,7 +552,7 @@ HValue* CodeStubGraphBuilder<KeyedLoadFastElementStub>::BuildCodeStub() {
HInstruction* load = BuildUncheckedMonomorphicElementAccess(
GetParameter(0), GetParameter(1), NULL,
casted_stub()->is_js_array(), casted_stub()->elements_kind(),
false, NEVER_RETURN_HOLE, STANDARD_STORE);
LOAD, NEVER_RETURN_HOLE, STANDARD_STORE);
return load;
}
......@@ -599,7 +599,7 @@ HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() {
BuildUncheckedMonomorphicElementAccess(
GetParameter(0), GetParameter(1), GetParameter(2),
casted_stub()->is_js_array(), casted_stub()->elements_kind(),
true, NEVER_RETURN_HOLE, casted_stub()->store_mode());
STORE, NEVER_RETURN_HOLE, casted_stub()->store_mode());
return GetParameter(2);
}
......@@ -1096,7 +1096,7 @@ HValue* CodeStubGraphBuilder<ElementsTransitionAndStoreStub>::BuildCodeStub() {
BuildUncheckedMonomorphicElementAccess(object, key, value,
casted_stub()->is_jsarray(),
casted_stub()->to_kind(),
true, ALLOW_RETURN_HOLE,
STORE, ALLOW_RETURN_HOLE,
casted_stub()->store_mode());
}
......
......@@ -4390,9 +4390,9 @@ HObjectAccess HObjectAccess::ForCellPayload(Isolate* isolate) {
}
void HObjectAccess::SetGVNFlags(HValue *instr, bool is_store) {
void HObjectAccess::SetGVNFlags(HValue *instr, PropertyAccessType access_type) {
// set the appropriate GVN flags for a given load or store instruction
if (is_store) {
if (access_type == STORE) {
// track dominating allocations in order to eliminate write barriers
instr->SetGVNFlag(kDependsOnNewSpacePromotion);
instr->SetFlag(HValue::kTrackSideEffectDominators);
......@@ -4404,35 +4404,35 @@ void HObjectAccess::SetGVNFlags(HValue *instr, bool is_store) {
switch (portion()) {
case kArrayLengths:
instr->SetGVNFlag(is_store
instr->SetGVNFlag(access_type == STORE
? kChangesArrayLengths : kDependsOnArrayLengths);
break;
case kStringLengths:
instr->SetGVNFlag(is_store
instr->SetGVNFlag(access_type == STORE
? kChangesStringLengths : kDependsOnStringLengths);
break;
case kInobject:
instr->SetGVNFlag(is_store
instr->SetGVNFlag(access_type == STORE
? kChangesInobjectFields : kDependsOnInobjectFields);
break;
case kDouble:
instr->SetGVNFlag(is_store
instr->SetGVNFlag(access_type == STORE
? kChangesDoubleFields : kDependsOnDoubleFields);
break;
case kBackingStore:
instr->SetGVNFlag(is_store
instr->SetGVNFlag(access_type == STORE
? kChangesBackingStoreFields : kDependsOnBackingStoreFields);
break;
case kElementsPointer:
instr->SetGVNFlag(is_store
instr->SetGVNFlag(access_type == STORE
? kChangesElementsPointer : kDependsOnElementsPointer);
break;
case kMaps:
instr->SetGVNFlag(is_store
instr->SetGVNFlag(access_type == STORE
? kChangesMaps : kDependsOnMaps);
break;
case kExternalMemory:
instr->SetGVNFlag(is_store
instr->SetGVNFlag(access_type == STORE
? kChangesExternalMemory : kDependsOnExternalMemory);
break;
}
......
......@@ -224,6 +224,9 @@ class LChunkBuilder;
}
enum PropertyAccessType { LOAD, STORE };
class Range V8_FINAL : public ZoneObject {
public:
Range()
......@@ -5972,7 +5975,7 @@ class HObjectAccess V8_FINAL {
}
protected:
void SetGVNFlags(HValue *instr, bool is_store);
void SetGVNFlags(HValue *instr, PropertyAccessType access_type);
private:
// internal use only; different parts of an object or array
......@@ -6096,7 +6099,7 @@ class HLoadNamedField V8_FINAL : public HTemplateInstruction<2> {
} else {
set_representation(Representation::Tagged());
}
access.SetGVNFlags(this, false);
access.SetGVNFlags(this, LOAD);
}
virtual bool IsDeletable() const V8_OVERRIDE { return true; }
......@@ -6531,7 +6534,7 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> {
SetOperandAt(0, obj);
SetOperandAt(1, val);
SetOperandAt(2, obj);
access.SetGVNFlags(this, true);
access.SetGVNFlags(this, STORE);
}
HObjectAccess access_;
......
This diff is collapsed.
......@@ -1294,7 +1294,7 @@ class HGraphBuilder {
HValue* length,
HValue* key,
bool is_js_array,
bool is_store);
PropertyAccessType access_type);
HValue* BuildCopyElementsOnWrite(HValue* object,
HValue* elements,
......@@ -1351,7 +1351,7 @@ class HGraphBuilder {
HValue* val,
bool is_js_array,
ElementsKind elements_kind,
bool is_store,
PropertyAccessType access_type,
LoadKeyedHoleMode load_mode,
KeyedAccessStoreMode store_mode);
......@@ -1361,7 +1361,7 @@ class HGraphBuilder {
HValue* val,
HValue* dependency,
ElementsKind elements_kind,
bool is_store,
PropertyAccessType access_type,
LoadKeyedHoleMode load_mode = NEVER_RETURN_HOLE);
HLoadNamedField* BuildLoadNamedField(HValue* object, HObjectAccess access);
......@@ -2187,8 +2187,6 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
Type* ToType(Handle<Map> map) { return IC::MapToType<Type>(map, zone()); }
private:
enum PropertyAccessType { LOAD, STORE };
// Helpers for flow graph construction.
enum GlobalPropertyAccess {
kUseCell,
......@@ -2196,7 +2194,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
};
GlobalPropertyAccess LookupGlobalProperty(Variable* var,
LookupResult* lookup,
bool is_store);
PropertyAccessType access_type);
void EnsureArgumentsArePushedForAccess();
bool TryArgumentsAccess(Property* expr);
......@@ -2456,14 +2454,14 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
HValue* val,
HValue* dependency,
Handle<Map> map,
bool is_store,
PropertyAccessType access_type,
KeyedAccessStoreMode store_mode);
HValue* HandlePolymorphicElementAccess(HValue* object,
HValue* key,
HValue* val,
SmallMapList* maps,
bool is_store,
PropertyAccessType access_type,
KeyedAccessStoreMode store_mode,
bool* has_side_effects);
......@@ -2471,7 +2469,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
HValue* key,
HValue* val,
Expression* expr,
bool is_store,
PropertyAccessType access_type,
bool* has_side_effects);
HInstruction* BuildNamedGeneric(PropertyAccessType access,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment