OLD | NEW |
---|---|
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 #ifndef V8_CODE_STUB_ASSEMBLER_H_ | 5 #ifndef V8_CODE_STUB_ASSEMBLER_H_ |
6 #define V8_CODE_STUB_ASSEMBLER_H_ | 6 #define V8_CODE_STUB_ASSEMBLER_H_ |
7 | 7 |
8 #include <functional> | 8 #include <functional> |
9 | 9 |
10 #include "src/compiler/code-assembler.h" | 10 #include "src/compiler/code-assembler.h" |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
494 Node* StoreFixedArrayElement( | 494 Node* StoreFixedArrayElement( |
495 Node* object, Node* index, Node* value, | 495 Node* object, Node* index, Node* value, |
496 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, | 496 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, |
497 int additional_offset = 0, | 497 int additional_offset = 0, |
498 ParameterMode parameter_mode = INTPTR_PARAMETERS); | 498 ParameterMode parameter_mode = INTPTR_PARAMETERS); |
499 | 499 |
500 Node* StoreFixedDoubleArrayElement( | 500 Node* StoreFixedDoubleArrayElement( |
501 Node* object, Node* index, Node* value, | 501 Node* object, Node* index, Node* value, |
502 ParameterMode parameter_mode = INTPTR_PARAMETERS); | 502 ParameterMode parameter_mode = INTPTR_PARAMETERS); |
503 | 503 |
504 Node* BuildAppendJSArray(ElementsKind kind, Node* context, Node* array, | 504 // EnsureArrayPushable verifies that receiver is: |
505 // 1. Is not a prototype. | |
506 // 2. Is not a dictionary. | |
507 // 3. Has a writeable length property. | |
508 // It returns ElementsKind as a node for further division into cases. | |
509 Node* EnsureArrayPushable(Node* receiver, Label* bailout); | |
510 | |
511 void TryStoreArrayElement(ElementsKind kind, ParameterMode mode, | |
512 Label* bailout, Node* elements, Node* index, | |
513 Node* value); | |
514 // Consumes args into the array, and returns tagged new length. | |
515 Node* BuildAppendJSArray(ElementsKind kind, Node* array, | |
505 CodeStubArguments& args, Variable& arg_index, | 516 CodeStubArguments& args, Variable& arg_index, |
506 Label* bailout); | 517 Label* bailout); |
518 // Pushes value onto the end of array. | |
519 void BuildAppendJSArray(ElementsKind kind, Node* array, Node* value, | |
520 Label* bailout); | |
507 | 521 |
508 void StoreFieldsNoWriteBarrier(Node* start_address, Node* end_address, | 522 void StoreFieldsNoWriteBarrier(Node* start_address, Node* end_address, |
509 Node* value); | 523 Node* value); |
510 | 524 |
511 // Allocate a HeapNumber without initializing its value. | 525 // Allocate a HeapNumber without initializing its value. |
512 Node* AllocateHeapNumber(MutableMode mode = IMMUTABLE); | 526 Node* AllocateHeapNumber(MutableMode mode = IMMUTABLE); |
513 // Allocate a HeapNumber with a specific value. | 527 // Allocate a HeapNumber with a specific value. |
514 Node* AllocateHeapNumberWithValue(Node* value, MutableMode mode = IMMUTABLE); | 528 Node* AllocateHeapNumberWithValue(Node* value, MutableMode mode = IMMUTABLE); |
515 // Allocate a SeqOneByteString with the given length. | 529 // Allocate a SeqOneByteString with the given length. |
516 Node* AllocateSeqOneByteString(int length, AllocationFlags flags = kNone); | 530 Node* AllocateSeqOneByteString(int length, AllocationFlags flags = kNone); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
656 Node* TryGrowElementsCapacity(Node* object, Node* elements, ElementsKind kind, | 670 Node* TryGrowElementsCapacity(Node* object, Node* elements, ElementsKind kind, |
657 Node* key, Node* capacity, ParameterMode mode, | 671 Node* key, Node* capacity, ParameterMode mode, |
658 Label* bailout); | 672 Label* bailout); |
659 | 673 |
660 // Grows elements capacity of given object. Returns new elements. | 674 // Grows elements capacity of given object. Returns new elements. |
661 Node* GrowElementsCapacity(Node* object, Node* elements, | 675 Node* GrowElementsCapacity(Node* object, Node* elements, |
662 ElementsKind from_kind, ElementsKind to_kind, | 676 ElementsKind from_kind, ElementsKind to_kind, |
663 Node* capacity, Node* new_capacity, | 677 Node* capacity, Node* new_capacity, |
664 ParameterMode mode, Label* bailout); | 678 ParameterMode mode, Label* bailout); |
665 | 679 |
680 // Given a need to grow by |growth|, allocate an appropriate new capacity | |
681 // and return a new elements FixedArray object. Label |bailout| is | |
682 // 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
| |
683 // capacity is sufficient. | |
684 void PossiblyGrowElementsCapacity(ParameterMode mode, ElementsKind kind, | |
685 Node* array, Node* length, | |
686 Variable* var_elements, Node* growth, | |
687 Label* bailout); | |
688 | |
666 // Allocation site manipulation | 689 // Allocation site manipulation |
667 void InitializeAllocationMemento(Node* base_allocation, | 690 void InitializeAllocationMemento(Node* base_allocation, |
668 int base_allocation_size, | 691 int base_allocation_size, |
669 Node* allocation_site); | 692 Node* allocation_site); |
670 | 693 |
671 Node* TryTaggedToFloat64(Node* value, Label* if_valueisnotnumber); | 694 Node* TryTaggedToFloat64(Node* value, Label* if_valueisnotnumber); |
672 Node* TruncateTaggedToFloat64(Node* context, Node* value); | 695 Node* TruncateTaggedToFloat64(Node* context, Node* value); |
673 Node* TruncateTaggedToWord32(Node* context, Node* value); | 696 Node* TruncateTaggedToWord32(Node* context, Node* value); |
674 // Truncate the floating point value of a HeapNumber to an Int32. | 697 // Truncate the floating point value of a HeapNumber to an Int32. |
675 Node* TruncateHeapNumberValueToWord32(Node* object); | 698 Node* TruncateHeapNumberValueToWord32(Node* object); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
743 // True iff |object| is a Smi or a HeapNumber. | 766 // True iff |object| is a Smi or a HeapNumber. |
744 Node* IsNumber(Node* object); | 767 Node* IsNumber(Node* object); |
745 | 768 |
746 // True iff |number| is either a Smi, or a HeapNumber whose value is not | 769 // True iff |number| is either a Smi, or a HeapNumber whose value is not |
747 // within Smi range. | 770 // within Smi range. |
748 Node* IsNumberNormalized(Node* number); | 771 Node* IsNumberNormalized(Node* number); |
749 | 772 |
750 // ElementsKind helpers: | 773 // ElementsKind helpers: |
751 Node* IsFastElementsKind(Node* elements_kind); | 774 Node* IsFastElementsKind(Node* elements_kind); |
752 Node* IsHoleyFastElementsKind(Node* elements_kind); | 775 Node* IsHoleyFastElementsKind(Node* elements_kind); |
776 Node* IsElementsKindGreaterThan(Node* target_kind, | |
777 ElementsKind reference_kind); | |
753 | 778 |
754 // String helpers. | 779 // String helpers. |
755 // Load a character from a String (might flatten a ConsString). | 780 // Load a character from a String (might flatten a ConsString). |
756 Node* StringCharCodeAt(Node* string, Node* index, | 781 Node* StringCharCodeAt(Node* string, Node* index, |
757 ParameterMode parameter_mode = SMI_PARAMETERS); | 782 ParameterMode parameter_mode = SMI_PARAMETERS); |
758 // Return the single character string with only {code}. | 783 // Return the single character string with only {code}. |
759 Node* StringFromCharCode(Node* code); | 784 Node* StringFromCharCode(Node* code); |
760 // Return a new string object which holds a substring containing the range | 785 // Return a new string object which holds a substring containing the range |
761 // [from,to[ of string. |from| and |to| are expected to be tagged. | 786 // [from,to[ of string. |from| and |to| are expected to be tagged. |
762 Node* SubString(Node* context, Node* string, Node* from, Node* to); | 787 Node* SubString(Node* context, Node* string, Node* from, Node* to); |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1548 } | 1573 } |
1549 #else | 1574 #else |
1550 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1575 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
1551 #endif | 1576 #endif |
1552 | 1577 |
1553 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1578 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
1554 | 1579 |
1555 } // namespace internal | 1580 } // namespace internal |
1556 } // namespace v8 | 1581 } // namespace v8 |
1557 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1582 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |