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 2401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2412 inline bool FromSpaceContains(Object* o) { return from_space_.Contains(o); } | 2412 inline bool FromSpaceContains(Object* o) { return from_space_.Contains(o); } |
2413 | 2413 |
2414 // Try to switch the active semispace to a new, empty, page. | 2414 // Try to switch the active semispace to a new, empty, page. |
2415 // Returns false if this isn't possible or reasonable (i.e., there | 2415 // Returns false if this isn't possible or reasonable (i.e., there |
2416 // are no pages, or the current page is already empty), or true | 2416 // are no pages, or the current page is already empty), or true |
2417 // if successful. | 2417 // if successful. |
2418 bool AddFreshPage(); | 2418 bool AddFreshPage(); |
2419 | 2419 |
2420 virtual bool ReserveSpace(int bytes); | 2420 virtual bool ReserveSpace(int bytes); |
2421 | 2421 |
2422 // Resizes a sequential string which must be the most recent thing that was | |
2423 // allocated in new space. | |
2424 template <typename StringType> | |
2425 inline void ShrinkStringAtAllocationBoundary(String* string, int len); | |
2426 | |
2427 #ifdef VERIFY_HEAP | 2422 #ifdef VERIFY_HEAP |
2428 // Verify the active semispace. | 2423 // Verify the active semispace. |
2429 virtual void Verify(); | 2424 virtual void Verify(); |
2430 #endif | 2425 #endif |
2431 | 2426 |
2432 #ifdef DEBUG | 2427 #ifdef DEBUG |
2433 // Print the active semispace. | 2428 // Print the active semispace. |
2434 virtual void Print() { to_space_.Print(); } | 2429 virtual void Print() { to_space_.Print(); } |
2435 #endif | 2430 #endif |
2436 | 2431 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2494 intptr_t inline_allocation_limit_step_; | 2489 intptr_t inline_allocation_limit_step_; |
2495 | 2490 |
2496 Address top_on_previous_step_; | 2491 Address top_on_previous_step_; |
2497 | 2492 |
2498 HistogramInfo* allocated_histogram_; | 2493 HistogramInfo* allocated_histogram_; |
2499 HistogramInfo* promoted_histogram_; | 2494 HistogramInfo* promoted_histogram_; |
2500 | 2495 |
2501 MUST_USE_RESULT MaybeObject* SlowAllocateRaw(int size_in_bytes); | 2496 MUST_USE_RESULT MaybeObject* SlowAllocateRaw(int size_in_bytes); |
2502 | 2497 |
2503 friend class SemiSpaceIterator; | 2498 friend class SemiSpaceIterator; |
| 2499 friend void SeqString::Truncate(int new_length); |
2504 | 2500 |
2505 public: | 2501 public: |
2506 TRACK_MEMORY("NewSpace") | 2502 TRACK_MEMORY("NewSpace") |
2507 }; | 2503 }; |
2508 | 2504 |
2509 | 2505 |
2510 // ----------------------------------------------------------------------------- | 2506 // ----------------------------------------------------------------------------- |
2511 // Old object space (excluding map objects) | 2507 // Old object space (excluding map objects) |
2512 | 2508 |
2513 class OldSpace : public PagedSpace { | 2509 class OldSpace : public PagedSpace { |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2831 } | 2827 } |
2832 // Must be small, since an iteration is used for lookup. | 2828 // Must be small, since an iteration is used for lookup. |
2833 static const int kMaxComments = 64; | 2829 static const int kMaxComments = 64; |
2834 }; | 2830 }; |
2835 #endif | 2831 #endif |
2836 | 2832 |
2837 | 2833 |
2838 } } // namespace v8::internal | 2834 } } // namespace v8::internal |
2839 | 2835 |
2840 #endif // V8_SPACES_H_ | 2836 #endif // V8_SPACES_H_ |
OLD | NEW |