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

Unified Diff: src/hydrogen.cc

Issue 1248483007: Store offset between fixed typed array base and data start in object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 5 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/heap/heap.cc ('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 9cc27cade24ca991f7cccab7636bde204dce61eb..48d19995070f02b7067a0bbbfc30271e8c098577 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -2458,7 +2458,14 @@ HInstruction* HGraphBuilder::BuildUncheckedMonomorphicElementAccess(
backing_store = Add<HLoadNamedField>(
elements, nullptr, HObjectAccess::ForExternalArrayExternalPointer());
} else {
- backing_store = elements;
+ HValue* external_pointer = Add<HLoadNamedField>(
+ elements, nullptr,
+ HObjectAccess::ForFixedTypedArrayBaseExternalPointer());
+ HValue* base_pointer = Add<HLoadNamedField>(
+ elements, nullptr,
+ HObjectAccess::ForFixedTypedArrayBaseBasePointer());
+ backing_store = AddUncasted<HAdd>(external_pointer, base_pointer,
+ Strength::WEAK, AddOfExternalAndTagged);
}
if (store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS) {
NoObservableSideEffectsScope no_effects(this);
@@ -10019,15 +10026,23 @@ HValue* HOptimizedGraphBuilder::BuildAllocateFixedTypedArray(
Add<HStoreNamedField>(
elements, HObjectAccess::ForFixedTypedArrayBaseBasePointer(), elements);
+ Add<HStoreNamedField>(
+ elements, HObjectAccess::ForFixedTypedArrayBaseExternalPointer(),
+ Add<HConstant>(ExternalReference::fixed_typed_array_base_data_offset()));
+
HValue* filler = Add<HConstant>(static_cast<int32_t>(0));
if (initialize) {
LoopBuilder builder(this, context(), LoopBuilder::kPostIncrement);
+ HValue* backing_store = AddUncasted<HAdd>(
+ Add<HConstant>(ExternalReference::fixed_typed_array_base_data_offset()),
+ elements, Strength::WEAK, AddOfExternalAndTagged);
+
HValue* key = builder.BeginBody(
Add<HConstant>(static_cast<int32_t>(0)),
length, Token::LT);
- Add<HStoreKeyed>(elements, key, filler, fixed_elements_kind);
+ Add<HStoreKeyed>(backing_store, key, filler, fixed_elements_kind);
builder.EndBody();
}
« no previous file with comments | « src/heap/heap.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698