| 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 12193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12204 DCHECK(!IsOptimized()); | 12204 DCHECK(!IsOptimized()); |
| 12205 DCHECK(shared()->allows_lazy_compilation() || | 12205 DCHECK(shared()->allows_lazy_compilation() || |
| 12206 !shared()->optimization_disabled()); | 12206 !shared()->optimization_disabled()); |
| 12207 set_code_no_write_barrier( | 12207 set_code_no_write_barrier( |
| 12208 isolate->builtins()->builtin(Builtins::kCompileOptimized)); | 12208 isolate->builtins()->builtin(Builtins::kCompileOptimized)); |
| 12209 // No write barrier required, since the builtin is part of the root set. | 12209 // No write barrier required, since the builtin is part of the root set. |
| 12210 } | 12210 } |
| 12211 | 12211 |
| 12212 | 12212 |
| 12213 void JSFunction::AttemptConcurrentOptimization() { | 12213 void JSFunction::AttemptConcurrentOptimization() { |
| 12214 // Mark the shared function for optimization regardless of whether the |
| 12215 // optimization is concurrent or not. |
| 12216 shared()->set_was_marked_for_optimization(true); |
| 12217 |
| 12214 Isolate* isolate = GetIsolate(); | 12218 Isolate* isolate = GetIsolate(); |
| 12215 if (!isolate->concurrent_recompilation_enabled() || | 12219 if (!isolate->concurrent_recompilation_enabled() || |
| 12216 isolate->bootstrapper()->IsActive()) { | 12220 isolate->bootstrapper()->IsActive()) { |
| 12217 MarkForOptimization(); | 12221 MarkForOptimization(); |
| 12218 return; | 12222 return; |
| 12219 } | 12223 } |
| 12220 DCHECK(!IsInOptimizationQueue()); | 12224 DCHECK(!IsInOptimizationQueue()); |
| 12221 DCHECK(!IsOptimized()); | 12225 DCHECK(!IsOptimized()); |
| 12222 DCHECK(shared()->allows_lazy_compilation() || | 12226 DCHECK(shared()->allows_lazy_compilation() || |
| 12223 !shared()->optimization_disabled()); | 12227 !shared()->optimization_disabled()); |
| 12224 DCHECK(isolate->concurrent_recompilation_enabled()); | 12228 DCHECK(isolate->concurrent_recompilation_enabled()); |
| 12225 if (FLAG_trace_concurrent_recompilation) { | 12229 if (FLAG_trace_concurrent_recompilation) { |
| 12226 PrintF(" ** Marking "); | 12230 PrintF(" ** Marking "); |
| 12227 ShortPrint(); | 12231 ShortPrint(); |
| 12228 PrintF(" for concurrent recompilation.\n"); | 12232 PrintF(" for concurrent recompilation.\n"); |
| 12229 } | 12233 } |
| 12234 |
| 12230 set_code_no_write_barrier( | 12235 set_code_no_write_barrier( |
| 12231 isolate->builtins()->builtin(Builtins::kCompileOptimizedConcurrent)); | 12236 isolate->builtins()->builtin(Builtins::kCompileOptimizedConcurrent)); |
| 12232 // No write barrier required, since the builtin is part of the root set. | 12237 // No write barrier required, since the builtin is part of the root set. |
| 12233 } | 12238 } |
| 12234 | 12239 |
| 12235 // static | 12240 // static |
| 12236 Handle<LiteralsArray> SharedFunctionInfo::FindOrCreateLiterals( | 12241 Handle<LiteralsArray> SharedFunctionInfo::FindOrCreateLiterals( |
| 12237 Handle<SharedFunctionInfo> shared, Handle<Context> native_context) { | 12242 Handle<SharedFunctionInfo> shared, Handle<Context> native_context) { |
| 12238 Isolate* isolate = shared->GetIsolate(); | 12243 Isolate* isolate = shared->GetIsolate(); |
| 12239 CodeAndLiterals result = | 12244 CodeAndLiterals result = |
| (...skipping 7973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20213 ns, Accessors::ModuleNamespaceEntryInfo(isolate, name, attr)) | 20218 ns, Accessors::ModuleNamespaceEntryInfo(isolate, name, attr)) |
| 20214 .Check(); | 20219 .Check(); |
| 20215 } | 20220 } |
| 20216 JSObject::PreventExtensions(ns, THROW_ON_ERROR).ToChecked(); | 20221 JSObject::PreventExtensions(ns, THROW_ON_ERROR).ToChecked(); |
| 20217 | 20222 |
| 20218 return ns; | 20223 return ns; |
| 20219 } | 20224 } |
| 20220 | 20225 |
| 20221 } // namespace internal | 20226 } // namespace internal |
| 20222 } // namespace v8 | 20227 } // namespace v8 |
| OLD | NEW |