| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) { | 197 } else if (CELL_SPACE == space) { |
| 198 allocation = cell_space_->AllocateRaw(size_in_bytes); | 198 allocation = cell_space_->AllocateRaw(size_in_bytes); |
| 199 } else if (PROPERTY_CELL_SPACE == space) { | |
| 200 allocation = property_cell_space_->AllocateRaw(size_in_bytes); | |
| 201 } else { | 199 } else { |
| 202 DCHECK(MAP_SPACE == space); | 200 DCHECK(MAP_SPACE == space); |
| 203 allocation = map_space_->AllocateRaw(size_in_bytes); | 201 allocation = map_space_->AllocateRaw(size_in_bytes); |
| 204 } | 202 } |
| 205 if (allocation.To(&object)) { | 203 if (allocation.To(&object)) { |
| 206 OnAllocationEvent(object, size_in_bytes); | 204 OnAllocationEvent(object, size_in_bytes); |
| 207 } else { | 205 } else { |
| 208 old_gen_exhausted_ = true; | 206 old_gen_exhausted_ = true; |
| 209 } | 207 } |
| 210 return allocation; | 208 return allocation; |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 switch (src) { | 381 switch (src) { |
| 384 case NEW_SPACE: | 382 case NEW_SPACE: |
| 385 return dst == src || dst == OLD_SPACE; | 383 return dst == src || dst == OLD_SPACE; |
| 386 case OLD_SPACE: | 384 case OLD_SPACE: |
| 387 return dst == src && | 385 return dst == src && |
| 388 (dst == OLD_SPACE || obj->IsFiller() || obj->IsExternalString()); | 386 (dst == OLD_SPACE || obj->IsFiller() || obj->IsExternalString()); |
| 389 case CODE_SPACE: | 387 case CODE_SPACE: |
| 390 return dst == src && type == CODE_TYPE; | 388 return dst == src && type == CODE_TYPE; |
| 391 case MAP_SPACE: | 389 case MAP_SPACE: |
| 392 case CELL_SPACE: | 390 case CELL_SPACE: |
| 393 case PROPERTY_CELL_SPACE: | |
| 394 case LO_SPACE: | 391 case LO_SPACE: |
| 395 return false; | 392 return false; |
| 396 } | 393 } |
| 397 UNREACHABLE(); | 394 UNREACHABLE(); |
| 398 return false; | 395 return false; |
| 399 } | 396 } |
| 400 | 397 |
| 401 | 398 |
| 402 void Heap::CopyBlock(Address dst, Address src, int byte_size) { | 399 void Heap::CopyBlock(Address dst, Address src, int byte_size) { |
| 403 CopyWords(reinterpret_cast<Object**>(dst), reinterpret_cast<Object**>(src), | 400 CopyWords(reinterpret_cast<Object**>(dst), reinterpret_cast<Object**>(src), |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 | 687 |
| 691 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 688 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
| 692 for (Object** current = start; current < end; current++) { | 689 for (Object** current = start; current < end; current++) { |
| 693 CHECK((*current)->IsSmi()); | 690 CHECK((*current)->IsSmi()); |
| 694 } | 691 } |
| 695 } | 692 } |
| 696 } | 693 } |
| 697 } // namespace v8::internal | 694 } // namespace v8::internal |
| 698 | 695 |
| 699 #endif // V8_HEAP_HEAP_INL_H_ | 696 #endif // V8_HEAP_HEAP_INL_H_ |
| OLD | NEW |