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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 int extra_rset_bits = | 293 int extra_rset_bits = |
294 RoundUp((object_size - Page::kObjectAreaSize) / kPointerSize, | 294 RoundUp((object_size - Page::kObjectAreaSize) / kPointerSize, |
295 kBitsPerInt); | 295 kBitsPerInt); |
296 return extra_rset_bits / kBitsPerByte; | 296 return extra_rset_bits / kBitsPerByte; |
297 } | 297 } |
298 | 298 |
299 | 299 |
300 Object* NewSpace::AllocateRawInternal(int size_in_bytes, | 300 Object* NewSpace::AllocateRawInternal(int size_in_bytes, |
301 AllocationInfo* alloc_info) { | 301 AllocationInfo* alloc_info) { |
302 Address new_top = alloc_info->top + size_in_bytes; | 302 Address new_top = alloc_info->top + size_in_bytes; |
303 if (new_top > alloc_info->limit) { | 303 if (new_top > alloc_info->limit) return Failure::RetryAfterGC(size_in_bytes); |
304 return Failure::RetryAfterGC(size_in_bytes, identity()); | |
305 } | |
306 | 304 |
307 Object* obj = HeapObject::FromAddress(alloc_info->top); | 305 Object* obj = HeapObject::FromAddress(alloc_info->top); |
308 alloc_info->top = new_top; | 306 alloc_info->top = new_top; |
309 #ifdef DEBUG | 307 #ifdef DEBUG |
310 SemiSpace* space = | 308 SemiSpace* space = |
311 (alloc_info == &allocation_info_) ? &to_space_ : &from_space_; | 309 (alloc_info == &allocation_info_) ? &to_space_ : &from_space_; |
312 ASSERT(space->low() <= alloc_info->top | 310 ASSERT(space->low() <= alloc_info->top |
313 && alloc_info->top <= space->high() | 311 && alloc_info->top <= space->high() |
314 && alloc_info->limit == space->high()); | 312 && alloc_info->limit == space->high()); |
315 #endif | 313 #endif |
316 return obj; | 314 return obj; |
317 } | 315 } |
318 | 316 |
319 } } // namespace v8::internal | 317 } } // namespace v8::internal |
320 | 318 |
321 #endif // V8_SPACES_INL_H_ | 319 #endif // V8_SPACES_INL_H_ |
OLD | NEW |