OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 | 427 |
428 Heap* heap_; | 428 Heap* heap_; |
429 | 429 |
430 DISALLOW_COPY_AND_ASSIGN(ExternalStringTable); | 430 DISALLOW_COPY_AND_ASSIGN(ExternalStringTable); |
431 }; | 431 }; |
432 | 432 |
433 | 433 |
434 class Heap { | 434 class Heap { |
435 public: | 435 public: |
436 // Configure heap size before setup. Return false if the heap has been | 436 // Configure heap size before setup. Return false if the heap has been |
437 // setup already. | 437 // set up already. |
438 bool ConfigureHeap(int max_semispace_size, | 438 bool ConfigureHeap(int max_semispace_size, |
439 intptr_t max_old_gen_size, | 439 intptr_t max_old_gen_size, |
440 intptr_t max_executable_size); | 440 intptr_t max_executable_size); |
441 bool ConfigureHeapDefault(); | 441 bool ConfigureHeapDefault(); |
442 | 442 |
443 // Initializes the global object heap. If create_heap_objects is true, | 443 // Initializes the global object heap. If create_heap_objects is true, |
444 // also creates the basic non-mutable objects. | 444 // also creates the basic non-mutable objects. |
445 // Returns whether it succeeded. | 445 // Returns whether it succeeded. |
446 bool Setup(bool create_heap_objects); | 446 bool SetUp(bool create_heap_objects); |
447 | 447 |
448 // Destroys all memory allocated by the heap. | 448 // Destroys all memory allocated by the heap. |
449 void TearDown(); | 449 void TearDown(); |
450 | 450 |
451 // Set the stack limit in the roots_ array. Some architectures generate | 451 // Set the stack limit in the roots_ array. Some architectures generate |
452 // code that looks here, because it is faster than loading from the static | 452 // code that looks here, because it is faster than loading from the static |
453 // jslimit_/real_jslimit_ variable in the StackGuard. | 453 // jslimit_/real_jslimit_ variable in the StackGuard. |
454 void SetStackLimits(); | 454 void SetStackLimits(); |
455 | 455 |
456 // Returns whether Setup has been called. | 456 // Returns whether SetUp has been called. |
457 bool HasBeenSetup(); | 457 bool HasBeenSetUp(); |
458 | 458 |
459 // Returns the maximum amount of memory reserved for the heap. For | 459 // Returns the maximum amount of memory reserved for the heap. For |
460 // the young generation, we reserve 4 times the amount needed for a | 460 // the young generation, we reserve 4 times the amount needed for a |
461 // semi space. The young generation consists of two semi spaces and | 461 // semi space. The young generation consists of two semi spaces and |
462 // we reserve twice the amount needed for those in order to ensure | 462 // we reserve twice the amount needed for those in order to ensure |
463 // that new space can be aligned to its size. | 463 // that new space can be aligned to its size. |
464 intptr_t MaxReserved() { | 464 intptr_t MaxReserved() { |
465 return 4 * reserved_semispace_size_ + max_old_generation_size_; | 465 return 4 * reserved_semispace_size_ + max_old_generation_size_; |
466 } | 466 } |
467 int MaxSemiSpaceSize() { return max_semispace_size_; } | 467 int MaxSemiSpaceSize() { return max_semispace_size_; } |
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1904 unsigned int gc_count_at_last_idle_gc_; | 1904 unsigned int gc_count_at_last_idle_gc_; |
1905 int scavenges_since_last_idle_round_; | 1905 int scavenges_since_last_idle_round_; |
1906 | 1906 |
1907 static const int kMaxMarkSweepsInIdleRound = 7; | 1907 static const int kMaxMarkSweepsInIdleRound = 7; |
1908 static const int kIdleScavengeThreshold = 5; | 1908 static const int kIdleScavengeThreshold = 5; |
1909 | 1909 |
1910 // Shared state read by the scavenge collector and set by ScavengeObject. | 1910 // Shared state read by the scavenge collector and set by ScavengeObject. |
1911 PromotionQueue promotion_queue_; | 1911 PromotionQueue promotion_queue_; |
1912 | 1912 |
1913 // Flag is set when the heap has been configured. The heap can be repeatedly | 1913 // Flag is set when the heap has been configured. The heap can be repeatedly |
1914 // configured through the API until it is setup. | 1914 // configured through the API until it is set up. |
1915 bool configured_; | 1915 bool configured_; |
1916 | 1916 |
1917 ExternalStringTable external_string_table_; | 1917 ExternalStringTable external_string_table_; |
1918 | 1918 |
1919 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_; | 1919 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_; |
1920 | 1920 |
1921 MemoryChunk* chunks_queued_for_free_; | 1921 MemoryChunk* chunks_queued_for_free_; |
1922 | 1922 |
1923 friend class Factory; | 1923 friend class Factory; |
1924 friend class GCTracer; | 1924 friend class GCTracer; |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2610 | 2610 |
2611 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2611 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2612 }; | 2612 }; |
2613 #endif // DEBUG || LIVE_OBJECT_LIST | 2613 #endif // DEBUG || LIVE_OBJECT_LIST |
2614 | 2614 |
2615 } } // namespace v8::internal | 2615 } } // namespace v8::internal |
2616 | 2616 |
2617 #undef HEAP | 2617 #undef HEAP |
2618 | 2618 |
2619 #endif // V8_HEAP_H_ | 2619 #endif // V8_HEAP_H_ |
OLD | NEW |