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

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: Nix 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
« no previous file with comments | « src/code-stub-assembler.h ('k') | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « src/code-stub-assembler.h ('k') | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698