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

Unified Diff: src/hydrogen.cc

Issue 1107993002: Make it possible to hoist the neutering check for TA property accesses (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | no next file » | 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 756c6ee6d4b3e967190bd4db0bc8020f4bbd8651..2543fdc8d0c30529fc0be44fb3f91a5eea3b8df8 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -2465,19 +2465,21 @@ HInstruction* HGraphBuilder::BuildUncheckedMonomorphicElementAccess(
length_checker.End();
return result;
} else {
+ HValue* neuter_checked_object = checked_object;
if (IsExternalArrayElementsKind(elements_kind)) {
HInstruction* buffer =
Add<HLoadNamedField>(checked_object, nullptr,
HObjectAccess::ForJSArrayBufferViewBuffer());
HInstruction* buffer_length = Add<HLoadNamedField>(
buffer, nullptr, HObjectAccess::ForJSArrayBufferByteLength());
- Add<HBoundsCheck>(graph()->GetConstant0(), buffer_length);
+ neuter_checked_object =
+ Add<HBoundsCheck>(graph()->GetConstant0(), buffer_length);
}
DCHECK(store_mode == STANDARD_STORE);
checked_key = Add<HBoundsCheck>(key, length);
- return AddElementAccess(
- backing_store, checked_key, val,
- checked_object, elements_kind, access_type);
+ return AddElementAccess(backing_store, checked_key, val,
+ neuter_checked_object, elements_kind,
+ access_type);
}
}
DCHECK(fast_smi_only_elements ||
@@ -6310,8 +6312,16 @@ HValue* HOptimizedGraphBuilder::BuildMonomorphicAccess(
if (info->GetJSArrayBufferViewFieldAccess(&access)) {
DCHECK(info->IsLoad());
- return BuildArrayBufferViewFieldAccessor(
- object, checked_object, FieldIndex::ForInObjectOffset(access.offset()));
+ HValue* neuter_checked_object = checked_object;
+ if (IsExternalArrayElementsKind(info->map()->elements_kind())) {
+ HInstruction* buffer = Add<HLoadNamedField>(
+ checked_object, nullptr, HObjectAccess::ForJSArrayBufferViewBuffer());
+ HInstruction* buffer_length = Add<HLoadNamedField>(
+ buffer, nullptr, HObjectAccess::ForJSArrayBufferByteLength());
+ neuter_checked_object =
+ Add<HBoundsCheck>(graph()->GetConstant0(), buffer_length);
+ }
+ return New<HLoadNamedField>(object, neuter_checked_object, access);
}
if (info->name().is_identical_to(isolate()->factory()->prototype_string()) &&
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698