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

Side by Side Diff: src/heap.h

Issue 11818021: Allocation Info Tracking, continued. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase Created 7 years, 10 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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 581
582 // Uncommit unused semi space. 582 // Uncommit unused semi space.
583 bool UncommitFromSpace() { return new_space_.UncommitFromSpace(); } 583 bool UncommitFromSpace() { return new_space_.UncommitFromSpace(); }
584 584
585 // Allocates and initializes a new JavaScript object based on a 585 // Allocates and initializes a new JavaScript object based on a
586 // constructor. 586 // constructor.
587 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 587 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
588 // failed. 588 // failed.
589 // Please note this does not perform a garbage collection. 589 // Please note this does not perform a garbage collection.
590 MUST_USE_RESULT MaybeObject* AllocateJSObject( 590 MUST_USE_RESULT MaybeObject* AllocateJSObject(
591 JSFunction* constructor, PretenureFlag pretenure = NOT_TENURED); 591 JSFunction* constructor,
592 PretenureFlag pretenure = NOT_TENURED,
593 AllocationSiteMode = DONT_TRACK_ALLOCATION_SITE,
594 Handle<Object>* allocation_site_info_payload = NULL);
592 595
593 MUST_USE_RESULT MaybeObject* AllocateJSModule(Context* context, 596 MUST_USE_RESULT MaybeObject* AllocateJSModule(Context* context,
594 ScopeInfo* scope_info); 597 ScopeInfo* scope_info);
595 598
596 // Allocate a JSArray with no elements 599 // Allocate a JSArray with no elements
597 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray( 600 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray(
598 ElementsKind elements_kind, 601 ElementsKind elements_kind,
602 AllocationSiteMode allocation_site_mode = DONT_TRACK_ALLOCATION_SITE,
603 Handle<Object> *allocation_site_payload = NULL,
599 PretenureFlag pretenure = NOT_TENURED) { 604 PretenureFlag pretenure = NOT_TENURED) {
605 // TODO(mvstanton): Danno's original change does something here, but I
606 // didn't include it because I don't see why we need it yet.
Toon Verwaest 2013/02/13 15:14:51 Outdated comment?
mvstanton 2013/02/19 11:04:08 yep, thx!
600 return AllocateJSArrayAndStorage(elements_kind, 0, 0, 607 return AllocateJSArrayAndStorage(elements_kind, 0, 0,
608 allocation_site_mode,
609 allocation_site_payload,
601 DONT_INITIALIZE_ARRAY_ELEMENTS, 610 DONT_INITIALIZE_ARRAY_ELEMENTS,
602 pretenure); 611 pretenure);
603 } 612 }
604 613
605 // Allocate a JSArray with a specified length but elements that are left 614 // Allocate a JSArray with a specified length but elements that are left
606 // uninitialized. 615 // uninitialized.
607 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorage( 616 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorage(
608 ElementsKind elements_kind, 617 ElementsKind elements_kind,
609 int length, 618 int length,
610 int capacity, 619 int capacity,
620 AllocationSiteMode allocation_site_info_mode =
621 DONT_TRACK_ALLOCATION_SITE,
622 Handle<Object> *allocation_site_payload = NULL,
611 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS, 623 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS,
612 PretenureFlag pretenure = NOT_TENURED); 624 PretenureFlag pretenure = NOT_TENURED);
613 625
614 // Allocate a JSArray with no elements 626 // Allocate a JSArray with no elements
615 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithElements( 627 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithElements(
616 FixedArrayBase* array_base, 628 FixedArrayBase* array_base,
617 ElementsKind elements_kind, 629 ElementsKind elements_kind,
618 int length, 630 int length,
619 PretenureFlag pretenure = NOT_TENURED); 631 PretenureFlag pretenure = NOT_TENURED);
620 632
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 // constructor. The object is reinitialized and behaves as an 675 // constructor. The object is reinitialized and behaves as an
664 // object that has been freshly allocated using the constructor. 676 // object that has been freshly allocated using the constructor.
665 MUST_USE_RESULT MaybeObject* ReinitializeJSGlobalProxy( 677 MUST_USE_RESULT MaybeObject* ReinitializeJSGlobalProxy(
666 JSFunction* constructor, JSGlobalProxy* global); 678 JSFunction* constructor, JSGlobalProxy* global);
667 679
668 // Allocates and initializes a new JavaScript object based on a map. 680 // Allocates and initializes a new JavaScript object based on a map.
669 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 681 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
670 // failed. 682 // failed.
671 // Please note this does not perform a garbage collection. 683 // Please note this does not perform a garbage collection.
672 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMap( 684 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMap(
673 Map* map, PretenureFlag pretenure = NOT_TENURED); 685 Map* map, PretenureFlag pretenure = NOT_TENURED,
686 AllocationSiteMode mode = DONT_TRACK_ALLOCATION_SITE,
687 Handle<Object>* allocation_site_info_payload = NULL);
674 688
675 // Allocates a heap object based on the map. 689 // Allocates a heap object based on the map.
676 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 690 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
677 // failed. 691 // failed.
678 // Please note this function does not perform a garbage collection. 692 // Please note this function does not perform a garbage collection.
679 MUST_USE_RESULT MaybeObject* Allocate(Map* map, AllocationSpace space); 693 MUST_USE_RESULT MaybeObject* Allocate(Map* map, AllocationSpace space);
680 694
695 MUST_USE_RESULT MaybeObject* AllocateWithAllocationSiteInfo(Map* map,
696 AllocationSpace space,
697 Handle<Object>* allocation_site_info_payload);
698
681 // Allocates a JS Map in the heap. 699 // Allocates a JS Map in the heap.
682 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 700 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
683 // failed. 701 // failed.
684 // Please note this function does not perform a garbage collection. 702 // Please note this function does not perform a garbage collection.
685 MUST_USE_RESULT MaybeObject* AllocateMap( 703 MUST_USE_RESULT MaybeObject* AllocateMap(
686 InstanceType instance_type, 704 InstanceType instance_type,
687 int instance_size, 705 int instance_size,
688 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND); 706 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND);
689 707
690 // Allocates a partial map for bootstrapping. 708 // Allocates a partial map for bootstrapping.
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after
2008 2026
2009 void CreateFixedStubs(); 2027 void CreateFixedStubs();
2010 2028
2011 MUST_USE_RESULT MaybeObject* CreateOddball(const char* to_string, 2029 MUST_USE_RESULT MaybeObject* CreateOddball(const char* to_string,
2012 Object* to_number, 2030 Object* to_number,
2013 byte kind); 2031 byte kind);
2014 2032
2015 // Allocate a JSArray with no elements 2033 // Allocate a JSArray with no elements
2016 MUST_USE_RESULT MaybeObject* AllocateJSArray( 2034 MUST_USE_RESULT MaybeObject* AllocateJSArray(
2017 ElementsKind elements_kind, 2035 ElementsKind elements_kind,
2018 PretenureFlag pretenure = NOT_TENURED); 2036 PretenureFlag pretenure = NOT_TENURED,
2037 AllocationSiteMode mode = DONT_TRACK_ALLOCATION_SITE,
2038 Handle<Object>* allocation_site_info_payload = NULL);
2019 2039
2020 // Allocate empty fixed array. 2040 // Allocate empty fixed array.
2021 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedArray(); 2041 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedArray();
2022 2042
2023 // Allocate empty fixed double array. 2043 // Allocate empty fixed double array.
2024 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedDoubleArray(); 2044 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedDoubleArray();
2025 2045
2026 // Performs a minor collection in new generation. 2046 // Performs a minor collection in new generation.
2027 void Scavenge(); 2047 void Scavenge();
2028 2048
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after
2945 AssertNoAllocation no_alloc; // i.e. no gc allowed. 2965 AssertNoAllocation no_alloc; // i.e. no gc allowed.
2946 2966
2947 private: 2967 private:
2948 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2968 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2949 }; 2969 };
2950 #endif // DEBUG 2970 #endif // DEBUG
2951 2971
2952 } } // namespace v8::internal 2972 } } // namespace v8::internal
2953 2973
2954 #endif // V8_HEAP_H_ 2974 #endif // V8_HEAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698