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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 bool UncommitFromSpace() { return new_space_.UncommitFromSpace(); } | 522 bool UncommitFromSpace() { return new_space_.UncommitFromSpace(); } |
523 | 523 |
524 // Allocates and initializes a new JavaScript object based on a | 524 // Allocates and initializes a new JavaScript object based on a |
525 // constructor. | 525 // constructor. |
526 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 526 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
527 // failed. | 527 // failed. |
528 // Please note this does not perform a garbage collection. | 528 // Please note this does not perform a garbage collection. |
529 MUST_USE_RESULT MaybeObject* AllocateJSObject( | 529 MUST_USE_RESULT MaybeObject* AllocateJSObject( |
530 JSFunction* constructor, PretenureFlag pretenure = NOT_TENURED); | 530 JSFunction* constructor, PretenureFlag pretenure = NOT_TENURED); |
531 | 531 |
| 532 MUST_USE_RESULT MaybeObject* AllocateJSModule(); |
| 533 |
532 // Allocate a JSArray with no elements | 534 // Allocate a JSArray with no elements |
533 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray( | 535 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray( |
534 ElementsKind elements_kind, | 536 ElementsKind elements_kind, |
535 PretenureFlag pretenure = NOT_TENURED) { | 537 PretenureFlag pretenure = NOT_TENURED) { |
536 return AllocateJSArrayAndStorage(elements_kind, 0, 0, | 538 return AllocateJSArrayAndStorage(elements_kind, 0, 0, |
537 DONT_INITIALIZE_ARRAY_ELEMENTS, | 539 DONT_INITIALIZE_ARRAY_ELEMENTS, |
538 pretenure); | 540 pretenure); |
539 } | 541 } |
540 | 542 |
541 // Allocate a JSArray with a specified length but elements that are left | 543 // Allocate a JSArray with a specified length but elements that are left |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 PretenureFlag pretenure = NOT_TENURED); | 815 PretenureFlag pretenure = NOT_TENURED); |
814 | 816 |
815 // AllocateHashTable is identical to AllocateFixedArray except | 817 // AllocateHashTable is identical to AllocateFixedArray except |
816 // that the resulting object has hash_table_map as map. | 818 // that the resulting object has hash_table_map as map. |
817 MUST_USE_RESULT MaybeObject* AllocateHashTable( | 819 MUST_USE_RESULT MaybeObject* AllocateHashTable( |
818 int length, PretenureFlag pretenure = NOT_TENURED); | 820 int length, PretenureFlag pretenure = NOT_TENURED); |
819 | 821 |
820 // Allocate a global (but otherwise uninitialized) context. | 822 // Allocate a global (but otherwise uninitialized) context. |
821 MUST_USE_RESULT MaybeObject* AllocateGlobalContext(); | 823 MUST_USE_RESULT MaybeObject* AllocateGlobalContext(); |
822 | 824 |
| 825 // Allocate a module context. |
| 826 MUST_USE_RESULT MaybeObject* AllocateModuleContext(Context* previous, |
| 827 ScopeInfo* scope_info); |
| 828 |
823 // Allocate a function context. | 829 // Allocate a function context. |
824 MUST_USE_RESULT MaybeObject* AllocateFunctionContext(int length, | 830 MUST_USE_RESULT MaybeObject* AllocateFunctionContext(int length, |
825 JSFunction* function); | 831 JSFunction* function); |
826 | 832 |
827 // Allocate a catch context. | 833 // Allocate a catch context. |
828 MUST_USE_RESULT MaybeObject* AllocateCatchContext(JSFunction* function, | 834 MUST_USE_RESULT MaybeObject* AllocateCatchContext(JSFunction* function, |
829 Context* previous, | 835 Context* previous, |
830 String* name, | 836 String* name, |
831 Object* thrown_object); | 837 Object* thrown_object); |
832 // Allocate a 'with' context. | 838 // Allocate a 'with' context. |
(...skipping 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2707 AssertNoAllocation no_alloc; // i.e. no gc allowed. | 2713 AssertNoAllocation no_alloc; // i.e. no gc allowed. |
2708 | 2714 |
2709 private: | 2715 private: |
2710 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2716 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2711 }; | 2717 }; |
2712 #endif // DEBUG || LIVE_OBJECT_LIST | 2718 #endif // DEBUG || LIVE_OBJECT_LIST |
2713 | 2719 |
2714 } } // namespace v8::internal | 2720 } } // namespace v8::internal |
2715 | 2721 |
2716 #endif // V8_HEAP_H_ | 2722 #endif // V8_HEAP_H_ |
OLD | NEW |