[cleanup] Adds some CSA types in typed array builtins

Bug: v8:7310
Change-Id: Ia14a5ce3d675be745c71ec3994f3ef58ba9e995b
Reviewed-on: https://chromium-review.googlesource.com/928764
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51435}
This commit is contained in:
Peter Marshall 2018-02-21 15:30:59 +01:00 committed by Commit Bot
parent ad74be52fa
commit c933b65d04

View File

@ -138,7 +138,7 @@ TF_BUILTIN(TypedArrayInitialize, TypedArrayBuiltinsAssembler) {
Label setup_holder(this), allocate_on_heap(this), aligned(this),
allocate_elements(this), allocate_off_heap(this),
allocate_off_heap_no_init(this), attach_buffer(this), done(this);
VARIABLE(var_total_size, MachineType::PointerRepresentation());
TVARIABLE(IntPtrT, var_total_size);
// SmiMul returns a heap number in case of Smi overflow.
TNode<Number> byte_length = SmiMul(length, element_size);
@ -201,17 +201,18 @@ TF_BUILTIN(TypedArrayInitialize, TypedArrayBuiltinsAssembler) {
// Fix alignment if needed.
DCHECK_EQ(0, FixedTypedArrayBase::kHeaderSize & kObjectAlignmentMask);
Node* aligned_header_size =
TNode<IntPtrT> aligned_header_size =
IntPtrConstant(FixedTypedArrayBase::kHeaderSize + kObjectAlignmentMask);
Node* size = IntPtrAdd(word_byte_length, aligned_header_size);
var_total_size.Bind(WordAnd(size, IntPtrConstant(~kObjectAlignmentMask)));
TNode<IntPtrT> size = IntPtrAdd(word_byte_length, aligned_header_size);
var_total_size = WordAnd(size, IntPtrConstant(~kObjectAlignmentMask));
Goto(&allocate_elements);
}
BIND(&aligned);
{
Node* header_size = IntPtrConstant(FixedTypedArrayBase::kHeaderSize);
var_total_size.Bind(IntPtrAdd(word_byte_length, header_size));
TNode<IntPtrT> header_size =
IntPtrConstant(FixedTypedArrayBase::kHeaderSize);
var_total_size = IntPtrAdd(word_byte_length, header_size);
Goto(&allocate_elements);
}