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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/builtins/builtins-utils.h" 5 #include "src/builtins/builtins-utils.h"
6 #include "src/builtins/builtins.h" 6 #include "src/builtins/builtins.h"
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stub-assembler.h" 8 #include "src/code-stub-assembler.h"
9 #include "src/promise-utils.h" 9 #include "src/promise-utils.h"
10 10
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 compiler::Node* promise, compiler::Node* value) { 371 compiler::Node* promise, compiler::Node* value) {
372 typedef compiler::Node Node; 372 typedef compiler::Node Node;
373 373
374 Node* elements = a->LoadObjectField(promise, offset); 374 Node* elements = a->LoadObjectField(promise, offset);
375 Node* length = a->LoadFixedArrayBaseLength(elements); 375 Node* length = a->LoadFixedArrayBaseLength(elements);
376 CodeStubAssembler::ParameterMode mode = a->OptimalParameterMode(); 376 CodeStubAssembler::ParameterMode mode = a->OptimalParameterMode();
377 length = a->UntagParameter(length, mode); 377 length = a->UntagParameter(length, mode);
378 378
379 Node* delta = a->IntPtrOrSmiConstant(1, mode); 379 Node* delta = a->IntPtrOrSmiConstant(1, mode);
380 Node* new_capacity = a->IntPtrAdd(length, delta); 380 Node* new_capacity = a->IntPtrAdd(length, delta);
381 ElementsKind kind = FAST_ELEMENTS;
382 381
383 Node* new_elements = a->AllocateFixedArray(kind, new_capacity, mode); 382 const ElementsKind kind = FAST_ELEMENTS;
383 const WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER;
384 const CodeStubAssembler::AllocationFlags flags =
385 CodeStubAssembler::kAllowLargeObjectAllocation;
386 int additional_offset = 0;
384 387
385 a->CopyFixedArrayElements(kind, elements, new_elements, length, 388 Node* new_elements = a->AllocateFixedArray(kind, new_capacity, mode, flags);
386 UPDATE_WRITE_BARRIER, mode); 389
387 a->StoreFixedArrayElement(new_elements, length, value, UPDATE_WRITE_BARRIER, 390 a->CopyFixedArrayElements(kind, elements, new_elements, length, barrier_mode,
388 0, mode); 391 mode);
392 a->StoreFixedArrayElement(new_elements, length, value, barrier_mode,
393 additional_offset, mode);
389 394
390 a->StoreObjectField(promise, offset, new_elements); 395 a->StoreObjectField(promise, offset, new_elements);
391 } 396 }
392 397
393 compiler::Node* InternalPerformPromiseThen(CodeStubAssembler* a, 398 compiler::Node* InternalPerformPromiseThen(CodeStubAssembler* a,
394 compiler::Node* context, 399 compiler::Node* context,
395 compiler::Node* promise, 400 compiler::Node* promise,
396 compiler::Node* on_resolve, 401 compiler::Node* on_resolve,
397 compiler::Node* on_reject, 402 compiler::Node* on_reject,
398 compiler::Node* deferred) { 403 compiler::Node* deferred) {
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 // 5. Return PerformPromiseThen(promise, onFulfilled, onRejected, 663 // 5. Return PerformPromiseThen(promise, onFulfilled, onRejected,
659 // resultCapability). 664 // resultCapability).
660 a.Bind(&perform_promise_then); 665 a.Bind(&perform_promise_then);
661 Node* const result = InternalPerformPromiseThen( 666 Node* const result = InternalPerformPromiseThen(
662 &a, context, promise, on_resolve, on_reject, var_deferred.value()); 667 &a, context, promise, on_resolve, on_reject, var_deferred.value());
663 a.Return(result); 668 a.Return(result);
664 } 669 }
665 670
666 } // namespace internal 671 } // namespace internal
667 } // namespace v8 672 } // namespace v8
OLDNEW
« 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