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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 V(hidden_stack_trace_symbol, "v8::hidden_stack_trace") \ | 252 V(hidden_stack_trace_symbol, "v8::hidden_stack_trace") \ |
253 V(query_colon_symbol, "(?:)") | 253 V(query_colon_symbol, "(?:)") |
254 | 254 |
255 // Forward declarations. | 255 // Forward declarations. |
256 class GCTracer; | 256 class GCTracer; |
257 class HeapStats; | 257 class HeapStats; |
258 class Isolate; | 258 class Isolate; |
259 class WeakObjectRetainer; | 259 class WeakObjectRetainer; |
260 | 260 |
261 | 261 |
| 262 enum AllocationOriginTrackMode { |
| 263 DONT_TRACK_ALLOCATION_ORIGIN, |
| 264 TRACK_ALLOCATION_ORIGIN |
| 265 }; |
| 266 |
| 267 |
262 typedef String* (*ExternalStringTableUpdaterCallback)(Heap* heap, | 268 typedef String* (*ExternalStringTableUpdaterCallback)(Heap* heap, |
263 Object** pointer); | 269 Object** pointer); |
264 | 270 |
265 class StoreBufferRebuilder { | 271 class StoreBufferRebuilder { |
266 public: | 272 public: |
267 explicit StoreBufferRebuilder(StoreBuffer* store_buffer) | 273 explicit StoreBufferRebuilder(StoreBuffer* store_buffer) |
268 : store_buffer_(store_buffer) { | 274 : store_buffer_(store_buffer) { |
269 } | 275 } |
270 | 276 |
271 void Callback(MemoryChunk* page, StoreBufferEvent event); | 277 void Callback(MemoryChunk* page, StoreBufferEvent event); |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 MUST_USE_RESULT MaybeObject* AllocateJSObject( | 563 MUST_USE_RESULT MaybeObject* AllocateJSObject( |
558 JSFunction* constructor, PretenureFlag pretenure = NOT_TENURED); | 564 JSFunction* constructor, PretenureFlag pretenure = NOT_TENURED); |
559 | 565 |
560 MUST_USE_RESULT MaybeObject* AllocateJSModule(Context* context, | 566 MUST_USE_RESULT MaybeObject* AllocateJSModule(Context* context, |
561 ScopeInfo* scope_info); | 567 ScopeInfo* scope_info); |
562 | 568 |
563 // Allocate a JSArray with no elements | 569 // Allocate a JSArray with no elements |
564 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray( | 570 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray( |
565 ElementsKind elements_kind, | 571 ElementsKind elements_kind, |
566 PretenureFlag pretenure = NOT_TENURED) { | 572 PretenureFlag pretenure = NOT_TENURED) { |
567 return AllocateJSArrayAndStorage(elements_kind, 0, 0, | 573 return AllocateJSArrayAndStorage(elements_kind, 0, |
568 DONT_INITIALIZE_ARRAY_ELEMENTS, | 574 JSArray::kPreallocatedArrayElements, |
| 575 INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE, |
569 pretenure); | 576 pretenure); |
570 } | 577 } |
571 | 578 |
572 // Allocate a JSArray with a specified length but elements that are left | 579 // Allocate a JSArray with a specified length but elements that are left |
573 // uninitialized. | 580 // uninitialized. |
574 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorage( | 581 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorage( |
575 ElementsKind elements_kind, | 582 ElementsKind elements_kind, |
576 int length, | 583 int length, |
577 int capacity, | 584 int capacity, |
578 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS, | 585 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS, |
579 PretenureFlag pretenure = NOT_TENURED); | 586 PretenureFlag pretenure = NOT_TENURED); |
580 | 587 |
581 // Allocate a JSArray with no elements | 588 // Allocate a JSArray with no elements |
582 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithElements( | 589 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithElements( |
583 FixedArrayBase* array_base, | 590 FixedArrayBase* array_base, |
584 ElementsKind elements_kind, | 591 ElementsKind elements_kind, |
585 PretenureFlag pretenure = NOT_TENURED); | 592 PretenureFlag pretenure = NOT_TENURED); |
586 | 593 |
587 // Allocates and initializes a new global object based on a constructor. | 594 // Allocates and initializes a new global object based on a constructor. |
588 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 595 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
589 // failed. | 596 // failed. |
590 // Please note this does not perform a garbage collection. | 597 // Please note this does not perform a garbage collection. |
591 MUST_USE_RESULT MaybeObject* AllocateGlobalObject(JSFunction* constructor); | 598 MUST_USE_RESULT MaybeObject* AllocateGlobalObject(JSFunction* constructor); |
592 | 599 |
593 // Returns a deep copy of the JavaScript object. | 600 // Returns a deep copy of the JavaScript object. |
594 // Properties and elements are copied too. | 601 // Properties and elements are copied too. |
595 // Returns failure if allocation failed. | 602 // Returns failure if allocation failed. |
596 MUST_USE_RESULT MaybeObject* CopyJSObject(JSObject* source); | 603 MUST_USE_RESULT MaybeObject* CopyJSObject( |
| 604 JSObject* source, |
| 605 AllocationOriginTrackMode mode = DONT_TRACK_ALLOCATION_ORIGIN); |
597 | 606 |
598 // Allocates the function prototype. | 607 // Allocates the function prototype. |
599 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 608 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
600 // failed. | 609 // failed. |
601 // Please note this does not perform a garbage collection. | 610 // Please note this does not perform a garbage collection. |
602 MUST_USE_RESULT MaybeObject* AllocateFunctionPrototype(JSFunction* function); | 611 MUST_USE_RESULT MaybeObject* AllocateFunctionPrototype(JSFunction* function); |
603 | 612 |
604 // Allocates a Harmony proxy or function proxy. | 613 // Allocates a Harmony proxy or function proxy. |
605 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 614 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
606 // failed. | 615 // failed. |
(...skipping 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2818 AssertNoAllocation no_alloc; // i.e. no gc allowed. | 2827 AssertNoAllocation no_alloc; // i.e. no gc allowed. |
2819 | 2828 |
2820 private: | 2829 private: |
2821 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2830 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2822 }; | 2831 }; |
2823 #endif // DEBUG || LIVE_OBJECT_LIST | 2832 #endif // DEBUG || LIVE_OBJECT_LIST |
2824 | 2833 |
2825 } } // namespace v8::internal | 2834 } } // namespace v8::internal |
2826 | 2835 |
2827 #endif // V8_HEAP_H_ | 2836 #endif // V8_HEAP_H_ |
OLD | NEW |