Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Side by Side Diff: src/heap.h

Issue 143153008: The allocation sites scratchpad becomes a heap data structure. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/v8.h ('k') | src/heap.cc » ('j') | src/heap.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 V(Smi, getter_stub_deopt_pc_offset, GetterStubDeoptPCOffset) \ 195 V(Smi, getter_stub_deopt_pc_offset, GetterStubDeoptPCOffset) \
196 V(Smi, setter_stub_deopt_pc_offset, SetterStubDeoptPCOffset) \ 196 V(Smi, setter_stub_deopt_pc_offset, SetterStubDeoptPCOffset) \
197 V(Cell, undefined_cell, UndefineCell) \ 197 V(Cell, undefined_cell, UndefineCell) \
198 V(JSObject, observation_state, ObservationState) \ 198 V(JSObject, observation_state, ObservationState) \
199 V(Map, external_map, ExternalMap) \ 199 V(Map, external_map, ExternalMap) \
200 V(Symbol, frozen_symbol, FrozenSymbol) \ 200 V(Symbol, frozen_symbol, FrozenSymbol) \
201 V(Symbol, elements_transition_symbol, ElementsTransitionSymbol) \ 201 V(Symbol, elements_transition_symbol, ElementsTransitionSymbol) \
202 V(SeededNumberDictionary, empty_slow_element_dictionary, \ 202 V(SeededNumberDictionary, empty_slow_element_dictionary, \
203 EmptySlowElementDictionary) \ 203 EmptySlowElementDictionary) \
204 V(Symbol, observed_symbol, ObservedSymbol) \ 204 V(Symbol, observed_symbol, ObservedSymbol) \
205 V(FixedArray, materialized_objects, MaterializedObjects) 205 V(FixedArray, materialized_objects, MaterializedObjects) \
206 V(FixedArray, allocation_sites_scratchpad, AllocationSitesScratchpad)
206 207
207 #define ROOT_LIST(V) \ 208 #define ROOT_LIST(V) \
208 STRONG_ROOT_LIST(V) \ 209 STRONG_ROOT_LIST(V) \
209 V(StringTable, string_table, StringTable) 210 V(StringTable, string_table, StringTable)
210 211
211 // Heap roots that are known to be immortal immovable, for which we can safely 212 // Heap roots that are known to be immortal immovable, for which we can safely
212 // skip write barriers. 213 // skip write barriers.
213 #define IMMORTAL_IMMOVABLE_ROOT_LIST(V) \ 214 #define IMMORTAL_IMMOVABLE_ROOT_LIST(V) \
214 V(byte_array_map) \ 215 V(byte_array_map) \
215 V(free_space_map) \ 216 V(free_space_map) \
(...skipping 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after
2278 // Allocates a small number to string cache. 2279 // Allocates a small number to string cache.
2279 MUST_USE_RESULT MaybeObject* AllocateInitialNumberStringCache(); 2280 MUST_USE_RESULT MaybeObject* AllocateInitialNumberStringCache();
2280 // Creates and installs the full-sized number string cache. 2281 // Creates and installs the full-sized number string cache.
2281 void AllocateFullSizeNumberStringCache(); 2282 void AllocateFullSizeNumberStringCache();
2282 // Get the length of the number to string cache based on the max semispace 2283 // Get the length of the number to string cache based on the max semispace
2283 // size. 2284 // size.
2284 int FullSizeNumberStringCacheLength(); 2285 int FullSizeNumberStringCacheLength();
2285 // Flush the number to string cache. 2286 // Flush the number to string cache.
2286 void FlushNumberStringCache(); 2287 void FlushNumberStringCache();
2287 2288
2289 // Allocates a fixed-size allocation sites scratchpad.
2290 MUST_USE_RESULT MaybeObject* AllocateAllocationSitesScratchpad();
2291
2292 // Sets used allocation sites entries to undefined.
2293 void FlushAllocationSitesScratchpad();
2294
2295 // Initializes the allocation sites scratchpad with undefined values.
2296 void InitializeAllocationSitesScratchpad();
2297
2298 // Adds an allocation site to the scratchpad if there is space left.
2299 void AddAllocationSiteToScratchpad(AllocationSite* site);
2300
2288 void UpdateSurvivalRateTrend(int start_new_space_size); 2301 void UpdateSurvivalRateTrend(int start_new_space_size);
2289 2302
2290 enum SurvivalRateTrend { INCREASING, STABLE, DECREASING, FLUCTUATING }; 2303 enum SurvivalRateTrend { INCREASING, STABLE, DECREASING, FLUCTUATING };
2291 2304
2292 static const int kYoungSurvivalRateHighThreshold = 90; 2305 static const int kYoungSurvivalRateHighThreshold = 90;
2293 static const int kYoungSurvivalRateLowThreshold = 10; 2306 static const int kYoungSurvivalRateLowThreshold = 10;
2294 static const int kYoungSurvivalRateAllowedDeviation = 15; 2307 static const int kYoungSurvivalRateAllowedDeviation = 15;
2295 2308
2296 static const int kOldSurvivalRateLowThreshold = 20; 2309 static const int kOldSurvivalRateLowThreshold = 20;
2297 2310
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
2450 2463
2451 // If the --deopt_every_n_garbage_collections flag is set to a positive value, 2464 // If the --deopt_every_n_garbage_collections flag is set to a positive value,
2452 // this variable holds the number of garbage collections since the last 2465 // this variable holds the number of garbage collections since the last
2453 // deoptimization triggered by garbage collection. 2466 // deoptimization triggered by garbage collection.
2454 int gcs_since_last_deopt_; 2467 int gcs_since_last_deopt_;
2455 2468
2456 #ifdef VERIFY_HEAP 2469 #ifdef VERIFY_HEAP
2457 int no_weak_object_verification_scope_depth_; 2470 int no_weak_object_verification_scope_depth_;
2458 #endif 2471 #endif
2459 2472
2460
2461 static const int kAllocationSiteScratchpadSize = 256; 2473 static const int kAllocationSiteScratchpadSize = 256;
2462 int allocation_sites_scratchpad_length; 2474 int allocation_sites_scratchpad_length_;
2463 AllocationSite* allocation_sites_scratchpad[kAllocationSiteScratchpadSize];
2464 2475
2465 static const int kMaxMarkSweepsInIdleRound = 7; 2476 static const int kMaxMarkSweepsInIdleRound = 7;
2466 static const int kIdleScavengeThreshold = 5; 2477 static const int kIdleScavengeThreshold = 5;
2467 2478
2468 // Shared state read by the scavenge collector and set by ScavengeObject. 2479 // Shared state read by the scavenge collector and set by ScavengeObject.
2469 PromotionQueue promotion_queue_; 2480 PromotionQueue promotion_queue_;
2470 2481
2471 // Flag is set when the heap has been configured. The heap can be repeatedly 2482 // Flag is set when the heap has been configured. The heap can be repeatedly
2472 // configured through the API until it is set up. 2483 // configured through the API until it is set up.
2473 bool configured_; 2484 bool configured_;
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
3080 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 3091 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
3081 3092
3082 private: 3093 private:
3083 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 3094 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
3084 }; 3095 };
3085 #endif // DEBUG 3096 #endif // DEBUG
3086 3097
3087 } } // namespace v8::internal 3098 } } // namespace v8::internal
3088 3099
3089 #endif // V8_HEAP_H_ 3100 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/heap.cc » ('j') | src/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698