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 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 InstanceType instance_type, | 683 InstanceType instance_type, |
684 char const* method_name); | 684 char const* method_name); |
685 | 685 |
686 // Type checks. | 686 // Type checks. |
687 // Check whether the map is for an object with special properties, such as a | 687 // Check whether the map is for an object with special properties, such as a |
688 // JSProxy or an object with interceptors. | 688 // JSProxy or an object with interceptors. |
689 Node* InstanceTypeEqual(Node* instance_type, int type); | 689 Node* InstanceTypeEqual(Node* instance_type, int type); |
690 Node* IsSpecialReceiverMap(Node* map); | 690 Node* IsSpecialReceiverMap(Node* map); |
691 Node* IsSpecialReceiverInstanceType(Node* instance_type); | 691 Node* IsSpecialReceiverInstanceType(Node* instance_type); |
692 Node* IsStringInstanceType(Node* instance_type); | 692 Node* IsStringInstanceType(Node* instance_type); |
| 693 Node* IsOneByteStringInstanceType(Node* instance_type); |
| 694 Node* IsSequentialStringInstanceType(Node* instance_type); |
693 Node* IsString(Node* object); | 695 Node* IsString(Node* object); |
694 Node* IsJSObject(Node* object); | 696 Node* IsJSObject(Node* object); |
695 Node* IsJSGlobalProxy(Node* object); | 697 Node* IsJSGlobalProxy(Node* object); |
696 Node* IsJSReceiverInstanceType(Node* instance_type); | 698 Node* IsJSReceiverInstanceType(Node* instance_type); |
697 Node* IsJSReceiver(Node* object); | 699 Node* IsJSReceiver(Node* object); |
698 Node* IsJSReceiverMap(Node* map); | 700 Node* IsJSReceiverMap(Node* map); |
699 Node* IsMap(Node* object); | 701 Node* IsMap(Node* object); |
700 Node* IsCallableMap(Node* map); | 702 Node* IsCallableMap(Node* map); |
701 Node* IsDeprecatedMap(Node* map); | 703 Node* IsDeprecatedMap(Node* map); |
702 Node* IsCallable(Node* object); | 704 Node* IsCallable(Node* object); |
(...skipping 25 matching lines...) Expand all Loading... |
728 // Return the single character string with only {code}. | 730 // Return the single character string with only {code}. |
729 Node* StringFromCharCode(Node* code); | 731 Node* StringFromCharCode(Node* code); |
730 // Return a new string object which holds a substring containing the range | 732 // Return a new string object which holds a substring containing the range |
731 // [from,to[ of string. |from| and |to| are expected to be tagged. | 733 // [from,to[ of string. |from| and |to| are expected to be tagged. |
732 Node* SubString(Node* context, Node* string, Node* from, Node* to); | 734 Node* SubString(Node* context, Node* string, Node* from, Node* to); |
733 | 735 |
734 // Return a new string object produced by concatenating |first| with |second|. | 736 // Return a new string object produced by concatenating |first| with |second|. |
735 Node* StringAdd(Node* context, Node* first, Node* second, | 737 Node* StringAdd(Node* context, Node* first, Node* second, |
736 AllocationFlags flags = kNone); | 738 AllocationFlags flags = kNone); |
737 | 739 |
| 740 // Tries to unpack |string| into a pseudo-sequential string. For instance, |
| 741 // In addition to the work done by TryDerefExternalString and |
| 742 // MaybeDerefIndirectString, this method can also unpack sliced strings into |
| 743 // a (string, offset) pair. The same GC restrictions on the returned string |
| 744 // value apply as for TryDerefExternalString. |
| 745 void TryUnpackString(Variable* var_string, Variable* var_offset, |
| 746 Variable* var_instance_type, Label* if_bailout); |
| 747 |
738 // Unpack the external string, returning a pointer that (offset-wise) looks | 748 // Unpack the external string, returning a pointer that (offset-wise) looks |
739 // like a sequential string. | 749 // like a sequential string. |
740 // Note that this pointer is not tagged and does not point to a real | 750 // Note that this pointer is not tagged and does not point to a real |
741 // sequential string instance, and may only be used to access the string | 751 // sequential string instance, and may only be used to access the string |
742 // data. The pointer is GC-safe as long as a reference to the container | 752 // data. The pointer is GC-safe as long as a reference to the container |
743 // ExternalString is live. | 753 // ExternalString is live. |
744 // |string| must be an external string. Bailout for short external strings. | 754 // |string| must be an external string. Bailout for short external strings. |
745 Node* TryDerefExternalString(Node* const string, Node* const instance_type, | 755 Node* TryDerefExternalString(Node* const string, Node* const instance_type, |
746 Label* if_bailout); | 756 Label* if_bailout); |
747 | 757 |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1417 } | 1427 } |
1418 #else | 1428 #else |
1419 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1429 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
1420 #endif | 1430 #endif |
1421 | 1431 |
1422 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1432 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
1423 | 1433 |
1424 } // namespace internal | 1434 } // namespace internal |
1425 } // namespace v8 | 1435 } // namespace v8 |
1426 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1436 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |