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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) { |
304 return Failure::RetryAfterGC(size_in_bytes, identity()); | 304 return Failure::RetryAfterGC(size_in_bytes, identity()); |
305 } | 305 } |
306 | 306 |
307 Object* obj = HeapObject::FromAddress(alloc_info->top); | 307 Object* obj = HeapObject::FromAddress(alloc_info->top); |
308 alloc_info->top = new_top; | 308 alloc_info->top = new_top; |
309 #ifdef DEBUG | 309 #ifdef DEBUG |
310 SemiSpace* space = | 310 SemiSpace* space = |
311 (alloc_info == &allocation_info_) ? to_space_ : from_space_; | 311 (alloc_info == &allocation_info_) ? &to_space_ : &from_space_; |
312 ASSERT(space->low() <= alloc_info->top | 312 ASSERT(space->low() <= alloc_info->top |
313 && alloc_info->top <= space->high() | 313 && alloc_info->top <= space->high() |
314 && alloc_info->limit == space->high()); | 314 && alloc_info->limit == space->high()); |
315 #endif | 315 #endif |
316 return obj; | 316 return obj; |
317 } | 317 } |
318 | 318 |
319 } } // namespace v8::internal | 319 } } // namespace v8::internal |
320 | 320 |
321 #endif // V8_SPACES_INL_H_ | 321 #endif // V8_SPACES_INL_H_ |
OLD | NEW |