Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Unified Diff: src/hydrogen.cc

Issue 12491023: Remove (H|L)JSArrayLength instructions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CR feedback Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index c2305d7bbfeb0bfcd4374651856da0109ce28bd4..79ffd5254cb02614e0514b9fd567e47c176dac48 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));
danno 2013/04/02 11:10:43 I think you are losing the fact that the type of t
} else {
length = AddInstruction(new(zone) HFixedArrayBaseLength(elements));
}
@@ -1237,8 +1237,7 @@ HInstruction* HGraphBuilder::BuildUncheckedMonomorphicElementAccess(
HInstruction* HGraphBuilder::BuildFastArrayLengthLoad(HValue* object,
HValue* typecheck) {
- Zone* zone = this->zone();
- return new (zone) HJSArrayLength(object, typecheck, HType::Smi());
+ return HLoadNamedField::NewArrayLength(zone(), object, typecheck);
}
@@ -7377,8 +7376,8 @@ 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));
checked_key = AddBoundsCheck(key, length, ALLOW_SMI_KEY);
access = AddInstruction(BuildFastElementAccess(
elements, checked_key, val, elements_kind_branch,

Powered by Google App Engine
This is Rietveld 408576698