| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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_SPACES_INL_H_ | 5 #ifndef V8_HEAP_SPACES_INL_H_ |
| 6 #define V8_HEAP_SPACES_INL_H_ | 6 #define V8_HEAP_SPACES_INL_H_ |
| 7 | 7 |
| 8 #include "src/heap/spaces.h" | 8 #include "src/heap/spaces.h" |
| 9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
| 10 #include "src/msan.h" | 10 #include "src/msan.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 int obj_size = obj->Size(); | 126 int obj_size = obj->Size(); |
| 127 cur_addr_ += obj_size; | 127 cur_addr_ += obj_size; |
| 128 DCHECK(cur_addr_ <= cur_end_); | 128 DCHECK(cur_addr_ <= cur_end_); |
| 129 // TODO(hpayer): Remove the debugging code. | 129 // TODO(hpayer): Remove the debugging code. |
| 130 if (cur_addr_ > cur_end_) { | 130 if (cur_addr_ > cur_end_) { |
| 131 space_->heap()->isolate()->PushStackTraceAndDie(0xaaaaaaaa, obj, NULL, | 131 space_->heap()->isolate()->PushStackTraceAndDie(0xaaaaaaaa, obj, NULL, |
| 132 obj_size); | 132 obj_size); |
| 133 } | 133 } |
| 134 | 134 |
| 135 if (!obj->IsFiller()) { | 135 if (!obj->IsFiller()) { |
| 136 if (obj->IsCode()) { | 136 DCHECK_OBJECT_SIZE(obj_size); |
| 137 DCHECK_EQ(space_, space_->heap()->code_space()); | |
| 138 DCHECK_CODEOBJECT_SIZE(obj_size, space_); | |
| 139 } else { | |
| 140 DCHECK_OBJECT_SIZE(obj_size); | |
| 141 } | |
| 142 return obj; | 137 return obj; |
| 143 } | 138 } |
| 144 } | 139 } |
| 145 return NULL; | 140 return NULL; |
| 146 } | 141 } |
| 147 | 142 |
| 148 | 143 |
| 149 // ----------------------------------------------------------------------------- | 144 // ----------------------------------------------------------------------------- |
| 150 // MemoryAllocator | 145 // MemoryAllocator |
| 151 | 146 |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 | 484 |
| 490 | 485 |
| 491 intptr_t LargeObjectSpace::Available() { | 486 intptr_t LargeObjectSpace::Available() { |
| 492 return ObjectSizeFor(heap()->isolate()->memory_allocator()->Available()); | 487 return ObjectSizeFor(heap()->isolate()->memory_allocator()->Available()); |
| 493 } | 488 } |
| 494 | 489 |
| 495 } // namespace internal | 490 } // namespace internal |
| 496 } // namespace v8 | 491 } // namespace v8 |
| 497 | 492 |
| 498 #endif // V8_HEAP_SPACES_INL_H_ | 493 #endif // V8_HEAP_SPACES_INL_H_ |
| OLD | NEW |