| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_HEAP_HEAP_INL_H_ | 5 #ifndef V8_HEAP_HEAP_INL_H_ |
| 6 #define V8_HEAP_HEAP_INL_H_ | 6 #define V8_HEAP_HEAP_INL_H_ |
| 7 | 7 |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 allocation = old_space_->AllocateRaw(size_in_bytes); | 187 allocation = old_space_->AllocateRaw(size_in_bytes); |
| 188 } else if (CODE_SPACE == space) { | 188 } else if (CODE_SPACE == space) { |
| 189 if (size_in_bytes <= code_space()->AreaSize()) { | 189 if (size_in_bytes <= code_space()->AreaSize()) { |
| 190 allocation = code_space_->AllocateRaw(size_in_bytes); | 190 allocation = code_space_->AllocateRaw(size_in_bytes); |
| 191 } else { | 191 } else { |
| 192 // Large code objects are allocated in large object space. | 192 // Large code objects are allocated in large object space. |
| 193 allocation = lo_space_->AllocateRaw(size_in_bytes, EXECUTABLE); | 193 allocation = lo_space_->AllocateRaw(size_in_bytes, EXECUTABLE); |
| 194 } | 194 } |
| 195 } else if (LO_SPACE == space) { | 195 } else if (LO_SPACE == space) { |
| 196 allocation = lo_space_->AllocateRaw(size_in_bytes, NOT_EXECUTABLE); | 196 allocation = lo_space_->AllocateRaw(size_in_bytes, NOT_EXECUTABLE); |
| 197 } else if (CELL_SPACE == space) { |
| 198 allocation = cell_space_->AllocateRaw(size_in_bytes); |
| 197 } else { | 199 } else { |
| 198 DCHECK(MAP_SPACE == space); | 200 DCHECK(MAP_SPACE == space); |
| 199 allocation = map_space_->AllocateRaw(size_in_bytes); | 201 allocation = map_space_->AllocateRaw(size_in_bytes); |
| 200 } | 202 } |
| 201 if (allocation.To(&object)) { | 203 if (allocation.To(&object)) { |
| 202 OnAllocationEvent(object, size_in_bytes); | 204 OnAllocationEvent(object, size_in_bytes); |
| 203 } else { | 205 } else { |
| 204 old_gen_exhausted_ = true; | 206 old_gen_exhausted_ = true; |
| 205 } | 207 } |
| 206 return allocation; | 208 return allocation; |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 AllocationSpace src = chunk->owner()->identity(); | 380 AllocationSpace src = chunk->owner()->identity(); |
| 379 switch (src) { | 381 switch (src) { |
| 380 case NEW_SPACE: | 382 case NEW_SPACE: |
| 381 return dst == src || dst == OLD_SPACE; | 383 return dst == src || dst == OLD_SPACE; |
| 382 case OLD_SPACE: | 384 case OLD_SPACE: |
| 383 return dst == src && | 385 return dst == src && |
| 384 (dst == OLD_SPACE || obj->IsFiller() || obj->IsExternalString()); | 386 (dst == OLD_SPACE || obj->IsFiller() || obj->IsExternalString()); |
| 385 case CODE_SPACE: | 387 case CODE_SPACE: |
| 386 return dst == src && type == CODE_TYPE; | 388 return dst == src && type == CODE_TYPE; |
| 387 case MAP_SPACE: | 389 case MAP_SPACE: |
| 390 case CELL_SPACE: |
| 388 case LO_SPACE: | 391 case LO_SPACE: |
| 389 return false; | 392 return false; |
| 390 } | 393 } |
| 391 UNREACHABLE(); | 394 UNREACHABLE(); |
| 392 return false; | 395 return false; |
| 393 } | 396 } |
| 394 | 397 |
| 395 | 398 |
| 396 void Heap::CopyBlock(Address dst, Address src, int byte_size) { | 399 void Heap::CopyBlock(Address dst, Address src, int byte_size) { |
| 397 CopyWords(reinterpret_cast<Object**>(dst), reinterpret_cast<Object**>(src), | 400 CopyWords(reinterpret_cast<Object**>(dst), reinterpret_cast<Object**>(src), |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 | 681 |
| 679 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 682 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
| 680 for (Object** current = start; current < end; current++) { | 683 for (Object** current = start; current < end; current++) { |
| 681 CHECK((*current)->IsSmi()); | 684 CHECK((*current)->IsSmi()); |
| 682 } | 685 } |
| 683 } | 686 } |
| 684 } | 687 } |
| 685 } // namespace v8::internal | 688 } // namespace v8::internal |
| 686 | 689 |
| 687 #endif // V8_HEAP_HEAP_INL_H_ | 690 #endif // V8_HEAP_HEAP_INL_H_ |
| OLD | NEW |