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

Unified Diff: src/compiler/access-info.cc

Issue 1448903002: [turbofan] Initial support for keyed access to holey elements. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | src/compiler/js-native-context-specialization.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/access-info.cc
diff --git a/src/compiler/access-info.cc b/src/compiler/access-info.cc
index 9173811da5f512d7f1f2b4fcda083143ef1aabc6..2703e8cc83dcade5f0beeb45a70b5d5a661d431c 100644
--- a/src/compiler/access-info.cc
+++ b/src/compiler/access-info.cc
@@ -19,10 +19,13 @@ namespace compiler {
namespace {
bool CanInlineElementAccess(Handle<Map> map) {
- // TODO(bmeurer): Add support for holey elements.
- return map->IsJSObjectMap() &&
- IsFastPackedElementsKind(map->elements_kind()) &&
- !map->has_indexed_interceptor() && !map->is_access_check_needed();
+ if (!map->IsJSObjectMap()) return false;
+ if (map->is_access_check_needed()) return false;
+ if (map->has_indexed_interceptor()) return false;
+ ElementsKind const elements_kind = map->elements_kind();
+ if (IsFastElementsKind(elements_kind)) return true;
+ // TODO(bmeurer): Add support for other elements kind.
+ return false;
}
@@ -137,7 +140,12 @@ bool AccessInfoFactory::ComputeElementAccessInfo(
// Check if it is safe to inline element access for the {map}.
if (!CanInlineElementAccess(map)) return false;
- ElementsKind elements_kind = map->elements_kind();
+ ElementsKind const elements_kind = map->elements_kind();
+ if (access_mode == AccessMode::kLoad &&
+ elements_kind == FAST_HOLEY_DOUBLE_ELEMENTS) {
+ // TODO(bmeurer): Add support for holey loads.
+ return false;
+ }
// Certain (monomorphic) stores need a prototype chain check because shape
// changes could allow callbacks on elements in the chain that are not
« no previous file with comments | « no previous file | src/compiler/js-native-context-specialization.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698