Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/heap.h

Issue 15094018: Create AllocationSite objects, pointed to by AllocationSiteInfo. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Platform ports and perf bugfix Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 // constructor. 651 // constructor.
651 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 652 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
652 // failed. 653 // failed.
653 // Please note this does not perform a garbage collection. 654 // Please note this does not perform a garbage collection.
654 MUST_USE_RESULT MaybeObject* AllocateJSObject( 655 MUST_USE_RESULT MaybeObject* AllocateJSObject(
655 JSFunction* constructor, 656 JSFunction* constructor,
656 PretenureFlag pretenure = NOT_TENURED); 657 PretenureFlag pretenure = NOT_TENURED);
657 658
658 MUST_USE_RESULT MaybeObject* AllocateJSObjectWithAllocationSite( 659 MUST_USE_RESULT MaybeObject* AllocateJSObjectWithAllocationSite(
659 JSFunction* constructor, 660 JSFunction* constructor,
660 Handle<Object> allocation_site_info_payload); 661 Handle<AllocationSite> allocation_site);
661 662
662 MUST_USE_RESULT MaybeObject* AllocateJSGeneratorObject( 663 MUST_USE_RESULT MaybeObject* AllocateJSGeneratorObject(
663 JSFunction* function); 664 JSFunction* function);
664 665
665 MUST_USE_RESULT MaybeObject* AllocateJSModule(Context* context, 666 MUST_USE_RESULT MaybeObject* AllocateJSModule(Context* context,
666 ScopeInfo* scope_info); 667 ScopeInfo* scope_info);
667 668
668 // Allocate a JSArray with no elements 669 // Allocate a JSArray with no elements
669 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray( 670 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray(
670 ElementsKind elements_kind, 671 ElementsKind elements_kind,
671 PretenureFlag pretenure = NOT_TENURED) { 672 PretenureFlag pretenure = NOT_TENURED) {
672 return AllocateJSArrayAndStorage(elements_kind, 0, 0, 673 return AllocateJSArrayAndStorage(elements_kind, 0, 0,
673 DONT_INITIALIZE_ARRAY_ELEMENTS, 674 DONT_INITIALIZE_ARRAY_ELEMENTS,
674 pretenure); 675 pretenure);
675 } 676 }
676 677
677 inline MUST_USE_RESULT MaybeObject* AllocateEmptyJSArrayWithAllocationSite( 678 inline MUST_USE_RESULT MaybeObject* AllocateEmptyJSArrayWithAllocationSite(
678 ElementsKind elements_kind, 679 ElementsKind elements_kind,
679 Handle<Object> allocation_site_payload); 680 Handle<AllocationSite> allocation_site);
680 681
681 // Allocate a JSArray with a specified length but elements that are left 682 // Allocate a JSArray with a specified length but elements that are left
682 // uninitialized. 683 // uninitialized.
683 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorage( 684 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorage(
684 ElementsKind elements_kind, 685 ElementsKind elements_kind,
685 int length, 686 int length,
686 int capacity, 687 int capacity,
687 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS, 688 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS,
688 PretenureFlag pretenure = NOT_TENURED); 689 PretenureFlag pretenure = NOT_TENURED);
689 690
690 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorageWithAllocationSite( 691 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorageWithAllocationSite(
691 ElementsKind elements_kind, 692 ElementsKind elements_kind,
692 int length, 693 int length,
693 int capacity, 694 int capacity,
694 Handle<Object> allocation_site_payload, 695 Handle<AllocationSite> allocation_site,
695 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS); 696 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS);
696 697
697 MUST_USE_RESULT MaybeObject* AllocateJSArrayStorage( 698 MUST_USE_RESULT MaybeObject* AllocateJSArrayStorage(
698 JSArray* array, 699 JSArray* array,
699 int length, 700 int length,
700 int capacity, 701 int capacity,
701 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS); 702 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS);
702 703
703 // Allocate a JSArray with no elements 704 // Allocate a JSArray with no elements
704 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithElements( 705 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithElements(
705 FixedArrayBase* array_base, 706 FixedArrayBase* array_base,
706 ElementsKind elements_kind, 707 ElementsKind elements_kind,
707 int length, 708 int length,
708 PretenureFlag pretenure = NOT_TENURED); 709 PretenureFlag pretenure = NOT_TENURED);
709 710
710 // Allocates and initializes a new global object based on a constructor. 711 // Allocates and initializes a new global object based on a constructor.
711 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 712 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
712 // failed. 713 // failed.
713 // Please note this does not perform a garbage collection. 714 // Please note this does not perform a garbage collection.
714 MUST_USE_RESULT MaybeObject* AllocateGlobalObject(JSFunction* constructor); 715 MUST_USE_RESULT MaybeObject* AllocateGlobalObject(JSFunction* constructor);
715 716
716 // Returns a deep copy of the JavaScript object. 717 // Returns a deep copy of the JavaScript object.
717 // Properties and elements are copied too. 718 // Properties and elements are copied too.
718 // Returns failure if allocation failed. 719 // Returns failure if allocation failed.
719 MUST_USE_RESULT MaybeObject* CopyJSObject(JSObject* source); 720 MUST_USE_RESULT MaybeObject* CopyJSObject(JSObject* source);
720 721
721 MUST_USE_RESULT MaybeObject* CopyJSObjectWithAllocationSite(JSObject* source); 722 MUST_USE_RESULT MaybeObject* CopyJSObjectWithAllocationSite(
723 JSObject* source, AllocationSite* site);
722 724
723 // Allocates the function prototype. 725 // Allocates the function prototype.
724 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 726 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
725 // failed. 727 // failed.
726 // Please note this does not perform a garbage collection. 728 // Please note this does not perform a garbage collection.
727 MUST_USE_RESULT MaybeObject* AllocateFunctionPrototype(JSFunction* function); 729 MUST_USE_RESULT MaybeObject* AllocateFunctionPrototype(JSFunction* function);
728 730
729 // Allocates a JS ArrayBuffer object. 731 // Allocates a JS ArrayBuffer object.
730 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 732 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
731 // failed. 733 // failed.
(...skipping 29 matching lines...) Expand all
761 JSFunction* constructor, JSGlobalProxy* global); 763 JSFunction* constructor, JSGlobalProxy* global);
762 764
763 // Allocates and initializes a new JavaScript object based on a map. 765 // Allocates and initializes a new JavaScript object based on a map.
764 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 766 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
765 // failed. 767 // failed.
766 // Please note this does not perform a garbage collection. 768 // Please note this does not perform a garbage collection.
767 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMap( 769 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMap(
768 Map* map, PretenureFlag pretenure = NOT_TENURED); 770 Map* map, PretenureFlag pretenure = NOT_TENURED);
769 771
770 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMapWithAllocationSite( 772 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMapWithAllocationSite(
771 Map* map, Handle<Object> allocation_site_info_payload); 773 Map* map, Handle<AllocationSite> allocation_site);
772 774
773 // Allocates a heap object based on the map. 775 // Allocates a heap object based on the map.
774 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 776 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
775 // failed. 777 // failed.
776 // Please note this function does not perform a garbage collection. 778 // Please note this function does not perform a garbage collection.
777 MUST_USE_RESULT MaybeObject* Allocate(Map* map, AllocationSpace space); 779 MUST_USE_RESULT MaybeObject* Allocate(Map* map, AllocationSpace space);
778 780
779 MUST_USE_RESULT MaybeObject* AllocateWithAllocationSite(Map* map, 781 MUST_USE_RESULT MaybeObject* AllocateWithAllocationSite(Map* map,
780 AllocationSpace space, Handle<Object> allocation_site_info_payload); 782 AllocationSpace space, Handle<AllocationSite> allocation_site);
781 783
782 // Allocates a JS Map in the heap. 784 // Allocates a JS Map in the heap.
783 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 785 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
784 // failed. 786 // failed.
785 // Please note this function does not perform a garbage collection. 787 // Please note this function does not perform a garbage collection.
786 MUST_USE_RESULT MaybeObject* AllocateMap( 788 MUST_USE_RESULT MaybeObject* AllocateMap(
787 InstanceType instance_type, 789 InstanceType instance_type,
788 int instance_size, 790 int instance_size,
789 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND); 791 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND);
790 792
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 // Allocate a tenured JS global property cell. 950 // Allocate a tenured JS global property cell.
949 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 951 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
950 // failed. 952 // failed.
951 // Please note this does not perform a garbage collection. 953 // Please note this does not perform a garbage collection.
952 MUST_USE_RESULT MaybeObject* AllocatePropertyCell(Object* value); 954 MUST_USE_RESULT MaybeObject* AllocatePropertyCell(Object* value);
953 955
954 // Allocate Box. 956 // Allocate Box.
955 MUST_USE_RESULT MaybeObject* AllocateBox(Object* value, 957 MUST_USE_RESULT MaybeObject* AllocateBox(Object* value,
956 PretenureFlag pretenure); 958 PretenureFlag pretenure);
957 959
960 // Allocate a tenured AllocationSite. It's payload is null
961 MUST_USE_RESULT MaybeObject* AllocateAllocationSite();
962
958 // Allocates a fixed array initialized with undefined values 963 // Allocates a fixed array initialized with undefined values
959 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 964 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
960 // failed. 965 // failed.
961 // Please note this does not perform a garbage collection. 966 // Please note this does not perform a garbage collection.
962 MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length, 967 MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length,
963 PretenureFlag pretenure); 968 PretenureFlag pretenure);
964 // Allocates a fixed array initialized with undefined values 969 // Allocates a fixed array initialized with undefined values
965 MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length); 970 MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length);
966 971
967 // Allocates an uninitialized fixed array. It must be filled by the caller. 972 // Allocates an uninitialized fixed array. It must be filled by the caller.
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after
2149 Object* to_number, 2154 Object* to_number,
2150 byte kind); 2155 byte kind);
2151 2156
2152 // Allocate a JSArray with no elements 2157 // Allocate a JSArray with no elements
2153 MUST_USE_RESULT MaybeObject* AllocateJSArray( 2158 MUST_USE_RESULT MaybeObject* AllocateJSArray(
2154 ElementsKind elements_kind, 2159 ElementsKind elements_kind,
2155 PretenureFlag pretenure = NOT_TENURED); 2160 PretenureFlag pretenure = NOT_TENURED);
2156 2161
2157 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithAllocationSite( 2162 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithAllocationSite(
2158 ElementsKind elements_kind, 2163 ElementsKind elements_kind,
2159 Handle<Object> allocation_site_info_payload); 2164 Handle<AllocationSite> allocation_site);
2160 2165
2161 // Allocate empty fixed array. 2166 // Allocate empty fixed array.
2162 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedArray(); 2167 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedArray();
2163 2168
2164 // Allocate empty external array of given type. 2169 // Allocate empty external array of given type.
2165 MUST_USE_RESULT MaybeObject* AllocateEmptyExternalArray( 2170 MUST_USE_RESULT MaybeObject* AllocateEmptyExternalArray(
2166 ExternalArrayType array_type); 2171 ExternalArrayType array_type);
2167 2172
2168 // Allocate empty fixed double array. 2173 // Allocate empty fixed double array.
2169 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedDoubleArray(); 2174 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedDoubleArray();
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
3078 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 3083 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
3079 3084
3080 private: 3085 private:
3081 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 3086 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
3082 }; 3087 };
3083 #endif // DEBUG 3088 #endif // DEBUG
3084 3089
3085 } } // namespace v8::internal 3090 } } // namespace v8::internal
3086 3091
3087 #endif // V8_HEAP_H_ 3092 #endif // V8_HEAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698