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

Side by Side Diff: src/heap.cc

Issue 15734007: Move global pretenuring flag check to ShouldGloballyPretenure(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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 | « src/heap.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »
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 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 } 931 }
932 932
933 if (!new_space_high_promotion_mode_active_ && 933 if (!new_space_high_promotion_mode_active_ &&
934 new_space_.Capacity() == new_space_.MaximumCapacity() && 934 new_space_.Capacity() == new_space_.MaximumCapacity() &&
935 IsStableOrIncreasingSurvivalTrend() && 935 IsStableOrIncreasingSurvivalTrend() &&
936 IsHighSurvivalRate()) { 936 IsHighSurvivalRate()) {
937 // Stable high survival rates even though young generation is at 937 // Stable high survival rates even though young generation is at
938 // maximum capacity indicates that most objects will be promoted. 938 // maximum capacity indicates that most objects will be promoted.
939 // To decrease scavenger pauses and final mark-sweep pauses, we 939 // To decrease scavenger pauses and final mark-sweep pauses, we
940 // have to limit maximal capacity of the young generation. 940 // have to limit maximal capacity of the young generation.
941 new_space_high_promotion_mode_active_ = true; 941 SetNewSpaceHighPromotionModeActive(true);
942 if (FLAG_trace_gc) { 942 if (FLAG_trace_gc) {
943 PrintPID("Limited new space size due to high promotion rate: %d MB\n", 943 PrintPID("Limited new space size due to high promotion rate: %d MB\n",
944 new_space_.InitialCapacity() / MB); 944 new_space_.InitialCapacity() / MB);
945 } 945 }
946 // Support for global pre-tenuring uses the high promotion mode as a 946 // Support for global pre-tenuring uses the high promotion mode as a
947 // heuristic indicator of whether to pretenure or not, we trigger 947 // heuristic indicator of whether to pretenure or not, we trigger
948 // deoptimization here to take advantage of pre-tenuring as soon as 948 // deoptimization here to take advantage of pre-tenuring as soon as
949 // possible. 949 // possible.
950 if (FLAG_pretenure_literals) { 950 if (FLAG_pretenuring) {
951 isolate_->stack_guard()->FullDeopt(); 951 isolate_->stack_guard()->FullDeopt();
952 } 952 }
953 } else if (new_space_high_promotion_mode_active_ && 953 } else if (new_space_high_promotion_mode_active_ &&
954 IsStableOrDecreasingSurvivalTrend() && 954 IsStableOrDecreasingSurvivalTrend() &&
955 IsLowSurvivalRate()) { 955 IsLowSurvivalRate()) {
956 // Decreasing low survival rates might indicate that the above high 956 // Decreasing low survival rates might indicate that the above high
957 // promotion mode is over and we should allow the young generation 957 // promotion mode is over and we should allow the young generation
958 // to grow again. 958 // to grow again.
959 new_space_high_promotion_mode_active_ = false; 959 SetNewSpaceHighPromotionModeActive(false);
960 if (FLAG_trace_gc) { 960 if (FLAG_trace_gc) {
961 PrintPID("Unlimited new space size due to low promotion rate: %d MB\n", 961 PrintPID("Unlimited new space size due to low promotion rate: %d MB\n",
962 new_space_.MaximumCapacity() / MB); 962 new_space_.MaximumCapacity() / MB);
963 } 963 }
964 // Trigger deoptimization here to turn off pre-tenuring as soon as 964 // Trigger deoptimization here to turn off pre-tenuring as soon as
965 // possible. 965 // possible.
966 if (FLAG_pretenure_literals) { 966 if (FLAG_pretenuring) {
967 isolate_->stack_guard()->FullDeopt(); 967 isolate_->stack_guard()->FullDeopt();
968 } 968 }
969 } 969 }
970 970
971 if (new_space_high_promotion_mode_active_ && 971 if (new_space_high_promotion_mode_active_ &&
972 new_space_.Capacity() > new_space_.InitialCapacity()) { 972 new_space_.Capacity() > new_space_.InitialCapacity()) {
973 new_space_.Shrink(); 973 new_space_.Shrink();
974 } 974 }
975 975
976 isolate_->counters()->objs_since_last_young()->Set(0); 976 isolate_->counters()->objs_since_last_young()->Set(0);
(...skipping 6966 matching lines...) Expand 10 before | Expand all | Expand 10 after
7943 if (FLAG_parallel_recompilation) { 7943 if (FLAG_parallel_recompilation) {
7944 heap_->relocation_mutex_->Lock(); 7944 heap_->relocation_mutex_->Lock();
7945 #ifdef DEBUG 7945 #ifdef DEBUG
7946 heap_->relocation_mutex_locked_by_optimizer_thread_ = 7946 heap_->relocation_mutex_locked_by_optimizer_thread_ =
7947 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 7947 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
7948 #endif // DEBUG 7948 #endif // DEBUG
7949 } 7949 }
7950 } 7950 }
7951 7951
7952 } } // namespace v8::internal 7952 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698