Chromium Code Reviews| Index: src/code-stub-assembler.h |
| diff --git a/src/code-stub-assembler.h b/src/code-stub-assembler.h |
| index 3e20e6fb32042c729a9f4b3285cfe9fc92183f9f..2b2c5cdc1b7dfae71279a5ccddc65da441460a75 100644 |
| --- a/src/code-stub-assembler.h |
| +++ b/src/code-stub-assembler.h |
| @@ -501,9 +501,23 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { |
| Node* object, Node* index, Node* value, |
| ParameterMode parameter_mode = INTPTR_PARAMETERS); |
| - Node* BuildAppendJSArray(ElementsKind kind, Node* context, Node* array, |
| + // EnsureArrayPushable verifies that receiver is: |
| + // 1. Is not a prototype. |
| + // 2. Is not a dictionary. |
| + // 3. Has a writeable length property. |
| + // It returns ElementsKind as a node for further division into cases. |
| + Node* EnsureArrayPushable(Node* receiver, Label* bailout); |
| + |
| + void TryStoreArrayElement(ElementsKind kind, ParameterMode mode, |
| + Label* bailout, Node* elements, Node* index, |
| + Node* value); |
| + // Consumes args into the array, and returns tagged new length. |
| + Node* BuildAppendJSArray(ElementsKind kind, Node* array, |
| CodeStubArguments& args, Variable& arg_index, |
| Label* bailout); |
| + // Pushes value onto the end of array. |
| + void BuildAppendJSArray(ElementsKind kind, Node* array, Node* value, |
| + Label* bailout); |
| void StoreFieldsNoWriteBarrier(Node* start_address, Node* end_address, |
| Node* value); |
| @@ -663,6 +677,15 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { |
| Node* capacity, Node* new_capacity, |
| ParameterMode mode, Label* bailout); |
| + // Given a need to grow by |growth|, allocate an appropriate new capacity |
| + // and return a new elements FixedArray object. Label |bailout| is |
| + // followed for allocation failure. Label |fits| is followed if current |
|
danno
2017/04/24 12:12:11
nit: There is no label |fits|?
mvstanton
2017/04/24 12:21:16
Ah! Outdated comment - I fixed the wording. Thanks
|
| + // capacity is sufficient. |
| + void PossiblyGrowElementsCapacity(ParameterMode mode, ElementsKind kind, |
| + Node* array, Node* length, |
| + Variable* var_elements, Node* growth, |
| + Label* bailout); |
| + |
| // Allocation site manipulation |
| void InitializeAllocationMemento(Node* base_allocation, |
| int base_allocation_size, |
| @@ -750,6 +773,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { |
| // ElementsKind helpers: |
| Node* IsFastElementsKind(Node* elements_kind); |
| Node* IsHoleyFastElementsKind(Node* elements_kind); |
| + Node* IsElementsKindGreaterThan(Node* target_kind, |
| + ElementsKind reference_kind); |
| // String helpers. |
| // Load a character from a String (might flatten a ConsString). |