| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/objects.h" | 5 #include "src/objects.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <iomanip> | 8 #include <iomanip> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 11089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11100 } | 11100 } |
| 11101 DCHECK(new_code_map->get(i + kLiteralsOffset)->IsFixedArray()); | 11101 DCHECK(new_code_map->get(i + kLiteralsOffset)->IsFixedArray()); |
| 11102 DCHECK(new_code_map->get(i + kOsrAstIdOffset)->IsSmi()); | 11102 DCHECK(new_code_map->get(i + kOsrAstIdOffset)->IsSmi()); |
| 11103 } | 11103 } |
| 11104 #endif | 11104 #endif |
| 11105 shared->set_optimized_code_map(*new_code_map); | 11105 shared->set_optimized_code_map(*new_code_map); |
| 11106 } | 11106 } |
| 11107 | 11107 |
| 11108 | 11108 |
| 11109 void SharedFunctionInfo::ClearOptimizedCodeMap() { | 11109 void SharedFunctionInfo::ClearOptimizedCodeMap() { |
| 11110 FixedArray* code_map = FixedArray::cast(optimized_code_map()); | |
| 11111 | |
| 11112 // If the next map link slot is already used then the function was | |
| 11113 // enqueued with code flushing and we remove it now. | |
| 11114 if (!code_map->get(kNextMapIndex)->IsUndefined()) { | |
| 11115 CodeFlusher* flusher = GetHeap()->mark_compact_collector()->code_flusher(); | |
| 11116 flusher->EvictOptimizedCodeMap(this); | |
| 11117 } | |
| 11118 | |
| 11119 DCHECK(code_map->get(kNextMapIndex)->IsUndefined()); | |
| 11120 set_optimized_code_map(Smi::FromInt(0)); | 11110 set_optimized_code_map(Smi::FromInt(0)); |
| 11121 } | 11111 } |
| 11122 | 11112 |
| 11123 | 11113 |
| 11124 void SharedFunctionInfo::EvictFromOptimizedCodeMap(Code* optimized_code, | 11114 void SharedFunctionInfo::EvictFromOptimizedCodeMap(Code* optimized_code, |
| 11125 const char* reason) { | 11115 const char* reason) { |
| 11126 DisallowHeapAllocation no_gc; | 11116 DisallowHeapAllocation no_gc; |
| 11127 if (optimized_code_map()->IsSmi()) return; | 11117 if (optimized_code_map()->IsSmi()) return; |
| 11128 | 11118 |
| 11129 Heap* heap = GetHeap(); | 11119 Heap* heap = GetHeap(); |
| (...skipping 6750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17880 if (cell->value() != *new_value) { | 17870 if (cell->value() != *new_value) { |
| 17881 cell->set_value(*new_value); | 17871 cell->set_value(*new_value); |
| 17882 Isolate* isolate = cell->GetIsolate(); | 17872 Isolate* isolate = cell->GetIsolate(); |
| 17883 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 17873 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 17884 isolate, DependentCode::kPropertyCellChangedGroup); | 17874 isolate, DependentCode::kPropertyCellChangedGroup); |
| 17885 } | 17875 } |
| 17886 } | 17876 } |
| 17887 | 17877 |
| 17888 } // namespace internal | 17878 } // namespace internal |
| 17889 } // namespace v8 | 17879 } // namespace v8 |
| OLD | NEW |