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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 V(Map, hash_table_map) \ | 96 V(Map, hash_table_map) \ |
97 V(Map, context_map) \ | 97 V(Map, context_map) \ |
98 V(Map, catch_context_map) \ | 98 V(Map, catch_context_map) \ |
99 V(Map, global_context_map) \ | 99 V(Map, global_context_map) \ |
100 V(Map, code_map) \ | 100 V(Map, code_map) \ |
101 V(Map, oddball_map) \ | 101 V(Map, oddball_map) \ |
102 V(Map, global_property_cell_map) \ | 102 V(Map, global_property_cell_map) \ |
103 V(Map, boilerplate_function_map) \ | 103 V(Map, boilerplate_function_map) \ |
104 V(Map, shared_function_info_map) \ | 104 V(Map, shared_function_info_map) \ |
105 V(Map, proxy_map) \ | 105 V(Map, proxy_map) \ |
106 V(Map, one_word_filler_map) \ | 106 V(Map, one_pointer_filler_map) \ |
107 V(Map, two_word_filler_map) \ | 107 V(Map, two_pointer_filler_map) \ |
108 V(Object, nan_value) \ | 108 V(Object, nan_value) \ |
109 V(Object, undefined_value) \ | 109 V(Object, undefined_value) \ |
110 V(Object, minus_zero_value) \ | 110 V(Object, minus_zero_value) \ |
111 V(Object, null_value) \ | 111 V(Object, null_value) \ |
112 V(Object, true_value) \ | 112 V(Object, true_value) \ |
113 V(Object, false_value) \ | 113 V(Object, false_value) \ |
114 V(String, empty_string) \ | 114 V(String, empty_string) \ |
115 V(FixedArray, empty_fixed_array) \ | 115 V(FixedArray, empty_fixed_array) \ |
116 V(DescriptorArray, empty_descriptor_array) \ | 116 V(DescriptorArray, empty_descriptor_array) \ |
117 V(Object, the_hole_value) \ | 117 V(Object, the_hole_value) \ |
(...skipping 136 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 CellSpace* cell_space() { return cell_space_; } |
264 static LargeObjectSpace* lo_space() { return lo_space_; } | 265 static LargeObjectSpace* lo_space() { return lo_space_; } |
265 | 266 |
266 static bool always_allocate() { return always_allocate_scope_depth_ != 0; } | 267 static bool always_allocate() { return always_allocate_scope_depth_ != 0; } |
267 static Address always_allocate_scope_depth_address() { | 268 static Address always_allocate_scope_depth_address() { |
268 return reinterpret_cast<Address>(&always_allocate_scope_depth_); | 269 return reinterpret_cast<Address>(&always_allocate_scope_depth_); |
269 } | 270 } |
270 | 271 |
271 static Address* NewSpaceAllocationTopAddress() { | 272 static Address* NewSpaceAllocationTopAddress() { |
272 return new_space_.allocation_top_address(); | 273 return new_space_.allocation_top_address(); |
273 } | 274 } |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 | 831 |
831 static const int kMaxMapSpaceSize = 8*MB; | 832 static const int kMaxMapSpaceSize = 8*MB; |
832 | 833 |
833 static const int kMaxObjectSizeInNewSpace = 256*KB; | 834 static const int kMaxObjectSizeInNewSpace = 256*KB; |
834 | 835 |
835 static NewSpace new_space_; | 836 static NewSpace new_space_; |
836 static OldSpace* old_pointer_space_; | 837 static OldSpace* old_pointer_space_; |
837 static OldSpace* old_data_space_; | 838 static OldSpace* old_data_space_; |
838 static OldSpace* code_space_; | 839 static OldSpace* code_space_; |
839 static MapSpace* map_space_; | 840 static MapSpace* map_space_; |
| 841 static CellSpace* cell_space_; |
840 static LargeObjectSpace* lo_space_; | 842 static LargeObjectSpace* lo_space_; |
841 static HeapState gc_state_; | 843 static HeapState gc_state_; |
842 | 844 |
843 // Returns the size of object residing in non new spaces. | 845 // Returns the size of object residing in non new spaces. |
844 static int PromotedSpaceSize(); | 846 static int PromotedSpaceSize(); |
845 | 847 |
846 // Returns the amount of external memory registered since last global gc. | 848 // Returns the amount of external memory registered since last global gc. |
847 static int PromotedExternalMemorySize(); | 849 static int PromotedExternalMemorySize(); |
848 | 850 |
849 static int mc_count_; // how many mark-compact collections happened | 851 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' | 919 // Returns either a Smi or a Number object from 'value'. If 'new_object' |
918 // is false, it may return a preallocated immutable object. | 920 // is false, it may return a preallocated immutable object. |
919 static Object* SmiOrNumberFromDouble(double value, | 921 static Object* SmiOrNumberFromDouble(double value, |
920 bool new_object, | 922 bool new_object, |
921 PretenureFlag pretenure = NOT_TENURED); | 923 PretenureFlag pretenure = NOT_TENURED); |
922 | 924 |
923 // Allocate an uninitialized object in map space. The behavior is identical | 925 // 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 | 926 // 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 | 927 // have to test the allocation space argument and (b) can reduce code size |
926 // (since both AllocateRaw and AllocateRawMap are inlined). | 928 // (since both AllocateRaw and AllocateRawMap are inlined). |
927 static inline Object* AllocateRawMap(int size_in_bytes); | 929 static inline Object* AllocateRawMap(); |
| 930 |
| 931 // Allocate an uninitialized object in the global property cell space. |
| 932 static inline Object* AllocateRawCell(); |
928 | 933 |
929 // Initializes a JSObject based on its map. | 934 // Initializes a JSObject based on its map. |
930 static void InitializeJSObjectFromMap(JSObject* obj, | 935 static void InitializeJSObjectFromMap(JSObject* obj, |
931 FixedArray* properties, | 936 FixedArray* properties, |
932 Map* map); | 937 Map* map); |
933 | 938 |
934 static bool CreateInitialMaps(); | 939 static bool CreateInitialMaps(); |
935 static bool CreateInitialObjects(); | 940 static bool CreateInitialObjects(); |
936 | 941 |
937 // These four Create*EntryStub functions are here because of a gcc-4.4 bug | 942 // These four Create*EntryStub functions are here because of a gcc-4.4 bug |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1403 int marked_count_; | 1408 int marked_count_; |
1404 | 1409 |
1405 // The count from the end of the previous full GC. Will be zero if there | 1410 // The count from the end of the previous full GC. Will be zero if there |
1406 // was no previous full GC. | 1411 // was no previous full GC. |
1407 int previous_marked_count_; | 1412 int previous_marked_count_; |
1408 }; | 1413 }; |
1409 | 1414 |
1410 } } // namespace v8::internal | 1415 } } // namespace v8::internal |
1411 | 1416 |
1412 #endif // V8_HEAP_H_ | 1417 #endif // V8_HEAP_H_ |
OLD | NEW |