| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |