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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 V(Map, one_pointer_filler_map, OnePointerFillerMap) \ | 53 V(Map, one_pointer_filler_map, OnePointerFillerMap) \ |
54 V(Map, two_pointer_filler_map, TwoPointerFillerMap) \ | 54 V(Map, two_pointer_filler_map, TwoPointerFillerMap) \ |
55 /* Cluster the most popular ones in a few cache lines here at the top. */ \ | 55 /* Cluster the most popular ones in a few cache lines here at the top. */ \ |
56 V(Smi, store_buffer_top, StoreBufferTop) \ | 56 V(Smi, store_buffer_top, StoreBufferTop) \ |
57 V(Oddball, undefined_value, UndefinedValue) \ | 57 V(Oddball, undefined_value, UndefinedValue) \ |
58 V(Oddball, the_hole_value, TheHoleValue) \ | 58 V(Oddball, the_hole_value, TheHoleValue) \ |
59 V(Oddball, null_value, NullValue) \ | 59 V(Oddball, null_value, NullValue) \ |
60 V(Oddball, true_value, TrueValue) \ | 60 V(Oddball, true_value, TrueValue) \ |
61 V(Oddball, false_value, FalseValue) \ | 61 V(Oddball, false_value, FalseValue) \ |
62 V(Oddball, uninitialized_value, UninitializedValue) \ | 62 V(Oddball, uninitialized_value, UninitializedValue) \ |
| 63 V(Map, cell_map, CellMap) \ |
63 V(Map, global_property_cell_map, GlobalPropertyCellMap) \ | 64 V(Map, global_property_cell_map, GlobalPropertyCellMap) \ |
64 V(Map, shared_function_info_map, SharedFunctionInfoMap) \ | 65 V(Map, shared_function_info_map, SharedFunctionInfoMap) \ |
65 V(Map, meta_map, MetaMap) \ | 66 V(Map, meta_map, MetaMap) \ |
66 V(Map, heap_number_map, HeapNumberMap) \ | 67 V(Map, heap_number_map, HeapNumberMap) \ |
67 V(Map, native_context_map, NativeContextMap) \ | 68 V(Map, native_context_map, NativeContextMap) \ |
68 V(Map, fixed_array_map, FixedArrayMap) \ | 69 V(Map, fixed_array_map, FixedArrayMap) \ |
69 V(Map, code_map, CodeMap) \ | 70 V(Map, code_map, CodeMap) \ |
70 V(Map, scope_info_map, ScopeInfoMap) \ | 71 V(Map, scope_info_map, ScopeInfoMap) \ |
71 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \ | 72 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \ |
72 V(Map, fixed_double_array_map, FixedDoubleArrayMap) \ | 73 V(Map, fixed_double_array_map, FixedDoubleArrayMap) \ |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 Address NewSpaceStart() { return new_space_.start(); } | 582 Address NewSpaceStart() { return new_space_.start(); } |
582 uintptr_t NewSpaceMask() { return new_space_.mask(); } | 583 uintptr_t NewSpaceMask() { return new_space_.mask(); } |
583 Address NewSpaceTop() { return new_space_.top(); } | 584 Address NewSpaceTop() { return new_space_.top(); } |
584 | 585 |
585 NewSpace* new_space() { return &new_space_; } | 586 NewSpace* new_space() { return &new_space_; } |
586 OldSpace* old_pointer_space() { return old_pointer_space_; } | 587 OldSpace* old_pointer_space() { return old_pointer_space_; } |
587 OldSpace* old_data_space() { return old_data_space_; } | 588 OldSpace* old_data_space() { return old_data_space_; } |
588 OldSpace* code_space() { return code_space_; } | 589 OldSpace* code_space() { return code_space_; } |
589 MapSpace* map_space() { return map_space_; } | 590 MapSpace* map_space() { return map_space_; } |
590 CellSpace* cell_space() { return cell_space_; } | 591 CellSpace* cell_space() { return cell_space_; } |
| 592 PropertyCellSpace* property_cell_space() { |
| 593 return property_cell_space_; |
| 594 } |
591 LargeObjectSpace* lo_space() { return lo_space_; } | 595 LargeObjectSpace* lo_space() { return lo_space_; } |
592 PagedSpace* paged_space(int idx) { | 596 PagedSpace* paged_space(int idx) { |
593 switch (idx) { | 597 switch (idx) { |
594 case OLD_POINTER_SPACE: | 598 case OLD_POINTER_SPACE: |
595 return old_pointer_space(); | 599 return old_pointer_space(); |
596 case OLD_DATA_SPACE: | 600 case OLD_DATA_SPACE: |
597 return old_data_space(); | 601 return old_data_space(); |
598 case MAP_SPACE: | 602 case MAP_SPACE: |
599 return map_space(); | 603 return map_space(); |
600 case CELL_SPACE: | 604 case CELL_SPACE: |
601 return cell_space(); | 605 return cell_space(); |
| 606 case PROPERTY_CELL_SPACE: |
| 607 return property_cell_space(); |
602 case CODE_SPACE: | 608 case CODE_SPACE: |
603 return code_space(); | 609 return code_space(); |
604 case NEW_SPACE: | 610 case NEW_SPACE: |
605 case LO_SPACE: | 611 case LO_SPACE: |
606 UNREACHABLE(); | 612 UNREACHABLE(); |
607 } | 613 } |
608 return NULL; | 614 return NULL; |
609 } | 615 } |
610 | 616 |
611 bool always_allocate() { return always_allocate_scope_depth_ != 0; } | 617 bool always_allocate() { return always_allocate_scope_depth_ != 0; } |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 ExternalArrayType array_type, | 932 ExternalArrayType array_type, |
927 void* external_pointer, | 933 void* external_pointer, |
928 PretenureFlag pretenure); | 934 PretenureFlag pretenure); |
929 | 935 |
930 // Allocate a symbol in old space. | 936 // Allocate a symbol in old space. |
931 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 937 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
932 // failed. | 938 // failed. |
933 // Please note this does not perform a garbage collection. | 939 // Please note this does not perform a garbage collection. |
934 MUST_USE_RESULT MaybeObject* AllocateSymbol(); | 940 MUST_USE_RESULT MaybeObject* AllocateSymbol(); |
935 | 941 |
| 942 // Allocate a tenured simple cell. |
| 943 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
| 944 // failed. |
| 945 // Please note this does not perform a garbage collection. |
| 946 MUST_USE_RESULT MaybeObject* AllocateCell(Object* value); |
| 947 |
936 // Allocate a tenured JS global property cell. | 948 // Allocate a tenured JS global property cell. |
937 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 949 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
938 // failed. | 950 // failed. |
939 // Please note this does not perform a garbage collection. | 951 // Please note this does not perform a garbage collection. |
940 MUST_USE_RESULT MaybeObject* AllocateJSGlobalPropertyCell(Object* value); | 952 MUST_USE_RESULT MaybeObject* AllocateJSGlobalPropertyCell(Object* value); |
941 | 953 |
942 // Allocate Box. | 954 // Allocate Box. |
943 MUST_USE_RESULT MaybeObject* AllocateBox(Object* value, | 955 MUST_USE_RESULT MaybeObject* AllocateBox(Object* value, |
944 PretenureFlag pretenure); | 956 PretenureFlag pretenure); |
945 | 957 |
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1951 #else | 1963 #else |
1952 static const int kMaxObjectSizeInNewSpace = 512*KB; | 1964 static const int kMaxObjectSizeInNewSpace = 512*KB; |
1953 #endif | 1965 #endif |
1954 | 1966 |
1955 NewSpace new_space_; | 1967 NewSpace new_space_; |
1956 OldSpace* old_pointer_space_; | 1968 OldSpace* old_pointer_space_; |
1957 OldSpace* old_data_space_; | 1969 OldSpace* old_data_space_; |
1958 OldSpace* code_space_; | 1970 OldSpace* code_space_; |
1959 MapSpace* map_space_; | 1971 MapSpace* map_space_; |
1960 CellSpace* cell_space_; | 1972 CellSpace* cell_space_; |
| 1973 PropertyCellSpace* property_cell_space_; |
1961 LargeObjectSpace* lo_space_; | 1974 LargeObjectSpace* lo_space_; |
1962 HeapState gc_state_; | 1975 HeapState gc_state_; |
1963 int gc_post_processing_depth_; | 1976 int gc_post_processing_depth_; |
1964 | 1977 |
1965 // Returns the amount of external memory registered since last global gc. | 1978 // Returns the amount of external memory registered since last global gc. |
1966 intptr_t PromotedExternalMemorySize(); | 1979 intptr_t PromotedExternalMemorySize(); |
1967 | 1980 |
1968 unsigned int ms_count_; // how many mark-sweep collections happened | 1981 unsigned int ms_count_; // how many mark-sweep collections happened |
1969 unsigned int gc_count_; // how many gc happened | 1982 unsigned int gc_count_; // how many gc happened |
1970 | 1983 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2107 GCTracer* tracer); | 2120 GCTracer* tracer); |
2108 | 2121 |
2109 inline void UpdateOldSpaceLimits(); | 2122 inline void UpdateOldSpaceLimits(); |
2110 | 2123 |
2111 // Allocate an uninitialized object in map space. The behavior is identical | 2124 // Allocate an uninitialized object in map space. The behavior is identical |
2112 // to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't | 2125 // to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't |
2113 // have to test the allocation space argument and (b) can reduce code size | 2126 // have to test the allocation space argument and (b) can reduce code size |
2114 // (since both AllocateRaw and AllocateRawMap are inlined). | 2127 // (since both AllocateRaw and AllocateRawMap are inlined). |
2115 MUST_USE_RESULT inline MaybeObject* AllocateRawMap(); | 2128 MUST_USE_RESULT inline MaybeObject* AllocateRawMap(); |
2116 | 2129 |
| 2130 // Allocate an uninitialized object in the simple cell space. |
| 2131 MUST_USE_RESULT inline MaybeObject* AllocateRawCell(); |
| 2132 |
2117 // Allocate an uninitialized object in the global property cell space. | 2133 // Allocate an uninitialized object in the global property cell space. |
2118 MUST_USE_RESULT inline MaybeObject* AllocateRawCell(); | 2134 MUST_USE_RESULT inline MaybeObject* AllocateRawJSGlobalPropertyCell(); |
2119 | 2135 |
2120 // Initializes a JSObject based on its map. | 2136 // Initializes a JSObject based on its map. |
2121 void InitializeJSObjectFromMap(JSObject* obj, | 2137 void InitializeJSObjectFromMap(JSObject* obj, |
2122 FixedArray* properties, | 2138 FixedArray* properties, |
2123 Map* map); | 2139 Map* map); |
2124 | 2140 |
2125 bool CreateInitialMaps(); | 2141 bool CreateInitialMaps(); |
2126 bool CreateInitialObjects(); | 2142 bool CreateInitialObjects(); |
2127 | 2143 |
2128 // These five Create*EntryStub functions are here and forced to not be inlined | 2144 // These five Create*EntryStub functions are here and forced to not be inlined |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2430 int* weak_global_handle_count; // 15 | 2446 int* weak_global_handle_count; // 15 |
2431 int* pending_global_handle_count; // 16 | 2447 int* pending_global_handle_count; // 16 |
2432 int* near_death_global_handle_count; // 17 | 2448 int* near_death_global_handle_count; // 17 |
2433 int* free_global_handle_count; // 18 | 2449 int* free_global_handle_count; // 18 |
2434 intptr_t* memory_allocator_size; // 19 | 2450 intptr_t* memory_allocator_size; // 19 |
2435 intptr_t* memory_allocator_capacity; // 20 | 2451 intptr_t* memory_allocator_capacity; // 20 |
2436 int* objects_per_type; // 21 | 2452 int* objects_per_type; // 21 |
2437 int* size_per_type; // 22 | 2453 int* size_per_type; // 22 |
2438 int* os_error; // 23 | 2454 int* os_error; // 23 |
2439 int* end_marker; // 24 | 2455 int* end_marker; // 24 |
| 2456 intptr_t* property_cell_space_size; // 25 |
| 2457 intptr_t* property_cell_space_capacity; // 26 |
2440 }; | 2458 }; |
2441 | 2459 |
2442 | 2460 |
2443 class DisallowAllocationFailure { | 2461 class DisallowAllocationFailure { |
2444 public: | 2462 public: |
2445 inline DisallowAllocationFailure(); | 2463 inline DisallowAllocationFailure(); |
2446 inline ~DisallowAllocationFailure(); | 2464 inline ~DisallowAllocationFailure(); |
2447 | 2465 |
2448 #ifdef DEBUG | 2466 #ifdef DEBUG |
2449 private: | 2467 private: |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3058 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 3076 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
3059 | 3077 |
3060 private: | 3078 private: |
3061 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 3079 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
3062 }; | 3080 }; |
3063 #endif // DEBUG | 3081 #endif // DEBUG |
3064 | 3082 |
3065 } } // namespace v8::internal | 3083 } } // namespace v8::internal |
3066 | 3084 |
3067 #endif // V8_HEAP_H_ | 3085 #endif // V8_HEAP_H_ |
OLD | NEW |