| 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 <memory> | 9 #include <memory> |
| 10 #include <sstream> | 10 #include <sstream> |
| (...skipping 12194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12205 DCHECK(!IsOptimized()); | 12205 DCHECK(!IsOptimized()); |
| 12206 DCHECK(shared()->allows_lazy_compilation() || | 12206 DCHECK(shared()->allows_lazy_compilation() || |
| 12207 !shared()->optimization_disabled()); | 12207 !shared()->optimization_disabled()); |
| 12208 set_code_no_write_barrier( | 12208 set_code_no_write_barrier( |
| 12209 isolate->builtins()->builtin(Builtins::kCompileOptimized)); | 12209 isolate->builtins()->builtin(Builtins::kCompileOptimized)); |
| 12210 // No write barrier required, since the builtin is part of the root set. | 12210 // No write barrier required, since the builtin is part of the root set. |
| 12211 } | 12211 } |
| 12212 | 12212 |
| 12213 | 12213 |
| 12214 void JSFunction::AttemptConcurrentOptimization() { | 12214 void JSFunction::AttemptConcurrentOptimization() { |
| 12215 // Mark the shared function for optimization regardless of whether the | 12215 if (FLAG_optimize_shared_functions) { |
| 12216 // optimization is concurrent or not. | 12216 // Mark the shared function for optimization regardless of whether the |
| 12217 shared()->set_was_marked_for_optimization(true); | 12217 // optimization is concurrent or not. |
| 12218 shared()->set_was_marked_for_optimization(true); |
| 12219 } |
| 12218 | 12220 |
| 12219 Isolate* isolate = GetIsolate(); | 12221 Isolate* isolate = GetIsolate(); |
| 12220 if (!isolate->concurrent_recompilation_enabled() || | 12222 if (!isolate->concurrent_recompilation_enabled() || |
| 12221 isolate->bootstrapper()->IsActive()) { | 12223 isolate->bootstrapper()->IsActive()) { |
| 12222 MarkForOptimization(); | 12224 MarkForOptimization(); |
| 12223 return; | 12225 return; |
| 12224 } | 12226 } |
| 12225 DCHECK(!IsInOptimizationQueue()); | 12227 DCHECK(!IsInOptimizationQueue()); |
| 12226 DCHECK(!IsOptimized()); | 12228 DCHECK(!IsOptimized()); |
| 12227 DCHECK(shared()->allows_lazy_compilation() || | 12229 DCHECK(shared()->allows_lazy_compilation() || |
| (...skipping 7992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20220 ns, Accessors::ModuleNamespaceEntryInfo(isolate, name, attr)) | 20222 ns, Accessors::ModuleNamespaceEntryInfo(isolate, name, attr)) |
| 20221 .Check(); | 20223 .Check(); |
| 20222 } | 20224 } |
| 20223 JSObject::PreventExtensions(ns, THROW_ON_ERROR).ToChecked(); | 20225 JSObject::PreventExtensions(ns, THROW_ON_ERROR).ToChecked(); |
| 20224 | 20226 |
| 20225 return ns; | 20227 return ns; |
| 20226 } | 20228 } |
| 20227 | 20229 |
| 20228 } // namespace internal | 20230 } // namespace internal |
| 20229 } // namespace v8 | 20231 } // namespace v8 |
| OLD | NEW |