Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index c2305d7bbfeb0bfcd4374651856da0109ce28bd4..7f718a0a87f49504e492d4ceebcf1ca0836374c6 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -1165,8 +1165,8 @@ HInstruction* HGraphBuilder::BuildUncheckedMonomorphicElementAccess( |
} |
HInstruction* length = NULL; |
if (is_js_array) { |
- length = AddInstruction(new(zone) HJSArrayLength(object, mapcheck, |
- HType::Smi())); |
+ length = AddInstruction( |
+ HLoadNamedField::NewArrayLength(zone, object, mapcheck, HType::Smi())); |
} else { |
length = AddInstruction(new(zone) HFixedArrayBaseLength(elements)); |
} |
@@ -1235,13 +1235,6 @@ HInstruction* HGraphBuilder::BuildUncheckedMonomorphicElementAccess( |
} |
-HInstruction* HGraphBuilder::BuildFastArrayLengthLoad(HValue* object, |
- HValue* typecheck) { |
- Zone* zone = this->zone(); |
- return new (zone) HJSArrayLength(object, typecheck, HType::Smi()); |
-} |
- |
- |
HValue* HGraphBuilder::BuildAllocateElements(HValue* context, |
ElementsKind kind, |
HValue* capacity) { |
@@ -6425,7 +6418,8 @@ bool HOptimizedGraphBuilder::HandlePolymorphicArrayLengthLoad( |
AddInstruction(new(zone()) HCheckNonSmi(object)); |
HInstruction* typecheck = |
AddInstruction(HCheckInstanceType::NewIsJSArray(object, zone())); |
- HInstruction* instr = BuildFastArrayLengthLoad(object, typecheck); |
+ HInstruction* instr = |
+ HLoadNamedField::NewArrayLength(zone(), object, typecheck); |
instr->set_position(expr->position()); |
ast_context()->ReturnInstruction(instr, expr->id()); |
return true; |
@@ -7084,7 +7078,7 @@ HInstruction* HOptimizedGraphBuilder::BuildLoadNamedMonomorphic( |
if (name->Equals(isolate()->heap()->length_string())) { |
if (map->instance_type() == JS_ARRAY_TYPE) { |
AddCheckMapsWithTransitions(object, map); |
- return BuildFastArrayLengthLoad(object, NULL); |
+ return HLoadNamedField::NewArrayLength(zone(), object, object); |
} |
} |
@@ -7377,8 +7371,9 @@ HValue* HOptimizedGraphBuilder::HandlePolymorphicElementAccess( |
set_current_block(if_jsarray); |
HInstruction* length; |
- length = AddInstruction(new(zone()) HJSArrayLength(object, typecheck, |
- HType::Smi())); |
+ length = AddInstruction( |
+ HLoadNamedField::NewArrayLength(zone(), object, typecheck, |
+ HType::Smi())); |
checked_key = AddBoundsCheck(key, length, ALLOW_SMI_KEY); |
access = AddInstruction(BuildFastElementAccess( |
elements, checked_key, val, elements_kind_branch, |