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

Unified Diff: src/hydrogen-instructions.cc

Issue 15014020: Elide hole checks on KeyedLoads of holey double arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Implement missing platforms and add tests Created 7 years, 7 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-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 8f8c59ea8c0f713a476a3e9061a2fd56debb29fc..a7ef23ce9bca170138a8418e3ab9fafa39bc4c37 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -2681,7 +2681,12 @@ bool HLoadKeyed::UsesMustHandleHole() const {
return false;
}
- if (hole_mode() == ALLOW_RETURN_HOLE) return true;
+ if (hole_mode() == ALLOW_RETURN_HOLE) {
+ if (IsFastDoubleElementsKind(elements_kind())) {
+ return AllUsesCanTreatHoleAsNaN();
+ }
+ return true;
+ }
if (IsFastDoubleElementsKind(elements_kind())) {
return false;
@@ -2698,6 +2703,22 @@ bool HLoadKeyed::UsesMustHandleHole() const {
}
+bool HLoadKeyed::AllUsesCanTreatHoleAsNaN() const {
+ if (!IsFastDoubleElementsKind(elements_kind())) {
+ return false;
+ }
+
+ for (HUseIterator it(uses()); !it.Done(); it.Advance()) {
+ HValue* use = it.value();
+ if (use->CheckFlag(HValue::kDeoptimizeOnUndefined)) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+
bool HLoadKeyed::RequiresHoleCheck() const {
if (IsFastPackedElementsKind(elements_kind())) {
return false;
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | src/isolate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698