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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 InstanceType type = object->map()->instance_type(); | 139 InstanceType type = object->map()->instance_type(); |
140 ASSERT((type != CODE_TYPE) && (type != MAP_TYPE)); | 140 ASSERT((type != CODE_TYPE) && (type != MAP_TYPE)); |
141 bool has_pointers = | 141 bool has_pointers = |
142 type != HEAP_NUMBER_TYPE && | 142 type != HEAP_NUMBER_TYPE && |
143 (type >= FIRST_NONSTRING_TYPE || | 143 (type >= FIRST_NONSTRING_TYPE || |
144 String::cast(object)->representation_tag() != kSeqStringTag); | 144 String::cast(object)->representation_tag() != kSeqStringTag); |
145 return has_pointers ? old_pointer_space_ : old_data_space_; | 145 return has_pointers ? old_pointer_space_ : old_data_space_; |
146 } | 146 } |
147 | 147 |
148 | 148 |
149 #define GC_GREEDY_CHECK() \ | 149 #define GC_GREEDY_CHECK() \ |
150 ASSERT(!FLAG_gc_greedy \ | 150 ASSERT(!FLAG_gc_greedy || v8::internal::Heap::GarbageCollectionGreedyCheck()) |
151 || v8::internal::Heap::disallow_allocation_failure() \ | |
152 || v8::internal::Heap::CollectGarbage(0, NEW_SPACE)) | |
153 | |
154 | 151 |
155 // Do not use the identifier __object__ in a call to this macro. | 152 // Do not use the identifier __object__ in a call to this macro. |
156 // | 153 // |
157 // Call the function FUNCTION_CALL. If it fails with a RetryAfterGC | 154 // Call the function FUNCTION_CALL. If it fails with a RetryAfterGC |
158 // failure, call the garbage collector and retry the function. If the | 155 // failure, call the garbage collector and retry the function. If the |
159 // garbage collector cannot reclaim the required space or the second | 156 // garbage collector cannot reclaim the required space or the second |
160 // call fails with a RetryAfterGC failure, fail with out of memory. | 157 // call fails with a RetryAfterGC failure, fail with out of memory. |
161 // If there is any other failure, return a null handle. If either | 158 // If there is any other failure, return a null handle. If either |
162 // call succeeds, return a handle to the functions return value. | 159 // call succeeds, return a handle to the functions return value. |
163 // | 160 // |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 allocation_allowed_ = new_state; | 226 allocation_allowed_ = new_state; |
230 return old; | 227 return old; |
231 } | 228 } |
232 | 229 |
233 #endif | 230 #endif |
234 | 231 |
235 | 232 |
236 } } // namespace v8::internal | 233 } } // namespace v8::internal |
237 | 234 |
238 #endif // V8_HEAP_INL_H_ | 235 #endif // V8_HEAP_INL_H_ |
OLD | NEW |