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

Unified Diff: src/hydrogen.cc

Issue 23484060: Optimize typed-array length loading. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix bug Created 7 years, 3 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
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 824a3cd9dbf850cfa6e25ec255b81d9301d6d573..b5cebbe327e10f9612bfd8cdee581ed7fc80b0d2 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -4630,6 +4630,13 @@ bool HOptimizedGraphBuilder::PropertyAccessInfo::CanLoadAsMonomorphic(
return true;
}
+ if (IsTypedArrayLength()) {
+ for (int i = 1; i < types->length(); ++i) {
+ if (types->at(i)->instance_type() != JS_TYPED_ARRAY_TYPE) return false;
+ }
+ return true;
+ }
+
for (int i = 1; i < types->length(); ++i) {
PropertyAccessInfo test_info(isolate(), types->at(i), name_);
if (!test_info.IsCompatibleForLoad(this)) return false;
@@ -4657,6 +4664,11 @@ HInstruction* HOptimizedGraphBuilder::BuildLoadMonomorphic(
info->map()->elements_kind()));
}
+ if (info->IsTypedArrayLength()) {
+ return New<HLoadNamedField>(
+ checked_object, HObjectAccess::ForTypedArrayLength());
+ }
+
HValue* checked_holder = checked_object;
if (info->has_holder()) {
Handle<JSObject> prototype(JSObject::cast(info->map()->prototype()));
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698