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

Unified Diff: src/builtins/builtins-promise.cc

Issue 2556483002: [promises] allow allocation in large object space (Closed)
Patch Set: use var Created 4 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-promise.cc
diff --git a/src/builtins/builtins-promise.cc b/src/builtins/builtins-promise.cc
index 70f8c056ab7e3f865a60d87d71e57ed794ca4b2d..e2888c3e1b403788e768362cd4e53d1948794778 100644
--- a/src/builtins/builtins-promise.cc
+++ b/src/builtins/builtins-promise.cc
@@ -378,14 +378,19 @@ void AppendPromiseCallback(CodeStubAssembler* a, int offset,
Node* delta = a->IntPtrOrSmiConstant(1, mode);
Node* new_capacity = a->IntPtrAdd(length, delta);
- ElementsKind kind = FAST_ELEMENTS;
- Node* new_elements = a->AllocateFixedArray(kind, new_capacity, mode);
+ const ElementsKind kind = FAST_ELEMENTS;
+ const WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER;
+ const CodeStubAssembler::AllocationFlags flags =
+ CodeStubAssembler::kAllowLargeObjectAllocation;
+ int additional_offset = 0;
- a->CopyFixedArrayElements(kind, elements, new_elements, length,
- UPDATE_WRITE_BARRIER, mode);
- a->StoreFixedArrayElement(new_elements, length, value, UPDATE_WRITE_BARRIER,
- 0, mode);
+ Node* new_elements = a->AllocateFixedArray(kind, new_capacity, mode, flags);
+
+ a->CopyFixedArrayElements(kind, elements, new_elements, length, barrier_mode,
+ mode);
+ a->StoreFixedArrayElement(new_elements, length, value, barrier_mode,
+ additional_offset, mode);
a->StoreObjectField(promise, offset, new_elements);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698