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 DCHECK_OBJECT_SIZE(obj_size); | 136 if (obj->IsCode()) { |
| 137 DCHECK_EQ(space_, space_->heap()->code_space()); |
| 138 DCHECK_CODEOBJECT_SIZE(obj_size, space_); |
| 139 } else { |
| 140 DCHECK_OBJECT_SIZE(obj_size); |
| 141 } |
137 return obj; | 142 return obj; |
138 } | 143 } |
139 } | 144 } |
140 return NULL; | 145 return NULL; |
141 } | 146 } |
142 | 147 |
143 | 148 |
144 // ----------------------------------------------------------------------------- | 149 // ----------------------------------------------------------------------------- |
145 // MemoryAllocator | 150 // MemoryAllocator |
146 | 151 |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 | 489 |
485 | 490 |
486 intptr_t LargeObjectSpace::Available() { | 491 intptr_t LargeObjectSpace::Available() { |
487 return ObjectSizeFor(heap()->isolate()->memory_allocator()->Available()); | 492 return ObjectSizeFor(heap()->isolate()->memory_allocator()->Available()); |
488 } | 493 } |
489 | 494 |
490 } // namespace internal | 495 } // namespace internal |
491 } // namespace v8 | 496 } // namespace v8 |
492 | 497 |
493 #endif // V8_HEAP_SPACES_INL_H_ | 498 #endif // V8_HEAP_SPACES_INL_H_ |
OLD | NEW |