| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2142 int* free_global_handle_count; // 18 | 2142 int* free_global_handle_count; // 18 |
| 2143 intptr_t* memory_allocator_size; // 19 | 2143 intptr_t* memory_allocator_size; // 19 |
| 2144 intptr_t* memory_allocator_capacity; // 20 | 2144 intptr_t* memory_allocator_capacity; // 20 |
| 2145 int* objects_per_type; // 21 | 2145 int* objects_per_type; // 21 |
| 2146 int* size_per_type; // 22 | 2146 int* size_per_type; // 22 |
| 2147 int* os_error; // 23 | 2147 int* os_error; // 23 |
| 2148 int* end_marker; // 24 | 2148 int* end_marker; // 24 |
| 2149 }; | 2149 }; |
| 2150 | 2150 |
| 2151 | 2151 |
| 2152 #ifdef DEBUG |
| 2153 class DisallowAllocationFailure { |
| 2154 public: |
| 2155 inline DisallowAllocationFailure(); |
| 2156 inline ~DisallowAllocationFailure(); |
| 2157 |
| 2158 private: |
| 2159 bool old_state_; |
| 2160 }; |
| 2161 #endif |
| 2162 |
| 2163 |
| 2152 class AlwaysAllocateScope { | 2164 class AlwaysAllocateScope { |
| 2153 public: | 2165 public: |
| 2154 inline AlwaysAllocateScope(); | 2166 inline AlwaysAllocateScope(); |
| 2155 inline ~AlwaysAllocateScope(); | 2167 inline ~AlwaysAllocateScope(); |
| 2168 |
| 2169 #ifdef DEBUG |
| 2170 private: |
| 2171 // Implicitly disable artificial allocation failures. |
| 2172 DisallowAllocationFailure disallow_allocation_failure_; |
| 2173 #endif |
| 2156 }; | 2174 }; |
| 2157 | 2175 |
| 2158 | 2176 |
| 2159 class LinearAllocationScope { | 2177 class LinearAllocationScope { |
| 2160 public: | 2178 public: |
| 2161 inline LinearAllocationScope(); | 2179 inline LinearAllocationScope(); |
| 2162 inline ~LinearAllocationScope(); | 2180 inline ~LinearAllocationScope(); |
| 2163 }; | 2181 }; |
| 2164 | 2182 |
| 2165 | 2183 |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2390 }; | 2408 }; |
| 2391 | 2409 |
| 2392 Key keys_[kLength]; | 2410 Key keys_[kLength]; |
| 2393 int results_[kLength]; | 2411 int results_[kLength]; |
| 2394 | 2412 |
| 2395 friend class Isolate; | 2413 friend class Isolate; |
| 2396 DISALLOW_COPY_AND_ASSIGN(DescriptorLookupCache); | 2414 DISALLOW_COPY_AND_ASSIGN(DescriptorLookupCache); |
| 2397 }; | 2415 }; |
| 2398 | 2416 |
| 2399 | 2417 |
| 2400 #ifdef DEBUG | |
| 2401 class DisallowAllocationFailure { | |
| 2402 public: | |
| 2403 inline DisallowAllocationFailure(); | |
| 2404 inline ~DisallowAllocationFailure(); | |
| 2405 | |
| 2406 private: | |
| 2407 bool old_state_; | |
| 2408 }; | |
| 2409 #endif | |
| 2410 | |
| 2411 | |
| 2412 // A helper class to document/test C++ scopes where we do not | 2418 // A helper class to document/test C++ scopes where we do not |
| 2413 // expect a GC. Usage: | 2419 // expect a GC. Usage: |
| 2414 // | 2420 // |
| 2415 // /* Allocation not allowed: we cannot handle a GC in this scope. */ | 2421 // /* Allocation not allowed: we cannot handle a GC in this scope. */ |
| 2416 // { AssertNoAllocation nogc; | 2422 // { AssertNoAllocation nogc; |
| 2417 // ... | 2423 // ... |
| 2418 // } | 2424 // } |
| 2419 class AssertNoAllocation { | 2425 class AssertNoAllocation { |
| 2420 public: | 2426 public: |
| 2421 inline AssertNoAllocation(); | 2427 inline AssertNoAllocation(); |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2759 AssertNoAllocation no_alloc; // i.e. no gc allowed. | 2765 AssertNoAllocation no_alloc; // i.e. no gc allowed. |
| 2760 | 2766 |
| 2761 private: | 2767 private: |
| 2762 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2768 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2763 }; | 2769 }; |
| 2764 #endif // DEBUG || LIVE_OBJECT_LIST | 2770 #endif // DEBUG || LIVE_OBJECT_LIST |
| 2765 | 2771 |
| 2766 } } // namespace v8::internal | 2772 } } // namespace v8::internal |
| 2767 | 2773 |
| 2768 #endif // V8_HEAP_H_ | 2774 #endif // V8_HEAP_H_ |
| OLD | NEW |