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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 | 595 |
596 MUST_USE_RESULT MaybeObject* AllocateJSModule(Context* context, | 596 MUST_USE_RESULT MaybeObject* AllocateJSModule(Context* context, |
597 ScopeInfo* scope_info); | 597 ScopeInfo* scope_info); |
598 | 598 |
599 // Allocate a JSArray with no elements | 599 // Allocate a JSArray with no elements |
600 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray( | 600 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray( |
601 ElementsKind elements_kind, | 601 ElementsKind elements_kind, |
602 AllocationSiteMode allocation_site_mode = DONT_TRACK_ALLOCATION_SITE, | 602 AllocationSiteMode allocation_site_mode = DONT_TRACK_ALLOCATION_SITE, |
603 Handle<Object> *allocation_site_payload = NULL, | 603 Handle<Object> *allocation_site_payload = NULL, |
604 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. | |
607 return AllocateJSArrayAndStorage(elements_kind, 0, 0, | 605 return AllocateJSArrayAndStorage(elements_kind, 0, 0, |
608 allocation_site_mode, | 606 allocation_site_mode, |
609 allocation_site_payload, | 607 allocation_site_payload, |
610 DONT_INITIALIZE_ARRAY_ELEMENTS, | 608 DONT_INITIALIZE_ARRAY_ELEMENTS, |
611 pretenure); | 609 pretenure); |
612 } | 610 } |
613 | 611 |
614 // Allocate a JSArray with a specified length but elements that are left | 612 // Allocate a JSArray with a specified length but elements that are left |
615 // uninitialized. | 613 // uninitialized. |
616 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorage( | 614 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorage( |
617 ElementsKind elements_kind, | 615 ElementsKind elements_kind, |
618 int length, | 616 int length, |
619 int capacity, | 617 int capacity, |
620 AllocationSiteMode allocation_site_info_mode = | 618 AllocationSiteMode allocation_site_info_mode = |
621 DONT_TRACK_ALLOCATION_SITE, | 619 DONT_TRACK_ALLOCATION_SITE, |
622 Handle<Object> *allocation_site_payload = NULL, | 620 Handle<Object> *allocation_site_payload = NULL, |
623 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS, | 621 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS, |
624 PretenureFlag pretenure = NOT_TENURED); | 622 PretenureFlag pretenure = NOT_TENURED); |
625 | 623 |
| 624 MUST_USE_RESULT MaybeObject* AllocateJSArrayStorage( |
| 625 JSArray* array, |
| 626 int length, |
| 627 int capacity, |
| 628 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS); |
| 629 |
626 // Allocate a JSArray with no elements | 630 // Allocate a JSArray with no elements |
627 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithElements( | 631 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithElements( |
628 FixedArrayBase* array_base, | 632 FixedArrayBase* array_base, |
629 ElementsKind elements_kind, | 633 ElementsKind elements_kind, |
630 int length, | 634 int length, |
631 PretenureFlag pretenure = NOT_TENURED); | 635 PretenureFlag pretenure = NOT_TENURED); |
632 | 636 |
633 // Allocates and initializes a new global object based on a constructor. | 637 // Allocates and initializes a new global object based on a constructor. |
634 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 638 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
635 // failed. | 639 // failed. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 // Please note this does not perform a garbage collection. | 687 // Please note this does not perform a garbage collection. |
684 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMap( | 688 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMap( |
685 Map* map, PretenureFlag pretenure = NOT_TENURED, | 689 Map* map, PretenureFlag pretenure = NOT_TENURED, |
686 AllocationSiteMode mode = DONT_TRACK_ALLOCATION_SITE, | 690 AllocationSiteMode mode = DONT_TRACK_ALLOCATION_SITE, |
687 Handle<Object>* allocation_site_info_payload = NULL); | 691 Handle<Object>* allocation_site_info_payload = NULL); |
688 | 692 |
689 // Allocates a heap object based on the map. | 693 // Allocates a heap object based on the map. |
690 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 694 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
691 // failed. | 695 // failed. |
692 // Please note this function does not perform a garbage collection. | 696 // Please note this function does not perform a garbage collection. |
693 MUST_USE_RESULT MaybeObject* Allocate(Map* map, AllocationSpace space); | 697 MUST_USE_RESULT MaybeObject* Allocate(Map* map, AllocationSpace space, |
694 | 698 AllocationSiteMode mode = DONT_TRACK_ALLOCATION_SITE, |
695 MUST_USE_RESULT MaybeObject* AllocateWithAllocationSiteInfo(Map* map, | 699 Handle<Object>* allocation_site_info_payload = NULL); |
696 AllocationSpace space, | |
697 Handle<Object>* allocation_site_info_payload); | |
698 | 700 |
699 // Allocates a JS Map in the heap. | 701 // Allocates a JS Map in the heap. |
700 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 702 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
701 // failed. | 703 // failed. |
702 // Please note this function does not perform a garbage collection. | 704 // Please note this function does not perform a garbage collection. |
703 MUST_USE_RESULT MaybeObject* AllocateMap( | 705 MUST_USE_RESULT MaybeObject* AllocateMap( |
704 InstanceType instance_type, | 706 InstanceType instance_type, |
705 int instance_size, | 707 int instance_size, |
706 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND); | 708 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND); |
707 | 709 |
(...skipping 2257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2965 AssertNoAllocation no_alloc; // i.e. no gc allowed. | 2967 AssertNoAllocation no_alloc; // i.e. no gc allowed. |
2966 | 2968 |
2967 private: | 2969 private: |
2968 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2970 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2969 }; | 2971 }; |
2970 #endif // DEBUG | 2972 #endif // DEBUG |
2971 | 2973 |
2972 } } // namespace v8::internal | 2974 } } // namespace v8::internal |
2973 | 2975 |
2974 #endif // V8_HEAP_H_ | 2976 #endif // V8_HEAP_H_ |
OLD | NEW |