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

Unified Diff: src/code-stub-assembler.cc

Issue 1904933002: Introduce bytecodes for assisting generator suspend and resume. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index f30edf221deb5057eb75f2cc5de42309cb733e4a..7c64fca58b1913c4d2e83a97554bb69a44328dd3 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 +

Powered by Google App Engine
This is Rietveld 408576698