| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 215 |
| 216 #define CALL_AND_RETRY(FUNCTION_CALL, RETURN_VALUE, RETURN_EMPTY) \ | 216 #define CALL_AND_RETRY(FUNCTION_CALL, RETURN_VALUE, RETURN_EMPTY) \ |
| 217 do { \ | 217 do { \ |
| 218 GC_GREEDY_CHECK(); \ | 218 GC_GREEDY_CHECK(); \ |
| 219 Object* __object__ = FUNCTION_CALL; \ | 219 Object* __object__ = FUNCTION_CALL; \ |
| 220 if (!__object__->IsFailure()) return RETURN_VALUE; \ | 220 if (!__object__->IsFailure()) return RETURN_VALUE; \ |
| 221 if (__object__->IsOutOfMemoryFailure()) { \ | 221 if (__object__->IsOutOfMemoryFailure()) { \ |
| 222 v8::internal::V8::FatalProcessOutOfMemory("CALL_AND_RETRY_0"); \ | 222 v8::internal::V8::FatalProcessOutOfMemory("CALL_AND_RETRY_0"); \ |
| 223 } \ | 223 } \ |
| 224 if (!__object__->IsRetryAfterGC()) return RETURN_EMPTY; \ | 224 if (!__object__->IsRetryAfterGC()) return RETURN_EMPTY; \ |
| 225 if (!Heap::CollectGarbage( \ | 225 Heap::CollectGarbage(Failure::cast(__object__)->requested(), \ |
| 226 Failure::cast(__object__)->requested(), \ | 226 Failure::cast(__object__)->allocation_space()); \ |
| 227 Failure::cast(__object__)->allocation_space())) { \ | |
| 228 v8::internal::V8::FatalProcessOutOfMemory("CALL_AND_RETRY_1"); \ | |
| 229 return RETURN_EMPTY; \ | |
| 230 } \ | |
| 231 __object__ = FUNCTION_CALL; \ | 227 __object__ = FUNCTION_CALL; \ |
| 232 if (!__object__->IsFailure()) return RETURN_VALUE; \ | 228 if (!__object__->IsFailure()) return RETURN_VALUE; \ |
| 233 if (__object__->IsOutOfMemoryFailure()) { \ | 229 if (__object__->IsOutOfMemoryFailure()) { \ |
| 234 v8::internal::V8::FatalProcessOutOfMemory("CALL_AND_RETRY_2"); \ | 230 v8::internal::V8::FatalProcessOutOfMemory("CALL_AND_RETRY_2"); \ |
| 235 } \ | 231 } \ |
| 236 if (!__object__->IsRetryAfterGC()) return RETURN_EMPTY; \ | 232 if (!__object__->IsRetryAfterGC()) return RETURN_EMPTY; \ |
| 237 Counters::gc_last_resort_from_handles.Increment(); \ | 233 Counters::gc_last_resort_from_handles.Increment(); \ |
| 238 Heap::CollectAllGarbage(); \ | 234 Heap::CollectAllGarbage(); \ |
| 239 { \ | 235 { \ |
| 240 AlwaysAllocateScope __scope__; \ | 236 AlwaysAllocateScope __scope__; \ |
| (...skipping 26 matching lines...) Expand all Loading... |
| 267 allocation_allowed_ = new_state; | 263 allocation_allowed_ = new_state; |
| 268 return old; | 264 return old; |
| 269 } | 265 } |
| 270 | 266 |
| 271 #endif | 267 #endif |
| 272 | 268 |
| 273 | 269 |
| 274 } } // namespace v8::internal | 270 } } // namespace v8::internal |
| 275 | 271 |
| 276 #endif // V8_HEAP_INL_H_ | 272 #endif // V8_HEAP_INL_H_ |
| OLD | NEW |