From 1b73068626ce2fe4872acc67d5bd4a79102a6e05 Mon Sep 17 00:00:00 2001 From: "bmeurer@chromium.org" Date: Mon, 22 Jul 2013 07:00:46 +0000 Subject: [PATCH] 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 --- src/hydrogen.cc | 73 +++++++++++++++++++++++++++------------------------------ src/hydrogen.h | 20 ++++++++-------- 2 files changed, 44 insertions(+), 49 deletions(-) diff --git a/src/hydrogen.cc b/src/hydrogen.cc index 789bd14..2cae332 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -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(elements, checked_key, val, elements_kind); + default: + UNREACHABLE(); + return NULL; + } + } + // It's an element load (!is_store). + return Add( + 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(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)); diff --git a/src/hydrogen.h b/src/hydrogen.h index 99e4f9c..a9fcf4a 100644 --- a/src/hydrogen.h +++ b/src/hydrogen.h @@ -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, -- 2.7.4