Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 840abea86c1b5c6495207956d612717a3cced8be..1d9e1f5e69e5fca477f718b8eb6fde4439ac1e22 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -1131,7 +1131,7 @@ HValue* HGraphBuilder::BuildCheckForCapacityGrow(HValue* object, |
length_checker.IfCompare(length, key, Token::EQ); |
length_checker.Then(); |
- HValue* current_capacity = Add<HFixedArrayBaseLength>(elements); |
+ HValue* current_capacity = AddLoadFixedArrayLength(elements); |
IfBuilder capacity_checker(this); |
@@ -1187,7 +1187,7 @@ HValue* HGraphBuilder::BuildCopyElementsOnWrite(HValue* object, |
Handle<Map>(heap->fixed_cow_array_map())); |
cow_checker.Then(); |
- HValue* capacity = Add<HFixedArrayBaseLength>(elements); |
+ HValue* capacity = AddLoadFixedArrayLength(elements); |
HValue* new_elements = BuildGrowElementsCapacity(object, elements, |
kind, length, capacity); |
@@ -1242,10 +1242,10 @@ HInstruction* HGraphBuilder::BuildUncheckedMonomorphicElementAccess( |
if (is_js_array) { |
length = AddLoad(object, HObjectAccess::ForArrayLength(), mapcheck, |
Representation::Smi()); |
- length->set_type(HType::Smi()); |
} else { |
- length = Add<HFixedArrayBaseLength>(elements); |
+ length = AddLoadFixedArrayLength(elements); |
} |
+ length->set_type(HType::Smi()); |
Massi
2013/07/02 10:48:26
AddLoadFixedArrayLength already sets the type to S
|
HValue* checked_key = NULL; |
if (IsExternalArrayElementsKind(elements_kind)) { |
if (store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS) { |
@@ -1415,6 +1415,14 @@ HLoadNamedField* HGraphBuilder::AddLoadElements(HValue* object, |
} |
+HLoadNamedField* HGraphBuilder::AddLoadFixedArrayLength(HValue* object) { |
+ HLoadNamedField* instr = AddLoad(object, HObjectAccess::ForFixedArrayLength(), |
+ NULL, Representation::Smi()); |
+ instr->set_type(HType::Smi()); |
+ return instr; |
+} |
+ |
+ |
HValue* HGraphBuilder::BuildNewElementsCapacity(HValue* context, |
HValue* old_capacity) { |
Zone* zone = this->zone(); |
@@ -7030,7 +7038,7 @@ HValue* HOptimizedGraphBuilder::HandlePolymorphicElementAccess( |
LAST_ELEMENTS_KIND); |
if (elements_kind == FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND |
&& todo_external_array) { |
- HInstruction* length = Add<HFixedArrayBaseLength>(elements); |
+ HInstruction* length = AddLoadFixedArrayLength(elements); |
checked_key = Add<HBoundsCheck>(key, length); |
external_elements = Add<HLoadExternalArrayPointer>(elements); |
} |
@@ -7090,7 +7098,7 @@ HValue* HOptimizedGraphBuilder::HandlePolymorphicElementAccess( |
if_jsarray->GotoNoSimulate(join); |
set_current_block(if_fastobject); |
- length = AddInstruction(new(zone()) HFixedArrayBaseLength(elements)); |
+ length = AddLoadFixedArrayLength(elements); |
checked_key = Add<HBoundsCheck>(key, length); |
access = AddInstruction(BuildFastElementAccess( |
elements, checked_key, val, elements_kind_branch, |