Index: src/code-stub-assembler.cc |
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc |
index f30edf221deb5057eb75f2cc5de42309cb733e4a..09b5a42fcd688226acc079eeea53239de126c4d1 100644 |
--- a/src/code-stub-assembler.cc |
+++ b/src/code-stub-assembler.cc |
@@ -405,7 +405,7 @@ Node* CodeStubAssembler::AllocateRawAligned(Node* size_in_bytes, |
return address.value(); |
} |
-Node* CodeStubAssembler::Allocate(int size_in_bytes, AllocationFlags flags) { |
+Node* CodeStubAssembler::Allocate(Node* size_in_bytes, AllocationFlags flags) { |
bool const new_space = !(flags & kPretenured); |
Node* top_address = ExternalConstant( |
new_space |
@@ -418,13 +418,15 @@ Node* CodeStubAssembler::Allocate(int size_in_bytes, AllocationFlags flags) { |
#ifdef V8_HOST_ARCH_32_BIT |
if (flags & kDoubleAlignment) { |
- return AllocateRawAligned(IntPtrConstant(size_in_bytes), flags, top_address, |
- limit_address); |
+ return AllocateRawAligned(size_in_bytes, flags, top_address, limit_address); |
} |
#endif |
- return AllocateRawUnaligned(IntPtrConstant(size_in_bytes), flags, top_address, |
- limit_address); |
+ return AllocateRawUnaligned(size_in_bytes, flags, top_address, limit_address); |
+} |
+ |
+Node* CodeStubAssembler::Allocate(int size_in_bytes, AllocationFlags flags) { |
+ return CodeStubAssembler::Allocate(IntPtrConstant(size_in_bytes), flags); |
} |
Node* CodeStubAssembler::InnerAllocate(Node* previous, int offset) { |
@@ -491,6 +493,19 @@ Node* CodeStubAssembler::LoadNameHash(Node* name) { |
IntPtrConstant(Name::kHashFieldOffset - kHeapObjectTag)); |
} |
+Node* CodeStubAssembler::AllocateUninitializedFixedArray(Node* length) { |
+ Node* header_size = IntPtrConstant(FixedArray::kHeaderSize); |
+ Node* data_size = WordShl(length, IntPtrConstant(kPointerSizeLog2)); |
+ Node* total_size = IntPtrAdd(data_size, header_size); |
+ |
+ Node* result = Allocate(total_size, kNone); |
+ StoreMapNoWriteBarrier(result, LoadRoot(Heap::kFixedArrayMapRootIndex)); |
+ StoreObjectFieldNoWriteBarrier(result, FixedArray::kLengthOffset, |
+ SmiTag(length)); |
+ |
+ return result; |
+} |
+ |
Node* CodeStubAssembler::LoadFixedArrayElementInt32Index( |
Node* object, Node* index, int additional_offset) { |
Node* header_size = IntPtrConstant(additional_offset + |
@@ -536,6 +551,12 @@ Node* CodeStubAssembler::StoreHeapNumberValue(Node* object, Node* value) { |
IntPtrConstant(HeapNumber::kValueOffset - kHeapObjectTag), value); |
} |
+Node* CodeStubAssembler::StoreObjectField( |
+ Node* object, int offset, Node* value) { |
+ return Store(MachineRepresentation::kTagged, object, |
+ IntPtrConstant(offset - kHeapObjectTag), value); |
+} |
+ |
Node* CodeStubAssembler::StoreObjectFieldNoWriteBarrier( |
Node* object, int offset, Node* value, MachineRepresentation rep) { |
return StoreNoWriteBarrier(rep, object, |