| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 109 } |
| 110 | 110 |
| 111 | 111 |
| 112 Object* Heap::AllocateRawMap() { | 112 Object* Heap::AllocateRawMap() { |
| 113 #ifdef DEBUG | 113 #ifdef DEBUG |
| 114 Counters::objs_since_last_full.Increment(); | 114 Counters::objs_since_last_full.Increment(); |
| 115 Counters::objs_since_last_young.Increment(); | 115 Counters::objs_since_last_young.Increment(); |
| 116 #endif | 116 #endif |
| 117 Object* result = map_space_->AllocateRaw(Map::kSize); | 117 Object* result = map_space_->AllocateRaw(Map::kSize); |
| 118 if (result->IsFailure()) old_gen_exhausted_ = true; | 118 if (result->IsFailure()) old_gen_exhausted_ = true; |
| 119 #ifdef DEBUG |
| 120 if (!result->IsFailure()) { |
| 121 // Maps have their own alignment. |
| 122 CHECK((OffsetFrom(result) & kMapAlignmentMask) == kHeapObjectTag); |
| 123 } |
| 124 #endif |
| 119 return result; | 125 return result; |
| 120 } | 126 } |
| 121 | 127 |
| 122 | 128 |
| 123 Object* Heap::AllocateRawCell() { | 129 Object* Heap::AllocateRawCell() { |
| 124 #ifdef DEBUG | 130 #ifdef DEBUG |
| 125 Counters::objs_since_last_full.Increment(); | 131 Counters::objs_since_last_full.Increment(); |
| 126 Counters::objs_since_last_young.Increment(); | 132 Counters::objs_since_last_young.Increment(); |
| 127 #endif | 133 #endif |
| 128 Object* result = cell_space_->AllocateRaw(JSGlobalPropertyCell::kSize); | 134 Object* result = cell_space_->AllocateRaw(JSGlobalPropertyCell::kSize); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 allocation_allowed_ = new_state; | 323 allocation_allowed_ = new_state; |
| 318 return old; | 324 return old; |
| 319 } | 325 } |
| 320 | 326 |
| 321 #endif | 327 #endif |
| 322 | 328 |
| 323 | 329 |
| 324 } } // namespace v8::internal | 330 } } // namespace v8::internal |
| 325 | 331 |
| 326 #endif // V8_HEAP_INL_H_ | 332 #endif // V8_HEAP_INL_H_ |
| OLD | NEW |