Commit f91df1f2 authored by jochen's avatar jochen Committed by Commit bot

Re-enable on-heap typed array allocation

BUG=v8:3996
R=mstarzinger@chromium.org
LOG=y

Review URL: https://codereview.chromium.org/1166433004

Cr-Commit-Position: refs/heads/master@{#28722}
parent 75744da2
......@@ -9727,8 +9727,18 @@ HValue* HGraphBuilder::BuildAllocateEmptyArrayBuffer(HValue* byte_length) {
native_context, nullptr,
HObjectAccess::ForContextSlot(Context::ARRAY_BUFFER_MAP_INDEX)));
Add<HStoreNamedField>(result, HObjectAccess::ForJSArrayBufferBackingStore(),
Add<HConstant>(ExternalReference()));
HConstant* empty_fixed_array =
Add<HConstant>(isolate()->factory()->empty_fixed_array());
Add<HStoreNamedField>(
result, HObjectAccess::ForJSArrayOffset(JSArray::kPropertiesOffset),
empty_fixed_array);
Add<HStoreNamedField>(
result, HObjectAccess::ForJSArrayOffset(JSArray::kElementsOffset),
empty_fixed_array);
Add<HStoreNamedField>(
result, HObjectAccess::ForJSArrayBufferBackingStore().WithRepresentation(
Representation::Smi()),
graph()->GetConstant0());
Add<HStoreNamedField>(result, HObjectAccess::ForJSArrayBufferByteLength(),
byte_length);
Add<HStoreNamedField>(result, HObjectAccess::ForJSArrayBufferBitFieldSlot(),
......@@ -9935,7 +9945,7 @@ void HOptimizedGraphBuilder::GenerateTypedArrayInitialize(
CHECK_ALIVE(VisitForValue(arguments->at(kObjectArg)));
HValue* obj = Pop();
if (arguments->at(kArrayIdArg)->IsLiteral()) {
if (!arguments->at(kArrayIdArg)->IsLiteral()) {
// This should never happen in real use, but can happen when fuzzing.
// Just bail out.
Bailout(kNeedSmiLiteral);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment