OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 12229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12240 } | 12240 } |
12241 | 12241 |
12242 | 12242 |
12243 void JSFunction::AttemptConcurrentOptimization() { | 12243 void JSFunction::AttemptConcurrentOptimization() { |
12244 Isolate* isolate = GetIsolate(); | 12244 Isolate* isolate = GetIsolate(); |
12245 if (!isolate->concurrent_recompilation_enabled() || | 12245 if (!isolate->concurrent_recompilation_enabled() || |
12246 isolate->bootstrapper()->IsActive()) { | 12246 isolate->bootstrapper()->IsActive()) { |
12247 MarkForOptimization(); | 12247 MarkForOptimization(); |
12248 return; | 12248 return; |
12249 } | 12249 } |
12250 if (isolate->concurrent_osr_enabled() && | |
12251 isolate->optimizing_compile_dispatcher()->IsQueuedForOSR(this)) { | |
12252 // Do not attempt regular recompilation if we already queued this for OSR. | |
12253 // TODO(yangguo): This is necessary so that we don't install optimized | |
12254 // code on a function that is already optimized, since OSR and regular | |
12255 // recompilation race. This goes away as soon as OSR becomes one-shot. | |
12256 return; | |
12257 } | |
12258 DCHECK(!IsInOptimizationQueue()); | 12250 DCHECK(!IsInOptimizationQueue()); |
12259 DCHECK(!IsOptimized()); | 12251 DCHECK(!IsOptimized()); |
12260 DCHECK(shared()->allows_lazy_compilation() || | 12252 DCHECK(shared()->allows_lazy_compilation() || |
12261 !shared()->optimization_disabled()); | 12253 !shared()->optimization_disabled()); |
12262 DCHECK(isolate->concurrent_recompilation_enabled()); | 12254 DCHECK(isolate->concurrent_recompilation_enabled()); |
12263 if (FLAG_trace_concurrent_recompilation) { | 12255 if (FLAG_trace_concurrent_recompilation) { |
12264 PrintF(" ** Marking "); | 12256 PrintF(" ** Marking "); |
12265 ShortPrint(); | 12257 ShortPrint(); |
12266 PrintF(" for concurrent recompilation.\n"); | 12258 PrintF(" for concurrent recompilation.\n"); |
12267 } | 12259 } |
(...skipping 7488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19756 if (cell->value() != *new_value) { | 19748 if (cell->value() != *new_value) { |
19757 cell->set_value(*new_value); | 19749 cell->set_value(*new_value); |
19758 Isolate* isolate = cell->GetIsolate(); | 19750 Isolate* isolate = cell->GetIsolate(); |
19759 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19751 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
19760 isolate, DependentCode::kPropertyCellChangedGroup); | 19752 isolate, DependentCode::kPropertyCellChangedGroup); |
19761 } | 19753 } |
19762 } | 19754 } |
19763 | 19755 |
19764 } // namespace internal | 19756 } // namespace internal |
19765 } // namespace v8 | 19757 } // namespace v8 |
OLD | NEW |