| 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 // for all addresses in either semispace. | 254 // for all addresses in either semispace. |
| 255 static Address NewSpaceStart() { return new_space_.start(); } | 255 static Address NewSpaceStart() { return new_space_.start(); } |
| 256 static uint32_t NewSpaceMask() { return new_space_.mask(); } | 256 static uint32_t NewSpaceMask() { return new_space_.mask(); } |
| 257 static Address NewSpaceTop() { return new_space_.top(); } | 257 static Address NewSpaceTop() { return new_space_.top(); } |
| 258 | 258 |
| 259 static NewSpace* new_space() { return &new_space_; } | 259 static NewSpace* new_space() { return &new_space_; } |
| 260 static OldSpace* old_pointer_space() { return old_pointer_space_; } | 260 static OldSpace* old_pointer_space() { return old_pointer_space_; } |
| 261 static OldSpace* old_data_space() { return old_data_space_; } | 261 static OldSpace* old_data_space() { return old_data_space_; } |
| 262 static OldSpace* code_space() { return code_space_; } | 262 static OldSpace* code_space() { return code_space_; } |
| 263 static MapSpace* map_space() { return map_space_; } | 263 static MapSpace* map_space() { return map_space_; } |
| 264 static GlobalPropertyCellSpace* global_property_cell_space() { |
| 265 return global_property_cell_space_; } |
| 264 static LargeObjectSpace* lo_space() { return lo_space_; } | 266 static LargeObjectSpace* lo_space() { return lo_space_; } |
| 265 | 267 |
| 266 static bool always_allocate() { return always_allocate_scope_depth_ != 0; } | 268 static bool always_allocate() { return always_allocate_scope_depth_ != 0; } |
| 267 static Address always_allocate_scope_depth_address() { | 269 static Address always_allocate_scope_depth_address() { |
| 268 return reinterpret_cast<Address>(&always_allocate_scope_depth_); | 270 return reinterpret_cast<Address>(&always_allocate_scope_depth_); |
| 269 } | 271 } |
| 270 | 272 |
| 271 static Address* NewSpaceAllocationTopAddress() { | 273 static Address* NewSpaceAllocationTopAddress() { |
| 272 return new_space_.allocation_top_address(); | 274 return new_space_.allocation_top_address(); |
| 273 } | 275 } |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 | 832 |
| 831 static const int kMaxMapSpaceSize = 8*MB; | 833 static const int kMaxMapSpaceSize = 8*MB; |
| 832 | 834 |
| 833 static const int kMaxObjectSizeInNewSpace = 256*KB; | 835 static const int kMaxObjectSizeInNewSpace = 256*KB; |
| 834 | 836 |
| 835 static NewSpace new_space_; | 837 static NewSpace new_space_; |
| 836 static OldSpace* old_pointer_space_; | 838 static OldSpace* old_pointer_space_; |
| 837 static OldSpace* old_data_space_; | 839 static OldSpace* old_data_space_; |
| 838 static OldSpace* code_space_; | 840 static OldSpace* code_space_; |
| 839 static MapSpace* map_space_; | 841 static MapSpace* map_space_; |
| 842 static GlobalPropertyCellSpace* global_property_cell_space_; |
| 840 static LargeObjectSpace* lo_space_; | 843 static LargeObjectSpace* lo_space_; |
| 841 static HeapState gc_state_; | 844 static HeapState gc_state_; |
| 842 | 845 |
| 843 // Returns the size of object residing in non new spaces. | 846 // Returns the size of object residing in non new spaces. |
| 844 static int PromotedSpaceSize(); | 847 static int PromotedSpaceSize(); |
| 845 | 848 |
| 846 // Returns the amount of external memory registered since last global gc. | 849 // Returns the amount of external memory registered since last global gc. |
| 847 static int PromotedExternalMemorySize(); | 850 static int PromotedExternalMemorySize(); |
| 848 | 851 |
| 849 static int mc_count_; // how many mark-compact collections happened | 852 static int mc_count_; // how many mark-compact collections happened |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 // Returns either a Smi or a Number object from 'value'. If 'new_object' | 920 // Returns either a Smi or a Number object from 'value'. If 'new_object' |
| 918 // is false, it may return a preallocated immutable object. | 921 // is false, it may return a preallocated immutable object. |
| 919 static Object* SmiOrNumberFromDouble(double value, | 922 static Object* SmiOrNumberFromDouble(double value, |
| 920 bool new_object, | 923 bool new_object, |
| 921 PretenureFlag pretenure = NOT_TENURED); | 924 PretenureFlag pretenure = NOT_TENURED); |
| 922 | 925 |
| 923 // Allocate an uninitialized object in map space. The behavior is identical | 926 // Allocate an uninitialized object in map space. The behavior is identical |
| 924 // to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't | 927 // to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't |
| 925 // have to test the allocation space argument and (b) can reduce code size | 928 // have to test the allocation space argument and (b) can reduce code size |
| 926 // (since both AllocateRaw and AllocateRawMap are inlined). | 929 // (since both AllocateRaw and AllocateRawMap are inlined). |
| 927 static inline Object* AllocateRawMap(int size_in_bytes); | 930 static inline Object* AllocateRawMap(); |
| 931 |
| 932 // Allocate an uninitialized object in global property cell space. |
| 933 static inline Object* AllocateRawGlobalPropertyCell(); |
| 928 | 934 |
| 929 // Initializes a JSObject based on its map. | 935 // Initializes a JSObject based on its map. |
| 930 static void InitializeJSObjectFromMap(JSObject* obj, | 936 static void InitializeJSObjectFromMap(JSObject* obj, |
| 931 FixedArray* properties, | 937 FixedArray* properties, |
| 932 Map* map); | 938 Map* map); |
| 933 | 939 |
| 934 static bool CreateInitialMaps(); | 940 static bool CreateInitialMaps(); |
| 935 static bool CreateInitialObjects(); | 941 static bool CreateInitialObjects(); |
| 936 | 942 |
| 937 // These four Create*EntryStub functions are here because of a gcc-4.4 bug | 943 // These four Create*EntryStub functions are here because of a gcc-4.4 bug |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1401 int marked_count_; | 1407 int marked_count_; |
| 1402 | 1408 |
| 1403 // The count from the end of the previous full GC. Will be zero if there | 1409 // The count from the end of the previous full GC. Will be zero if there |
| 1404 // was no previous full GC. | 1410 // was no previous full GC. |
| 1405 int previous_marked_count_; | 1411 int previous_marked_count_; |
| 1406 }; | 1412 }; |
| 1407 | 1413 |
| 1408 } } // namespace v8::internal | 1414 } } // namespace v8::internal |
| 1409 | 1415 |
| 1410 #endif // V8_HEAP_H_ | 1416 #endif // V8_HEAP_H_ |
| OLD | NEW |