| 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 V(exec_symbol, "exec") \ | 195 V(exec_symbol, "exec") \ |
| 196 V(zero_symbol, "0") \ | 196 V(zero_symbol, "0") \ |
| 197 V(global_eval_symbol, "GlobalEval") \ | 197 V(global_eval_symbol, "GlobalEval") \ |
| 198 V(identity_hash_symbol, "v8::IdentityHash") \ | 198 V(identity_hash_symbol, "v8::IdentityHash") \ |
| 199 V(closure_symbol, "(closure)") | 199 V(closure_symbol, "(closure)") |
| 200 | 200 |
| 201 | 201 |
| 202 // Forward declaration of the GCTracer class. | 202 // Forward declaration of the GCTracer class. |
| 203 class GCTracer; | 203 class GCTracer; |
| 204 class HeapStats; | 204 class HeapStats; |
| 205 class Isolate; |
| 205 | 206 |
| 206 | 207 |
| 207 typedef String* (*ExternalStringTableUpdaterCallback)(Object** pointer); | 208 typedef String* (*ExternalStringTableUpdaterCallback)(Object** pointer); |
| 208 | 209 |
| 209 typedef bool (*DirtyRegionCallback)(Address start, | 210 typedef bool (*DirtyRegionCallback)(Address start, |
| 210 Address end, | 211 Address end, |
| 211 ObjectSlotCallback copy_object_func); | 212 ObjectSlotCallback copy_object_func); |
| 212 | 213 |
| 213 | 214 |
| 214 // The all static Heap captures the interface to the global object heap. | 215 // The all static Heap captures the interface to the global object heap. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 225 // also creates the basic non-mutable objects. | 226 // also creates the basic non-mutable objects. |
| 226 // Returns whether it succeeded. | 227 // Returns whether it succeeded. |
| 227 static bool Setup(bool create_heap_objects); | 228 static bool Setup(bool create_heap_objects); |
| 228 | 229 |
| 229 // Destroys all memory allocated by the heap. | 230 // Destroys all memory allocated by the heap. |
| 230 static void TearDown(); | 231 static void TearDown(); |
| 231 | 232 |
| 232 // Set the stack limit in the roots_ array. Some architectures generate | 233 // Set the stack limit in the roots_ array. Some architectures generate |
| 233 // code that looks here, because it is faster than loading from the static | 234 // code that looks here, because it is faster than loading from the static |
| 234 // jslimit_/real_jslimit_ variable in the StackGuard. | 235 // jslimit_/real_jslimit_ variable in the StackGuard. |
| 235 static void SetStackLimits(); | 236 void SetStackLimits(); |
| 236 | 237 |
| 237 // Returns whether Setup has been called. | 238 // Returns whether Setup has been called. |
| 238 static bool HasBeenSetup(); | 239 static bool HasBeenSetup(); |
| 239 | 240 |
| 240 // Returns the maximum amount of memory reserved for the heap. For | 241 // Returns the maximum amount of memory reserved for the heap. For |
| 241 // the young generation, we reserve 4 times the amount needed for a | 242 // the young generation, we reserve 4 times the amount needed for a |
| 242 // semi space. The young generation consists of two semi spaces and | 243 // semi space. The young generation consists of two semi spaces and |
| 243 // we reserve twice the amount needed for those in order to ensure | 244 // we reserve twice the amount needed for those in order to ensure |
| 244 // that new space can be aligned to its size. | 245 // that new space can be aligned to its size. |
| 245 static int MaxReserved() { | 246 static int MaxReserved() { |
| (...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 | 1014 |
| 1014 static int MaxObjectSizeInNewSpace() { return kMaxObjectSizeInNewSpace; } | 1015 static int MaxObjectSizeInNewSpace() { return kMaxObjectSizeInNewSpace; } |
| 1015 | 1016 |
| 1016 static void ClearJSFunctionResultCaches(); | 1017 static void ClearJSFunctionResultCaches(); |
| 1017 | 1018 |
| 1018 static GCTracer* tracer() { return tracer_; } | 1019 static GCTracer* tracer() { return tracer_; } |
| 1019 | 1020 |
| 1020 private: | 1021 private: |
| 1021 Heap(); | 1022 Heap(); |
| 1022 | 1023 |
| 1024 // TODO(isolates): Technically this can be calculated directly from |
| 1025 // any pointer to Heap. |
| 1026 Isolate* isolate_; |
| 1027 |
| 1023 static int reserved_semispace_size_; | 1028 static int reserved_semispace_size_; |
| 1024 static int max_semispace_size_; | 1029 static int max_semispace_size_; |
| 1025 static int initial_semispace_size_; | 1030 static int initial_semispace_size_; |
| 1026 static int max_old_generation_size_; | 1031 static int max_old_generation_size_; |
| 1027 static size_t code_range_size_; | 1032 static size_t code_range_size_; |
| 1028 | 1033 |
| 1029 // For keeping track of how much data has survived | 1034 // For keeping track of how much data has survived |
| 1030 // scavenge since last new space expansion. | 1035 // scavenge since last new space expansion. |
| 1031 static int survived_since_last_expansion_; | 1036 static int survived_since_last_expansion_; |
| 1032 | 1037 |
| (...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1926 | 1931 |
| 1927 // To speed up scavenge collections new space string are kept | 1932 // To speed up scavenge collections new space string are kept |
| 1928 // separate from old space strings. | 1933 // separate from old space strings. |
| 1929 static List<Object*> new_space_strings_; | 1934 static List<Object*> new_space_strings_; |
| 1930 static List<Object*> old_space_strings_; | 1935 static List<Object*> old_space_strings_; |
| 1931 }; | 1936 }; |
| 1932 | 1937 |
| 1933 } } // namespace v8::internal | 1938 } } // namespace v8::internal |
| 1934 | 1939 |
| 1935 #endif // V8_HEAP_H_ | 1940 #endif // V8_HEAP_H_ |
| OLD | NEW |