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

Side by Side Diff: src/heap/mark-compact.cc

Issue 1206803003: Remove overzealous checking of --cache-optimized-code flag. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_opt-code-map-2
Patch Set: Rebased. Created 5 years, 6 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
« no previous file with comments | « src/compiler.cc ('k') | src/heap/objects-visiting-inl.h » ('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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/base/atomicops.h" 7 #include "src/base/atomicops.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/compilation-cache.h" 10 #include "src/compilation-cache.h"
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 892
893 Code* code = shared->code(); 893 Code* code = shared->code();
894 MarkBit code_mark = Marking::MarkBitFrom(code); 894 MarkBit code_mark = Marking::MarkBitFrom(code);
895 if (Marking::IsWhite(code_mark)) { 895 if (Marking::IsWhite(code_mark)) {
896 if (FLAG_trace_code_flushing && shared->is_compiled()) { 896 if (FLAG_trace_code_flushing && shared->is_compiled()) {
897 PrintF("[code-flushing clears: "); 897 PrintF("[code-flushing clears: ");
898 shared->ShortPrint(); 898 shared->ShortPrint();
899 PrintF(" - age: %d]\n", code->GetAge()); 899 PrintF(" - age: %d]\n", code->GetAge());
900 } 900 }
901 // Always flush the optimized code map if requested by flag. 901 // Always flush the optimized code map if requested by flag.
902 if (FLAG_cache_optimized_code && FLAG_flush_optimized_code_cache && 902 if (FLAG_flush_optimized_code_cache &&
903 !shared->optimized_code_map()->IsSmi()) { 903 !shared->optimized_code_map()->IsSmi()) {
904 shared->ClearOptimizedCodeMap(); 904 shared->ClearOptimizedCodeMap();
905 } 905 }
906 shared->set_code(lazy_compile); 906 shared->set_code(lazy_compile);
907 candidate->set_code(lazy_compile); 907 candidate->set_code(lazy_compile);
908 } else { 908 } else {
909 DCHECK(Marking::IsBlack(code_mark)); 909 DCHECK(Marking::IsBlack(code_mark));
910 candidate->set_code(code); 910 candidate->set_code(code);
911 } 911 }
912 912
(...skipping 27 matching lines...) Expand all
940 940
941 Code* code = candidate->code(); 941 Code* code = candidate->code();
942 MarkBit code_mark = Marking::MarkBitFrom(code); 942 MarkBit code_mark = Marking::MarkBitFrom(code);
943 if (Marking::IsWhite(code_mark)) { 943 if (Marking::IsWhite(code_mark)) {
944 if (FLAG_trace_code_flushing && candidate->is_compiled()) { 944 if (FLAG_trace_code_flushing && candidate->is_compiled()) {
945 PrintF("[code-flushing clears: "); 945 PrintF("[code-flushing clears: ");
946 candidate->ShortPrint(); 946 candidate->ShortPrint();
947 PrintF(" - age: %d]\n", code->GetAge()); 947 PrintF(" - age: %d]\n", code->GetAge());
948 } 948 }
949 // Always flush the optimized code map if requested by flag. 949 // Always flush the optimized code map if requested by flag.
950 if (FLAG_cache_optimized_code && FLAG_flush_optimized_code_cache && 950 if (FLAG_flush_optimized_code_cache &&
951 !candidate->optimized_code_map()->IsSmi()) { 951 !candidate->optimized_code_map()->IsSmi()) {
952 candidate->ClearOptimizedCodeMap(); 952 candidate->ClearOptimizedCodeMap();
953 } 953 }
954 candidate->set_code(lazy_compile); 954 candidate->set_code(lazy_compile);
955 } 955 }
956 956
957 Object** code_slot = 957 Object** code_slot =
958 HeapObject::RawField(candidate, SharedFunctionInfo::kCodeOffset); 958 HeapObject::RawField(candidate, SharedFunctionInfo::kCodeOffset);
959 isolate_->heap()->mark_compact_collector()->RecordSlot(code_slot, code_slot, 959 isolate_->heap()->mark_compact_collector()->RecordSlot(code_slot, code_slot,
960 *code_slot); 960 *code_slot);
(...skipping 3783 matching lines...) Expand 10 before | Expand all | Expand 10 after
4744 SlotsBuffer* buffer = *buffer_address; 4744 SlotsBuffer* buffer = *buffer_address;
4745 while (buffer != NULL) { 4745 while (buffer != NULL) {
4746 SlotsBuffer* next_buffer = buffer->next(); 4746 SlotsBuffer* next_buffer = buffer->next();
4747 DeallocateBuffer(buffer); 4747 DeallocateBuffer(buffer);
4748 buffer = next_buffer; 4748 buffer = next_buffer;
4749 } 4749 }
4750 *buffer_address = NULL; 4750 *buffer_address = NULL;
4751 } 4751 }
4752 } // namespace internal 4752 } // namespace internal
4753 } // namespace v8 4753 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/heap/objects-visiting-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698