| 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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 // we reserve twice the amount needed for those in order to ensure | 524 // we reserve twice the amount needed for those in order to ensure |
| 525 // that new space can be aligned to its size. | 525 // that new space can be aligned to its size. |
| 526 intptr_t MaxReserved() { | 526 intptr_t MaxReserved() { |
| 527 return 4 * reserved_semispace_size_ + max_old_generation_size_; | 527 return 4 * reserved_semispace_size_ + max_old_generation_size_; |
| 528 } | 528 } |
| 529 int MaxSemiSpaceSize() { return max_semispace_size_; } | 529 int MaxSemiSpaceSize() { return max_semispace_size_; } |
| 530 int ReservedSemiSpaceSize() { return reserved_semispace_size_; } | 530 int ReservedSemiSpaceSize() { return reserved_semispace_size_; } |
| 531 int InitialSemiSpaceSize() { return initial_semispace_size_; } | 531 int InitialSemiSpaceSize() { return initial_semispace_size_; } |
| 532 intptr_t MaxOldGenerationSize() { return max_old_generation_size_; } | 532 intptr_t MaxOldGenerationSize() { return max_old_generation_size_; } |
| 533 intptr_t MaxExecutableSize() { return max_executable_size_; } | 533 intptr_t MaxExecutableSize() { return max_executable_size_; } |
| 534 int MaxRegularSpaceAllocationSize() { return InitialSemiSpaceSize() * 4/5; } | |
| 535 | 534 |
| 536 // Returns the capacity of the heap in bytes w/o growing. Heap grows when | 535 // Returns the capacity of the heap in bytes w/o growing. Heap grows when |
| 537 // more spaces are needed until it reaches the limit. | 536 // more spaces are needed until it reaches the limit. |
| 538 intptr_t Capacity(); | 537 intptr_t Capacity(); |
| 539 | 538 |
| 540 // Returns the amount of memory currently committed for the heap. | 539 // Returns the amount of memory currently committed for the heap. |
| 541 intptr_t CommittedMemory(); | 540 intptr_t CommittedMemory(); |
| 542 | 541 |
| 543 // Returns the amount of executable memory currently committed for the heap. | 542 // Returns the amount of executable memory currently committed for the heap. |
| 544 intptr_t CommittedMemoryExecutable(); | 543 intptr_t CommittedMemoryExecutable(); |
| (...skipping 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2096 | 2095 |
| 2097 inline void UpdateOldSpaceLimits(); | 2096 inline void UpdateOldSpaceLimits(); |
| 2098 | 2097 |
| 2099 // Selects the proper allocation space depending on the given object | 2098 // Selects the proper allocation space depending on the given object |
| 2100 // size, pretenuring decision, and preferred old-space. | 2099 // size, pretenuring decision, and preferred old-space. |
| 2101 static AllocationSpace SelectSpace(int object_size, | 2100 static AllocationSpace SelectSpace(int object_size, |
| 2102 AllocationSpace preferred_old_space, | 2101 AllocationSpace preferred_old_space, |
| 2103 PretenureFlag pretenure) { | 2102 PretenureFlag pretenure) { |
| 2104 ASSERT(preferred_old_space == OLD_POINTER_SPACE || | 2103 ASSERT(preferred_old_space == OLD_POINTER_SPACE || |
| 2105 preferred_old_space == OLD_DATA_SPACE); | 2104 preferred_old_space == OLD_DATA_SPACE); |
| 2106 if (object_size > Page::kMaxNonCodeHeapObjectSize) return LO_SPACE; | 2105 if (object_size > Page::kMaxRegularHeapObjectSize) return LO_SPACE; |
| 2107 return (pretenure == TENURED) ? preferred_old_space : NEW_SPACE; | 2106 return (pretenure == TENURED) ? preferred_old_space : NEW_SPACE; |
| 2108 } | 2107 } |
| 2109 | 2108 |
| 2110 // Allocate an uninitialized fixed array. | 2109 // Allocate an uninitialized fixed array. |
| 2111 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray( | 2110 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray( |
| 2112 int length, PretenureFlag pretenure); | 2111 int length, PretenureFlag pretenure); |
| 2113 | 2112 |
| 2114 // Allocate an uninitialized fixed double array. | 2113 // Allocate an uninitialized fixed double array. |
| 2115 MUST_USE_RESULT MaybeObject* AllocateRawFixedDoubleArray( | 2114 MUST_USE_RESULT MaybeObject* AllocateRawFixedDoubleArray( |
| 2116 int length, PretenureFlag pretenure); | 2115 int length, PretenureFlag pretenure); |
| (...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3039 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 3038 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 3040 | 3039 |
| 3041 private: | 3040 private: |
| 3042 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 3041 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 3043 }; | 3042 }; |
| 3044 #endif // DEBUG | 3043 #endif // DEBUG |
| 3045 | 3044 |
| 3046 } } // namespace v8::internal | 3045 } } // namespace v8::internal |
| 3047 | 3046 |
| 3048 #endif // V8_HEAP_H_ | 3047 #endif // V8_HEAP_H_ |
| OLD | NEW |