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

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: Some cleanup Created 7 years, 6 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 V(RegExp_string, "RegExp") \ 224 V(RegExp_string, "RegExp") \
225 V(source_string, "source") \ 225 V(source_string, "source") \
226 V(global_string, "global") \ 226 V(global_string, "global") \
227 V(ignore_case_string, "ignoreCase") \ 227 V(ignore_case_string, "ignoreCase") \
228 V(multiline_string, "multiline") \ 228 V(multiline_string, "multiline") \
229 V(input_string, "input") \ 229 V(input_string, "input") \
230 V(index_string, "index") \ 230 V(index_string, "index") \
231 V(last_index_string, "lastIndex") \ 231 V(last_index_string, "lastIndex") \
232 V(object_string, "object") \ 232 V(object_string, "object") \
233 V(payload_string, "payload") \ 233 V(payload_string, "payload") \
234 V(literals_string, "literals") \
234 V(prototype_string, "prototype") \ 235 V(prototype_string, "prototype") \
235 V(string_string, "string") \ 236 V(string_string, "string") \
236 V(String_string, "String") \ 237 V(String_string, "String") \
237 V(unknown_field_string, "unknownField") \ 238 V(unknown_field_string, "unknownField") \
238 V(symbol_string, "symbol") \ 239 V(symbol_string, "symbol") \
239 V(Symbol_string, "Symbol") \ 240 V(Symbol_string, "Symbol") \
240 V(Date_string, "Date") \ 241 V(Date_string, "Date") \
241 V(this_string, "this") \ 242 V(this_string, "this") \
242 V(to_string_string, "toString") \ 243 V(to_string_string, "toString") \
243 V(char_at_string, "CharAt") \ 244 V(char_at_string, "CharAt") \
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 // constructor. 646 // constructor.
646 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 647 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
647 // failed. 648 // failed.
648 // Please note this does not perform a garbage collection. 649 // Please note this does not perform a garbage collection.
649 MUST_USE_RESULT MaybeObject* AllocateJSObject( 650 MUST_USE_RESULT MaybeObject* AllocateJSObject(
650 JSFunction* constructor, 651 JSFunction* constructor,
651 PretenureFlag pretenure = NOT_TENURED); 652 PretenureFlag pretenure = NOT_TENURED);
652 653
653 MUST_USE_RESULT MaybeObject* AllocateJSObjectWithAllocationSite( 654 MUST_USE_RESULT MaybeObject* AllocateJSObjectWithAllocationSite(
654 JSFunction* constructor, 655 JSFunction* constructor,
655 Handle<Object> allocation_site_info_payload); 656 Handle<AllocationSite> allocation_site);
656 657
657 MUST_USE_RESULT MaybeObject* AllocateJSGeneratorObject( 658 MUST_USE_RESULT MaybeObject* AllocateJSGeneratorObject(
658 JSFunction* function); 659 JSFunction* function);
659 660
660 MUST_USE_RESULT MaybeObject* AllocateJSModule(Context* context, 661 MUST_USE_RESULT MaybeObject* AllocateJSModule(Context* context,
661 ScopeInfo* scope_info); 662 ScopeInfo* scope_info);
662 663
663 // Allocate a JSArray with no elements 664 // Allocate a JSArray with no elements
664 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray( 665 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray(
665 ElementsKind elements_kind, 666 ElementsKind elements_kind,
666 PretenureFlag pretenure = NOT_TENURED) { 667 PretenureFlag pretenure = NOT_TENURED) {
667 return AllocateJSArrayAndStorage(elements_kind, 0, 0, 668 return AllocateJSArrayAndStorage(elements_kind, 0, 0,
668 DONT_INITIALIZE_ARRAY_ELEMENTS, 669 DONT_INITIALIZE_ARRAY_ELEMENTS,
669 pretenure); 670 pretenure);
670 } 671 }
671 672
672 inline MUST_USE_RESULT MaybeObject* AllocateEmptyJSArrayWithAllocationSite( 673 inline MUST_USE_RESULT MaybeObject* AllocateEmptyJSArrayWithAllocationSite(
673 ElementsKind elements_kind, 674 ElementsKind elements_kind,
674 Handle<Object> allocation_site_payload); 675 Handle<AllocationSite> allocation_site);
675 676
676 // Allocate a JSArray with a specified length but elements that are left 677 // Allocate a JSArray with a specified length but elements that are left
677 // uninitialized. 678 // uninitialized.
678 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorage( 679 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorage(
679 ElementsKind elements_kind, 680 ElementsKind elements_kind,
680 int length, 681 int length,
681 int capacity, 682 int capacity,
682 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS, 683 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS,
683 PretenureFlag pretenure = NOT_TENURED); 684 PretenureFlag pretenure = NOT_TENURED);
684 685
685 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorageWithAllocationSite( 686 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorageWithAllocationSite(
686 ElementsKind elements_kind, 687 ElementsKind elements_kind,
687 int length, 688 int length,
688 int capacity, 689 int capacity,
689 Handle<Object> allocation_site_payload, 690 Handle<AllocationSite> allocation_site,
690 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS); 691 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS);
691 692
692 MUST_USE_RESULT MaybeObject* AllocateJSArrayStorage( 693 MUST_USE_RESULT MaybeObject* AllocateJSArrayStorage(
693 JSArray* array, 694 JSArray* array,
694 int length, 695 int length,
695 int capacity, 696 int capacity,
696 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS); 697 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS);
697 698
698 // Allocate a JSArray with no elements 699 // Allocate a JSArray with no elements
699 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithElements( 700 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithElements(
700 FixedArrayBase* array_base, 701 FixedArrayBase* array_base,
701 ElementsKind elements_kind, 702 ElementsKind elements_kind,
702 int length, 703 int length,
703 PretenureFlag pretenure = NOT_TENURED); 704 PretenureFlag pretenure = NOT_TENURED);
704 705
705 // Allocates and initializes a new global object based on a constructor. 706 // Allocates and initializes a new global object based on a constructor.
706 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 707 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
707 // failed. 708 // failed.
708 // Please note this does not perform a garbage collection. 709 // Please note this does not perform a garbage collection.
709 MUST_USE_RESULT MaybeObject* AllocateGlobalObject(JSFunction* constructor); 710 MUST_USE_RESULT MaybeObject* AllocateGlobalObject(JSFunction* constructor);
710 711
711 // Returns a deep copy of the JavaScript object. 712 // Returns a deep copy of the JavaScript object.
712 // Properties and elements are copied too. 713 // Properties and elements are copied too.
713 // Returns failure if allocation failed. 714 // Returns failure if allocation failed.
714 MUST_USE_RESULT MaybeObject* CopyJSObject(JSObject* source); 715 MUST_USE_RESULT MaybeObject* CopyJSObject(JSObject* source);
715 716
716 MUST_USE_RESULT MaybeObject* CopyJSObjectWithAllocationSite(JSObject* source); 717 MUST_USE_RESULT MaybeObject* CopyJSObjectWithAllocationSite(
718 JSObject* source, AllocationSite* site);
717 719
718 // Allocates the function prototype. 720 // Allocates the function prototype.
719 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 721 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
720 // failed. 722 // failed.
721 // Please note this does not perform a garbage collection. 723 // Please note this does not perform a garbage collection.
722 MUST_USE_RESULT MaybeObject* AllocateFunctionPrototype(JSFunction* function); 724 MUST_USE_RESULT MaybeObject* AllocateFunctionPrototype(JSFunction* function);
723 725
724 // Allocates a JS ArrayBuffer object. 726 // Allocates a JS ArrayBuffer object.
725 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 727 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
726 // failed. 728 // failed.
(...skipping 29 matching lines...) Expand all
756 JSFunction* constructor, JSGlobalProxy* global); 758 JSFunction* constructor, JSGlobalProxy* global);
757 759
758 // Allocates and initializes a new JavaScript object based on a map. 760 // Allocates and initializes a new JavaScript object based on a map.
759 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 761 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
760 // failed. 762 // failed.
761 // Please note this does not perform a garbage collection. 763 // Please note this does not perform a garbage collection.
762 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMap( 764 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMap(
763 Map* map, PretenureFlag pretenure = NOT_TENURED); 765 Map* map, PretenureFlag pretenure = NOT_TENURED);
764 766
765 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMapWithAllocationSite( 767 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMapWithAllocationSite(
766 Map* map, Handle<Object> allocation_site_info_payload); 768 Map* map, Handle<AllocationSite> allocation_site);
767 769
768 // Allocates a heap object based on the map. 770 // Allocates a heap object based on the map.
769 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 771 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
770 // failed. 772 // failed.
771 // Please note this function does not perform a garbage collection. 773 // Please note this function does not perform a garbage collection.
772 MUST_USE_RESULT MaybeObject* Allocate(Map* map, AllocationSpace space); 774 MUST_USE_RESULT MaybeObject* Allocate(Map* map, AllocationSpace space);
773 775
774 MUST_USE_RESULT MaybeObject* AllocateWithAllocationSite(Map* map, 776 MUST_USE_RESULT MaybeObject* AllocateWithAllocationSite(Map* map,
775 AllocationSpace space, Handle<Object> allocation_site_info_payload); 777 AllocationSpace space, Handle<AllocationSite> allocation_site);
776 778
777 // Allocates a JS Map in the heap. 779 // Allocates a JS Map in the heap.
778 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 780 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
779 // failed. 781 // failed.
780 // Please note this function does not perform a garbage collection. 782 // Please note this function does not perform a garbage collection.
781 MUST_USE_RESULT MaybeObject* AllocateMap( 783 MUST_USE_RESULT MaybeObject* AllocateMap(
782 InstanceType instance_type, 784 InstanceType instance_type,
783 int instance_size, 785 int instance_size,
784 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND); 786 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND);
785 787
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 // Allocate a tenured JS global property cell. 939 // Allocate a tenured JS global property cell.
938 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 940 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
939 // failed. 941 // failed.
940 // Please note this does not perform a garbage collection. 942 // Please note this does not perform a garbage collection.
941 MUST_USE_RESULT MaybeObject* AllocateJSGlobalPropertyCell(Object* value); 943 MUST_USE_RESULT MaybeObject* AllocateJSGlobalPropertyCell(Object* value);
942 944
943 // Allocate Box. 945 // Allocate Box.
944 MUST_USE_RESULT MaybeObject* AllocateBox(Object* value, 946 MUST_USE_RESULT MaybeObject* AllocateBox(Object* value,
945 PretenureFlag pretenure); 947 PretenureFlag pretenure);
946 948
949 // Allocate a tenured AllocationSite. It's payload is null
950 MUST_USE_RESULT MaybeObject* AllocateAllocationSite();
951
947 // Allocates a fixed array initialized with undefined values 952 // Allocates a fixed array initialized with undefined values
948 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 953 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
949 // failed. 954 // failed.
950 // Please note this does not perform a garbage collection. 955 // Please note this does not perform a garbage collection.
951 MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length, 956 MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length,
952 PretenureFlag pretenure); 957 PretenureFlag pretenure);
953 // Allocates a fixed array initialized with undefined values 958 // Allocates a fixed array initialized with undefined values
954 MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length); 959 MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length);
955 960
956 // Allocates an uninitialized fixed array. It must be filled by the caller. 961 // Allocates an uninitialized fixed array. It must be filled by the caller.
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
2137 Object* to_number, 2142 Object* to_number,
2138 byte kind); 2143 byte kind);
2139 2144
2140 // Allocate a JSArray with no elements 2145 // Allocate a JSArray with no elements
2141 MUST_USE_RESULT MaybeObject* AllocateJSArray( 2146 MUST_USE_RESULT MaybeObject* AllocateJSArray(
2142 ElementsKind elements_kind, 2147 ElementsKind elements_kind,
2143 PretenureFlag pretenure = NOT_TENURED); 2148 PretenureFlag pretenure = NOT_TENURED);
2144 2149
2145 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithAllocationSite( 2150 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithAllocationSite(
2146 ElementsKind elements_kind, 2151 ElementsKind elements_kind,
2147 Handle<Object> allocation_site_info_payload); 2152 Handle<AllocationSite> allocation_site);
2148 2153
2149 // Allocate empty fixed array. 2154 // Allocate empty fixed array.
2150 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedArray(); 2155 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedArray();
2151 2156
2152 // Allocate empty external array of given type. 2157 // Allocate empty external array of given type.
2153 MUST_USE_RESULT MaybeObject* AllocateEmptyExternalArray( 2158 MUST_USE_RESULT MaybeObject* AllocateEmptyExternalArray(
2154 ExternalArrayType array_type); 2159 ExternalArrayType array_type);
2155 2160
2156 // Allocate empty fixed double array. 2161 // Allocate empty fixed double array.
2157 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedDoubleArray(); 2162 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedDoubleArray();
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
3059 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 3064 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
3060 3065
3061 private: 3066 private:
3062 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 3067 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
3063 }; 3068 };
3064 #endif // DEBUG 3069 #endif // DEBUG
3065 3070
3066 } } // namespace v8::internal 3071 } } // namespace v8::internal
3067 3072
3068 #endif // V8_HEAP_H_ 3073 #endif // V8_HEAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698