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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 Node* StoreFixedArrayElement( | 491 Node* StoreFixedArrayElement( |
492 Node* object, Node* index, Node* value, | 492 Node* object, Node* index, Node* value, |
493 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, | 493 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, |
494 int additional_offset = 0, | 494 int additional_offset = 0, |
495 ParameterMode parameter_mode = INTPTR_PARAMETERS); | 495 ParameterMode parameter_mode = INTPTR_PARAMETERS); |
496 | 496 |
497 Node* StoreFixedDoubleArrayElement( | 497 Node* StoreFixedDoubleArrayElement( |
498 Node* object, Node* index, Node* value, | 498 Node* object, Node* index, Node* value, |
499 ParameterMode parameter_mode = INTPTR_PARAMETERS); | 499 ParameterMode parameter_mode = INTPTR_PARAMETERS); |
500 | 500 |
501 Node* BuildAppendJSArray(ElementsKind kind, Node* context, Node* array, | 501 // EnsureArrayPushable verifies that receiver is: |
| 502 // 1. Is not a prototype. |
| 503 // 2. Is not a dictionary. |
| 504 // 3. Has a writeable length property. |
| 505 // It returns ElementsKind as a node for further division into cases. |
| 506 Node* EnsureArrayPushable(Node* receiver, Label* bailout); |
| 507 |
| 508 void TryStoreArrayElement(ElementsKind kind, ParameterMode mode, |
| 509 Label* bailout, Node* elements, Node* index, |
| 510 Node* value); |
| 511 Node* BuildAppendJSArray(ElementsKind kind, Node* array, |
502 CodeStubArguments& args, Variable& arg_index, | 512 CodeStubArguments& args, Variable& arg_index, |
503 Label* bailout); | 513 Label* bailout); |
| 514 Node* BuildAppendJSArray(ElementsKind kind, Node* array, Node* value, |
| 515 Label* bailout); |
504 | 516 |
505 void StoreFieldsNoWriteBarrier(Node* start_address, Node* end_address, | 517 void StoreFieldsNoWriteBarrier(Node* start_address, Node* end_address, |
506 Node* value); | 518 Node* value); |
507 | 519 |
508 // Allocate a HeapNumber without initializing its value. | 520 // Allocate a HeapNumber without initializing its value. |
509 Node* AllocateHeapNumber(MutableMode mode = IMMUTABLE); | 521 Node* AllocateHeapNumber(MutableMode mode = IMMUTABLE); |
510 // Allocate a HeapNumber with a specific value. | 522 // Allocate a HeapNumber with a specific value. |
511 Node* AllocateHeapNumberWithValue(Node* value, MutableMode mode = IMMUTABLE); | 523 Node* AllocateHeapNumberWithValue(Node* value, MutableMode mode = IMMUTABLE); |
512 // Allocate a SeqOneByteString with the given length. | 524 // Allocate a SeqOneByteString with the given length. |
513 Node* AllocateSeqOneByteString(int length, AllocationFlags flags = kNone); | 525 Node* AllocateSeqOneByteString(int length, AllocationFlags flags = kNone); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 Node* TryGrowElementsCapacity(Node* object, Node* elements, ElementsKind kind, | 665 Node* TryGrowElementsCapacity(Node* object, Node* elements, ElementsKind kind, |
654 Node* key, Node* capacity, ParameterMode mode, | 666 Node* key, Node* capacity, ParameterMode mode, |
655 Label* bailout); | 667 Label* bailout); |
656 | 668 |
657 // Grows elements capacity of given object. Returns new elements. | 669 // Grows elements capacity of given object. Returns new elements. |
658 Node* GrowElementsCapacity(Node* object, Node* elements, | 670 Node* GrowElementsCapacity(Node* object, Node* elements, |
659 ElementsKind from_kind, ElementsKind to_kind, | 671 ElementsKind from_kind, ElementsKind to_kind, |
660 Node* capacity, Node* new_capacity, | 672 Node* capacity, Node* new_capacity, |
661 ParameterMode mode, Label* bailout); | 673 ParameterMode mode, Label* bailout); |
662 | 674 |
| 675 // Given a need to grow by |growth|, allocate an appropriate new capacity |
| 676 // and return a new elements FixedArray object. Label |bailout| is |
| 677 // followed for allocation failure. Label |fits| is followed if current |
| 678 // capacity is sufficient. |
| 679 Node* PossiblyGrowElementsCapacity(ParameterMode mode, ElementsKind kind, |
| 680 Node* array, Node* length, Node* elements, |
| 681 Node* growth, Label* fits, Label* bailout); |
| 682 |
663 // Allocation site manipulation | 683 // Allocation site manipulation |
664 void InitializeAllocationMemento(Node* base_allocation, | 684 void InitializeAllocationMemento(Node* base_allocation, |
665 int base_allocation_size, | 685 int base_allocation_size, |
666 Node* allocation_site); | 686 Node* allocation_site); |
667 | 687 |
668 Node* TryTaggedToFloat64(Node* value, Label* if_valueisnotnumber); | 688 Node* TryTaggedToFloat64(Node* value, Label* if_valueisnotnumber); |
669 Node* TruncateTaggedToFloat64(Node* context, Node* value); | 689 Node* TruncateTaggedToFloat64(Node* context, Node* value); |
670 Node* TruncateTaggedToWord32(Node* context, Node* value); | 690 Node* TruncateTaggedToWord32(Node* context, Node* value); |
671 // Truncate the floating point value of a HeapNumber to an Int32. | 691 // Truncate the floating point value of a HeapNumber to an Int32. |
672 Node* TruncateHeapNumberValueToWord32(Node* object); | 692 Node* TruncateHeapNumberValueToWord32(Node* object); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 Node* IsDictionary(Node* object); | 751 Node* IsDictionary(Node* object); |
732 Node* IsUnseededNumberDictionary(Node* object); | 752 Node* IsUnseededNumberDictionary(Node* object); |
733 Node* IsConstructorMap(Node* map); | 753 Node* IsConstructorMap(Node* map); |
734 Node* IsJSFunction(Node* object); | 754 Node* IsJSFunction(Node* object); |
735 Node* IsJSTypedArray(Node* object); | 755 Node* IsJSTypedArray(Node* object); |
736 Node* IsFixedTypedArray(Node* object); | 756 Node* IsFixedTypedArray(Node* object); |
737 | 757 |
738 // ElementsKind helpers: | 758 // ElementsKind helpers: |
739 Node* IsFastElementsKind(Node* elements_kind); | 759 Node* IsFastElementsKind(Node* elements_kind); |
740 Node* IsHoleyFastElementsKind(Node* elements_kind); | 760 Node* IsHoleyFastElementsKind(Node* elements_kind); |
| 761 Node* IsElementsKindGreaterThan(Node* target_kind, |
| 762 ElementsKind reference_kind); |
741 | 763 |
742 // String helpers. | 764 // String helpers. |
743 // Load a character from a String (might flatten a ConsString). | 765 // Load a character from a String (might flatten a ConsString). |
744 Node* StringCharCodeAt(Node* string, Node* index, | 766 Node* StringCharCodeAt(Node* string, Node* index, |
745 ParameterMode parameter_mode = SMI_PARAMETERS); | 767 ParameterMode parameter_mode = SMI_PARAMETERS); |
746 // Return the single character string with only {code}. | 768 // Return the single character string with only {code}. |
747 Node* StringFromCharCode(Node* code); | 769 Node* StringFromCharCode(Node* code); |
748 // Return a new string object which holds a substring containing the range | 770 // Return a new string object which holds a substring containing the range |
749 // [from,to[ of string. |from| and |to| are expected to be tagged. | 771 // [from,to[ of string. |from| and |to| are expected to be tagged. |
750 Node* SubString(Node* context, Node* string, Node* from, Node* to); | 772 Node* SubString(Node* context, Node* string, Node* from, Node* to); |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1486 } | 1508 } |
1487 #else | 1509 #else |
1488 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1510 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
1489 #endif | 1511 #endif |
1490 | 1512 |
1491 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1513 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
1492 | 1514 |
1493 } // namespace internal | 1515 } // namespace internal |
1494 } // namespace v8 | 1516 } // namespace v8 |
1495 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1517 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |