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 // if necessary, and return a new elements FixedArray object. Label |bailout| |
| 682 // is followed for allocation failure. |
| 683 void PossiblyGrowElementsCapacity(ParameterMode mode, ElementsKind kind, |
| 684 Node* array, Node* length, |
| 685 Variable* var_elements, Node* growth, |
| 686 Label* bailout); |
| 687 |
666 // Allocation site manipulation | 688 // Allocation site manipulation |
667 void InitializeAllocationMemento(Node* base_allocation, | 689 void InitializeAllocationMemento(Node* base_allocation, |
668 int base_allocation_size, | 690 int base_allocation_size, |
669 Node* allocation_site); | 691 Node* allocation_site); |
670 | 692 |
671 Node* TryTaggedToFloat64(Node* value, Label* if_valueisnotnumber); | 693 Node* TryTaggedToFloat64(Node* value, Label* if_valueisnotnumber); |
672 Node* TruncateTaggedToFloat64(Node* context, Node* value); | 694 Node* TruncateTaggedToFloat64(Node* context, Node* value); |
673 Node* TruncateTaggedToWord32(Node* context, Node* value); | 695 Node* TruncateTaggedToWord32(Node* context, Node* value); |
674 // Truncate the floating point value of a HeapNumber to an Int32. | 696 // Truncate the floating point value of a HeapNumber to an Int32. |
675 Node* TruncateHeapNumberValueToWord32(Node* object); | 697 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. | 765 // True iff |object| is a Smi or a HeapNumber. |
744 Node* IsNumber(Node* object); | 766 Node* IsNumber(Node* object); |
745 | 767 |
746 // True iff |number| is either a Smi, or a HeapNumber whose value is not | 768 // True iff |number| is either a Smi, or a HeapNumber whose value is not |
747 // within Smi range. | 769 // within Smi range. |
748 Node* IsNumberNormalized(Node* number); | 770 Node* IsNumberNormalized(Node* number); |
749 | 771 |
750 // ElementsKind helpers: | 772 // ElementsKind helpers: |
751 Node* IsFastElementsKind(Node* elements_kind); | 773 Node* IsFastElementsKind(Node* elements_kind); |
752 Node* IsHoleyFastElementsKind(Node* elements_kind); | 774 Node* IsHoleyFastElementsKind(Node* elements_kind); |
| 775 Node* IsElementsKindGreaterThan(Node* target_kind, |
| 776 ElementsKind reference_kind); |
753 | 777 |
754 // String helpers. | 778 // String helpers. |
755 // Load a character from a String (might flatten a ConsString). | 779 // Load a character from a String (might flatten a ConsString). |
756 Node* StringCharCodeAt(Node* string, Node* index, | 780 Node* StringCharCodeAt(Node* string, Node* index, |
757 ParameterMode parameter_mode = SMI_PARAMETERS); | 781 ParameterMode parameter_mode = SMI_PARAMETERS); |
758 // Return the single character string with only {code}. | 782 // Return the single character string with only {code}. |
759 Node* StringFromCharCode(Node* code); | 783 Node* StringFromCharCode(Node* code); |
760 // Return a new string object which holds a substring containing the range | 784 // 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. | 785 // [from,to[ of string. |from| and |to| are expected to be tagged. |
762 Node* SubString(Node* context, Node* string, Node* from, Node* to); | 786 Node* SubString(Node* context, Node* string, Node* from, Node* to); |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1548 } | 1572 } |
1549 #else | 1573 #else |
1550 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1574 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
1551 #endif | 1575 #endif |
1552 | 1576 |
1553 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1577 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
1554 | 1578 |
1555 } // namespace internal | 1579 } // namespace internal |
1556 } // namespace v8 | 1580 } // namespace v8 |
1557 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1581 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |