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

Side by Side Diff: src/heap.h

Issue 8341014: Age the number string cache so it does not keep strings Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 2 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 scavenging_visitors_table_.GetVisitor(map)(map, slot, obj); 1412 scavenging_visitors_table_.GetVisitor(map)(map, slot, obj);
1413 } 1413 }
1414 1414
1415 void QueueMemoryChunkForFree(MemoryChunk* chunk); 1415 void QueueMemoryChunkForFree(MemoryChunk* chunk);
1416 void FreeQueuedChunks(); 1416 void FreeQueuedChunks();
1417 1417
1418 // Completely clear the Instanceof cache (to stop it keeping objects alive 1418 // Completely clear the Instanceof cache (to stop it keeping objects alive
1419 // around a GC). 1419 // around a GC).
1420 inline void CompletelyClearInstanceofCache(); 1420 inline void CompletelyClearInstanceofCache();
1421 1421
1422 // Constants for the NumberStringCache.
1423 static const int kNSCUnusedAge = -1;
Vyacheslav Egorov (Chromium) 2011/10/18 15:30:39 I don't think abbreviation NSC is good.
1424 static const int kNSCMinAge = 0;
1425 static const int kNSCMaxAge = 2;
1426 static const int kNSCNumberOffset = 0;
1427 static const int kNSCStringOffset = 1;
1428 static const int kNSCAgeOffset = 2;
1429 static const int kNSCSlotsPerEntry = 3;
1430
1422 private: 1431 private:
1423 Heap(); 1432 Heap();
1424 1433
1425 // This can be calculated directly from a pointer to the heap; however, it is 1434 // This can be calculated directly from a pointer to the heap; however, it is
1426 // more expedient to get at the isolate directly from within Heap methods. 1435 // more expedient to get at the isolate directly from within Heap methods.
1427 Isolate* isolate_; 1436 Isolate* isolate_;
1428 1437
1429 intptr_t code_range_size_; 1438 intptr_t code_range_size_;
1430 int reserved_semispace_size_; 1439 int reserved_semispace_size_;
1431 int max_semispace_size_; 1440 int max_semispace_size_;
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 1690
1682 // Total RegExp code ever generated 1691 // Total RegExp code ever generated
1683 double total_regexp_code_generated_; 1692 double total_regexp_code_generated_;
1684 1693
1685 GCTracer* tracer_; 1694 GCTracer* tracer_;
1686 1695
1687 1696
1688 // Initializes the number to string cache based on the max semispace size. 1697 // Initializes the number to string cache based on the max semispace size.
1689 MUST_USE_RESULT MaybeObject* InitializeNumberStringCache(); 1698 MUST_USE_RESULT MaybeObject* InitializeNumberStringCache();
1690 // Flush the number to string cache. 1699 // Flush the number to string cache.
1691 void FlushNumberStringCache(); 1700 void AgeNumberStringCache();
1692 1701
1693 void UpdateSurvivalRateTrend(int start_new_space_size); 1702 void UpdateSurvivalRateTrend(int start_new_space_size);
1694 1703
1695 enum SurvivalRateTrend { INCREASING, STABLE, DECREASING, FLUCTUATING }; 1704 enum SurvivalRateTrend { INCREASING, STABLE, DECREASING, FLUCTUATING };
1696 1705
1697 static const int kYoungSurvivalRateThreshold = 90; 1706 static const int kYoungSurvivalRateThreshold = 90;
1698 static const int kYoungSurvivalRateAllowedDeviation = 15; 1707 static const int kYoungSurvivalRateAllowedDeviation = 15;
1699 1708
1700 int young_survivors_after_last_gc_; 1709 int young_survivors_after_last_gc_;
1701 int high_survival_rate_period_length_; 1710 int high_survival_rate_period_length_;
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
2468 2477
2469 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2478 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2470 }; 2479 };
2471 #endif // DEBUG || LIVE_OBJECT_LIST 2480 #endif // DEBUG || LIVE_OBJECT_LIST
2472 2481
2473 } } // namespace v8::internal 2482 } } // namespace v8::internal
2474 2483
2475 #undef HEAP 2484 #undef HEAP
2476 2485
2477 #endif // V8_HEAP_H_ 2486 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/heap.cc » ('j') | src/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698