Commit 1b730686 authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

Replace BuildFastElementAccess() with AddFastElementAccess().

This is trivial cleanup. All calls to BuildFastElementAccess() pass
the result to AddInstruction().

R=svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15789 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent fe83bc36
......@@ -1104,40 +1104,6 @@ HInstruction* HGraphBuilder::BuildExternalArrayElementAccess(
}
HInstruction* HGraphBuilder::BuildFastElementAccess(
HValue* elements,
HValue* checked_key,
HValue* val,
HValue* load_dependency,
ElementsKind elements_kind,
bool is_store,
LoadKeyedHoleMode load_mode,
KeyedAccessStoreMode store_mode) {
Zone* zone = this->zone();
if (is_store) {
ASSERT(val != NULL);
switch (elements_kind) {
case FAST_SMI_ELEMENTS:
case FAST_HOLEY_SMI_ELEMENTS:
case FAST_ELEMENTS:
case FAST_HOLEY_ELEMENTS:
case FAST_DOUBLE_ELEMENTS:
case FAST_HOLEY_DOUBLE_ELEMENTS:
return new(zone) HStoreKeyed(elements, checked_key, val, elements_kind);
default:
UNREACHABLE();
return NULL;
}
}
// It's an element load (!is_store).
return new(zone) HLoadKeyed(elements,
checked_key,
load_dependency,
elements_kind,
load_mode);
}
HValue* HGraphBuilder::BuildCheckForCapacityGrow(HValue* object,
HValue* elements,
ElementsKind kind,
......@@ -1371,9 +1337,8 @@ HInstruction* HGraphBuilder::BuildUncheckedMonomorphicElementAccess(
}
}
}
return AddInstruction(
BuildFastElementAccess(elements, checked_key, val, mapcheck,
elements_kind, is_store, load_mode, store_mode));
return AddFastElementAccess(elements, checked_key, val, mapcheck,
elements_kind, is_store, load_mode, store_mode);
}
......@@ -1470,6 +1435,36 @@ HInnerAllocatedObject* HGraphBuilder::BuildJSArrayHeader(HValue* array,
}
HInstruction* HGraphBuilder::AddFastElementAccess(
HValue* elements,
HValue* checked_key,
HValue* val,
HValue* load_dependency,
ElementsKind elements_kind,
bool is_store,
LoadKeyedHoleMode load_mode,
KeyedAccessStoreMode store_mode) {
if (is_store) {
ASSERT(val != NULL);
switch (elements_kind) {
case FAST_SMI_ELEMENTS:
case FAST_HOLEY_SMI_ELEMENTS:
case FAST_ELEMENTS:
case FAST_HOLEY_ELEMENTS:
case FAST_DOUBLE_ELEMENTS:
case FAST_HOLEY_DOUBLE_ELEMENTS:
return Add<HStoreKeyed>(elements, checked_key, val, elements_kind);
default:
UNREACHABLE();
return NULL;
}
}
// It's an element load (!is_store).
return Add<HLoadKeyed>(
elements, checked_key, load_dependency, elements_kind, load_mode);
}
HLoadNamedField* HGraphBuilder::AddLoadElements(HValue* object,
HValue* typecheck) {
return AddLoad(object, HObjectAccess::ForElementsPointer(), typecheck);
......@@ -5711,9 +5706,9 @@ HValue* HOptimizedGraphBuilder::HandlePolymorphicElementAccess(
HInstruction* length = AddLoadFixedArrayLength(elements);
checked_key = Add<HBoundsCheck>(key, length);
}
access = AddInstruction(BuildFastElementAccess(
access = AddFastElementAccess(
elements, checked_key, val, mapcompare,
elements_kind, is_store, NEVER_RETURN_HOLE, STANDARD_STORE));
elements_kind, is_store, NEVER_RETURN_HOLE, STANDARD_STORE);
} else if (IsDictionaryElementsKind(elements_kind)) {
if (is_store) {
access = AddInstruction(BuildStoreKeyedGeneric(object, key, val));
......
......@@ -1054,16 +1054,6 @@ class HGraphBuilder {
ElementsKind elements_kind,
bool is_store);
HInstruction* BuildFastElementAccess(
HValue* elements,
HValue* checked_key,
HValue* val,
HValue* dependency,
ElementsKind elements_kind,
bool is_store,
LoadKeyedHoleMode load_mode,
KeyedAccessStoreMode store_mode);
HValue* BuildCheckForCapacityGrow(HValue* object,
HValue* elements,
ElementsKind kind,
......@@ -1104,6 +1094,16 @@ class HGraphBuilder {
HObjectAccess access,
Representation representation);
HInstruction* AddFastElementAccess(
HValue* elements,
HValue* checked_key,
HValue* val,
HValue* dependency,
ElementsKind elements_kind,
bool is_store,
LoadKeyedHoleMode load_mode,
KeyedAccessStoreMode store_mode);
HStoreNamedField* AddStore(
HValue *object,
HObjectAccess 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