OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 V(RegExp_string, "RegExp") \ | 225 V(RegExp_string, "RegExp") \ |
226 V(source_string, "source") \ | 226 V(source_string, "source") \ |
227 V(global_string, "global") \ | 227 V(global_string, "global") \ |
228 V(ignore_case_string, "ignoreCase") \ | 228 V(ignore_case_string, "ignoreCase") \ |
229 V(multiline_string, "multiline") \ | 229 V(multiline_string, "multiline") \ |
230 V(input_string, "input") \ | 230 V(input_string, "input") \ |
231 V(index_string, "index") \ | 231 V(index_string, "index") \ |
232 V(last_index_string, "lastIndex") \ | 232 V(last_index_string, "lastIndex") \ |
233 V(object_string, "object") \ | 233 V(object_string, "object") \ |
234 V(payload_string, "payload") \ | 234 V(payload_string, "payload") \ |
| 235 V(literals_string, "literals") \ |
235 V(prototype_string, "prototype") \ | 236 V(prototype_string, "prototype") \ |
236 V(string_string, "string") \ | 237 V(string_string, "string") \ |
237 V(String_string, "String") \ | 238 V(String_string, "String") \ |
238 V(unknown_field_string, "unknownField") \ | 239 V(unknown_field_string, "unknownField") \ |
239 V(symbol_string, "symbol") \ | 240 V(symbol_string, "symbol") \ |
240 V(Symbol_string, "Symbol") \ | 241 V(Symbol_string, "Symbol") \ |
241 V(Date_string, "Date") \ | 242 V(Date_string, "Date") \ |
242 V(this_string, "this") \ | 243 V(this_string, "this") \ |
243 V(to_string_string, "toString") \ | 244 V(to_string_string, "toString") \ |
244 V(char_at_string, "CharAt") \ | 245 V(char_at_string, "CharAt") \ |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 // constructor. | 652 // constructor. |
652 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 653 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
653 // failed. | 654 // failed. |
654 // Please note this does not perform a garbage collection. | 655 // Please note this does not perform a garbage collection. |
655 MUST_USE_RESULT MaybeObject* AllocateJSObject( | 656 MUST_USE_RESULT MaybeObject* AllocateJSObject( |
656 JSFunction* constructor, | 657 JSFunction* constructor, |
657 PretenureFlag pretenure = NOT_TENURED); | 658 PretenureFlag pretenure = NOT_TENURED); |
658 | 659 |
659 MUST_USE_RESULT MaybeObject* AllocateJSObjectWithAllocationSite( | 660 MUST_USE_RESULT MaybeObject* AllocateJSObjectWithAllocationSite( |
660 JSFunction* constructor, | 661 JSFunction* constructor, |
661 Handle<Object> allocation_site_info_payload); | 662 Handle<AllocationSite> allocation_site); |
662 | 663 |
663 MUST_USE_RESULT MaybeObject* AllocateJSGeneratorObject( | 664 MUST_USE_RESULT MaybeObject* AllocateJSGeneratorObject( |
664 JSFunction* function); | 665 JSFunction* function); |
665 | 666 |
666 MUST_USE_RESULT MaybeObject* AllocateJSModule(Context* context, | 667 MUST_USE_RESULT MaybeObject* AllocateJSModule(Context* context, |
667 ScopeInfo* scope_info); | 668 ScopeInfo* scope_info); |
668 | 669 |
669 // Allocate a JSArray with no elements | 670 // Allocate a JSArray with no elements |
670 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray( | 671 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray( |
671 ElementsKind elements_kind, | 672 ElementsKind elements_kind, |
672 PretenureFlag pretenure = NOT_TENURED) { | 673 PretenureFlag pretenure = NOT_TENURED) { |
673 return AllocateJSArrayAndStorage(elements_kind, 0, 0, | 674 return AllocateJSArrayAndStorage(elements_kind, 0, 0, |
674 DONT_INITIALIZE_ARRAY_ELEMENTS, | 675 DONT_INITIALIZE_ARRAY_ELEMENTS, |
675 pretenure); | 676 pretenure); |
676 } | 677 } |
677 | 678 |
678 inline MUST_USE_RESULT MaybeObject* AllocateEmptyJSArrayWithAllocationSite( | 679 inline MUST_USE_RESULT MaybeObject* AllocateEmptyJSArrayWithAllocationSite( |
679 ElementsKind elements_kind, | 680 ElementsKind elements_kind, |
680 Handle<Object> allocation_site_payload); | 681 Handle<AllocationSite> allocation_site); |
681 | 682 |
682 // Allocate a JSArray with a specified length but elements that are left | 683 // Allocate a JSArray with a specified length but elements that are left |
683 // uninitialized. | 684 // uninitialized. |
684 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorage( | 685 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorage( |
685 ElementsKind elements_kind, | 686 ElementsKind elements_kind, |
686 int length, | 687 int length, |
687 int capacity, | 688 int capacity, |
688 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS, | 689 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS, |
689 PretenureFlag pretenure = NOT_TENURED); | 690 PretenureFlag pretenure = NOT_TENURED); |
690 | 691 |
691 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorageWithAllocationSite( | 692 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorageWithAllocationSite( |
692 ElementsKind elements_kind, | 693 ElementsKind elements_kind, |
693 int length, | 694 int length, |
694 int capacity, | 695 int capacity, |
695 Handle<Object> allocation_site_payload, | 696 Handle<AllocationSite> allocation_site, |
696 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS); | 697 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS); |
697 | 698 |
698 MUST_USE_RESULT MaybeObject* AllocateJSArrayStorage( | 699 MUST_USE_RESULT MaybeObject* AllocateJSArrayStorage( |
699 JSArray* array, | 700 JSArray* array, |
700 int length, | 701 int length, |
701 int capacity, | 702 int capacity, |
702 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS); | 703 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS); |
703 | 704 |
704 // Allocate a JSArray with no elements | 705 // Allocate a JSArray with no elements |
705 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithElements( | 706 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithElements( |
706 FixedArrayBase* array_base, | 707 FixedArrayBase* array_base, |
707 ElementsKind elements_kind, | 708 ElementsKind elements_kind, |
708 int length, | 709 int length, |
709 PretenureFlag pretenure = NOT_TENURED); | 710 PretenureFlag pretenure = NOT_TENURED); |
710 | 711 |
711 // Allocates and initializes a new global object based on a constructor. | 712 // Allocates and initializes a new global object based on a constructor. |
712 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 713 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
713 // failed. | 714 // failed. |
714 // Please note this does not perform a garbage collection. | 715 // Please note this does not perform a garbage collection. |
715 MUST_USE_RESULT MaybeObject* AllocateGlobalObject(JSFunction* constructor); | 716 MUST_USE_RESULT MaybeObject* AllocateGlobalObject(JSFunction* constructor); |
716 | 717 |
717 // Returns a deep copy of the JavaScript object. | 718 // Returns a deep copy of the JavaScript object. |
718 // Properties and elements are copied too. | 719 // Properties and elements are copied too. |
719 // Returns failure if allocation failed. | 720 // Returns failure if allocation failed. |
720 MUST_USE_RESULT MaybeObject* CopyJSObject(JSObject* source); | 721 MUST_USE_RESULT MaybeObject* CopyJSObject(JSObject* source); |
721 | 722 |
722 MUST_USE_RESULT MaybeObject* CopyJSObjectWithAllocationSite(JSObject* source); | 723 MUST_USE_RESULT MaybeObject* CopyJSObjectWithAllocationSite( |
| 724 JSObject* source, AllocationSite* site); |
723 | 725 |
724 // Allocates the function prototype. | 726 // Allocates the function prototype. |
725 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 727 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
726 // failed. | 728 // failed. |
727 // Please note this does not perform a garbage collection. | 729 // Please note this does not perform a garbage collection. |
728 MUST_USE_RESULT MaybeObject* AllocateFunctionPrototype(JSFunction* function); | 730 MUST_USE_RESULT MaybeObject* AllocateFunctionPrototype(JSFunction* function); |
729 | 731 |
730 // Allocates a JS ArrayBuffer object. | 732 // Allocates a JS ArrayBuffer object. |
731 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 733 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
732 // failed. | 734 // failed. |
(...skipping 29 matching lines...) Expand all Loading... |
762 JSFunction* constructor, JSGlobalProxy* global); | 764 JSFunction* constructor, JSGlobalProxy* global); |
763 | 765 |
764 // Allocates and initializes a new JavaScript object based on a map. | 766 // Allocates and initializes a new JavaScript object based on a map. |
765 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 767 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
766 // failed. | 768 // failed. |
767 // Please note this does not perform a garbage collection. | 769 // Please note this does not perform a garbage collection. |
768 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMap( | 770 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMap( |
769 Map* map, PretenureFlag pretenure = NOT_TENURED); | 771 Map* map, PretenureFlag pretenure = NOT_TENURED); |
770 | 772 |
771 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMapWithAllocationSite( | 773 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMapWithAllocationSite( |
772 Map* map, Handle<Object> allocation_site_info_payload); | 774 Map* map, Handle<AllocationSite> allocation_site); |
773 | 775 |
774 // Allocates a heap object based on the map. | 776 // Allocates a heap object based on the map. |
775 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 777 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
776 // failed. | 778 // failed. |
777 // Please note this function does not perform a garbage collection. | 779 // Please note this function does not perform a garbage collection. |
778 MUST_USE_RESULT MaybeObject* Allocate(Map* map, AllocationSpace space); | 780 MUST_USE_RESULT MaybeObject* Allocate(Map* map, AllocationSpace space); |
779 | 781 |
780 MUST_USE_RESULT MaybeObject* AllocateWithAllocationSite(Map* map, | 782 MUST_USE_RESULT MaybeObject* AllocateWithAllocationSite(Map* map, |
781 AllocationSpace space, Handle<Object> allocation_site_info_payload); | 783 AllocationSpace space, Handle<AllocationSite> allocation_site); |
782 | 784 |
783 // Allocates a JS Map in the heap. | 785 // Allocates a JS Map in the heap. |
784 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 786 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
785 // failed. | 787 // failed. |
786 // Please note this function does not perform a garbage collection. | 788 // Please note this function does not perform a garbage collection. |
787 MUST_USE_RESULT MaybeObject* AllocateMap( | 789 MUST_USE_RESULT MaybeObject* AllocateMap( |
788 InstanceType instance_type, | 790 InstanceType instance_type, |
789 int instance_size, | 791 int instance_size, |
790 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND); | 792 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND); |
791 | 793 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 // Allocate a tenured JS global property cell. | 951 // Allocate a tenured JS global property cell. |
950 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 952 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
951 // failed. | 953 // failed. |
952 // Please note this does not perform a garbage collection. | 954 // Please note this does not perform a garbage collection. |
953 MUST_USE_RESULT MaybeObject* AllocatePropertyCell(Object* value); | 955 MUST_USE_RESULT MaybeObject* AllocatePropertyCell(Object* value); |
954 | 956 |
955 // Allocate Box. | 957 // Allocate Box. |
956 MUST_USE_RESULT MaybeObject* AllocateBox(Object* value, | 958 MUST_USE_RESULT MaybeObject* AllocateBox(Object* value, |
957 PretenureFlag pretenure); | 959 PretenureFlag pretenure); |
958 | 960 |
| 961 // Allocate a tenured AllocationSite. It's payload is null |
| 962 MUST_USE_RESULT MaybeObject* AllocateAllocationSite(); |
| 963 |
959 // Allocates a fixed array initialized with undefined values | 964 // Allocates a fixed array initialized with undefined values |
960 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 965 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
961 // failed. | 966 // failed. |
962 // Please note this does not perform a garbage collection. | 967 // Please note this does not perform a garbage collection. |
963 MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length, | 968 MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length, |
964 PretenureFlag pretenure); | 969 PretenureFlag pretenure); |
965 // Allocates a fixed array initialized with undefined values | 970 // Allocates a fixed array initialized with undefined values |
966 MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length); | 971 MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length); |
967 | 972 |
968 // Allocates an uninitialized fixed array. It must be filled by the caller. | 973 // Allocates an uninitialized fixed array. It must be filled by the caller. |
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2152 Object* to_number, | 2157 Object* to_number, |
2153 byte kind); | 2158 byte kind); |
2154 | 2159 |
2155 // Allocate a JSArray with no elements | 2160 // Allocate a JSArray with no elements |
2156 MUST_USE_RESULT MaybeObject* AllocateJSArray( | 2161 MUST_USE_RESULT MaybeObject* AllocateJSArray( |
2157 ElementsKind elements_kind, | 2162 ElementsKind elements_kind, |
2158 PretenureFlag pretenure = NOT_TENURED); | 2163 PretenureFlag pretenure = NOT_TENURED); |
2159 | 2164 |
2160 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithAllocationSite( | 2165 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithAllocationSite( |
2161 ElementsKind elements_kind, | 2166 ElementsKind elements_kind, |
2162 Handle<Object> allocation_site_info_payload); | 2167 Handle<AllocationSite> allocation_site); |
2163 | 2168 |
2164 // Allocate empty fixed array. | 2169 // Allocate empty fixed array. |
2165 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedArray(); | 2170 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedArray(); |
2166 | 2171 |
2167 // Allocate empty external array of given type. | 2172 // Allocate empty external array of given type. |
2168 MUST_USE_RESULT MaybeObject* AllocateEmptyExternalArray( | 2173 MUST_USE_RESULT MaybeObject* AllocateEmptyExternalArray( |
2169 ExternalArrayType array_type); | 2174 ExternalArrayType array_type); |
2170 | 2175 |
2171 // Allocate empty fixed double array. | 2176 // Allocate empty fixed double array. |
2172 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedDoubleArray(); | 2177 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedDoubleArray(); |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3081 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 3086 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
3082 | 3087 |
3083 private: | 3088 private: |
3084 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 3089 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
3085 }; | 3090 }; |
3086 #endif // DEBUG | 3091 #endif // DEBUG |
3087 | 3092 |
3088 } } // namespace v8::internal | 3093 } } // namespace v8::internal |
3089 | 3094 |
3090 #endif // V8_HEAP_H_ | 3095 #endif // V8_HEAP_H_ |
OLD | NEW |