Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: src/objects.cc

Issue 2448933002: [compiler] Make SFI "optimize" flag a "tier up" flag (Closed)
Patch Set: Rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 12180 matching lines...) Expand 10 before | Expand all | Expand 10 after
12191 } 12191 }
12192 } 12192 }
12193 return false; 12193 return false;
12194 } 12194 }
12195 12195
12196 void JSFunction::MarkForBaseline() { 12196 void JSFunction::MarkForBaseline() {
12197 Isolate* isolate = GetIsolate(); 12197 Isolate* isolate = GetIsolate();
12198 set_code_no_write_barrier( 12198 set_code_no_write_barrier(
12199 isolate->builtins()->builtin(Builtins::kCompileBaseline)); 12199 isolate->builtins()->builtin(Builtins::kCompileBaseline));
12200 // No write barrier required, since the builtin is part of the root set. 12200 // No write barrier required, since the builtin is part of the root set.
12201 if (FLAG_tier_up_shared_functions) {
12202 shared()->set_was_marked_for_tier_up(true);
12203 }
12201 } 12204 }
12202 12205
12203 void JSFunction::MarkForOptimization() { 12206 void JSFunction::MarkForOptimization() {
12204 Isolate* isolate = GetIsolate(); 12207 Isolate* isolate = GetIsolate();
12205 DCHECK(!IsOptimized()); 12208 DCHECK(!IsOptimized());
12206 DCHECK(shared()->allows_lazy_compilation() || 12209 DCHECK(shared()->allows_lazy_compilation() ||
12207 !shared()->optimization_disabled()); 12210 !shared()->optimization_disabled());
12208 set_code_no_write_barrier( 12211 set_code_no_write_barrier(
12209 isolate->builtins()->builtin(Builtins::kCompileOptimized)); 12212 isolate->builtins()->builtin(Builtins::kCompileOptimized));
12210 // No write barrier required, since the builtin is part of the root set. 12213 // No write barrier required, since the builtin is part of the root set.
12214 if (FLAG_tier_up_shared_functions) {
12215 shared()->set_was_marked_for_tier_up(true);
12216 }
12211 } 12217 }
12212 12218
12213 12219
12214 void JSFunction::AttemptConcurrentOptimization() { 12220 void JSFunction::AttemptConcurrentOptimization() {
12215 if (FLAG_optimize_shared_functions) {
12216 // Mark the shared function for optimization regardless of whether the
12217 // optimization is concurrent or not.
12218 shared()->set_was_marked_for_optimization(true);
12219 }
12220
12221 Isolate* isolate = GetIsolate(); 12221 Isolate* isolate = GetIsolate();
12222 if (!isolate->concurrent_recompilation_enabled() || 12222 if (!isolate->concurrent_recompilation_enabled() ||
12223 isolate->bootstrapper()->IsActive()) { 12223 isolate->bootstrapper()->IsActive()) {
12224 MarkForOptimization(); 12224 MarkForOptimization();
12225 return; 12225 return;
12226 } 12226 }
12227 DCHECK(!IsInOptimizationQueue()); 12227 DCHECK(!IsInOptimizationQueue());
12228 DCHECK(!IsOptimized()); 12228 DCHECK(!IsOptimized());
12229 DCHECK(shared()->allows_lazy_compilation() || 12229 DCHECK(shared()->allows_lazy_compilation() ||
12230 !shared()->optimization_disabled()); 12230 !shared()->optimization_disabled());
12231 DCHECK(isolate->concurrent_recompilation_enabled()); 12231 DCHECK(isolate->concurrent_recompilation_enabled());
12232 if (FLAG_trace_concurrent_recompilation) { 12232 if (FLAG_trace_concurrent_recompilation) {
12233 PrintF(" ** Marking "); 12233 PrintF(" ** Marking ");
12234 ShortPrint(); 12234 ShortPrint();
12235 PrintF(" for concurrent recompilation.\n"); 12235 PrintF(" for concurrent recompilation.\n");
12236 } 12236 }
12237 12237
12238 set_code_no_write_barrier( 12238 set_code_no_write_barrier(
12239 isolate->builtins()->builtin(Builtins::kCompileOptimizedConcurrent)); 12239 isolate->builtins()->builtin(Builtins::kCompileOptimizedConcurrent));
12240 // No write barrier required, since the builtin is part of the root set. 12240 // No write barrier required, since the builtin is part of the root set.
12241 if (FLAG_tier_up_shared_functions) {
12242 shared()->set_was_marked_for_tier_up(true);
rmcilroy 2016/10/26 15:07:59 Could you add the TODO here to mention this doesn'
Leszek Swirski 2016/10/27 09:40:20 Done.
12243 }
12241 } 12244 }
12242 12245
12243 // static 12246 // static
12244 Handle<LiteralsArray> SharedFunctionInfo::FindOrCreateLiterals( 12247 Handle<LiteralsArray> SharedFunctionInfo::FindOrCreateLiterals(
12245 Handle<SharedFunctionInfo> shared, Handle<Context> native_context) { 12248 Handle<SharedFunctionInfo> shared, Handle<Context> native_context) {
12246 Isolate* isolate = shared->GetIsolate(); 12249 Isolate* isolate = shared->GetIsolate();
12247 CodeAndLiterals result = 12250 CodeAndLiterals result =
12248 shared->SearchOptimizedCodeMap(*native_context, BailoutId::None()); 12251 shared->SearchOptimizedCodeMap(*native_context, BailoutId::None());
12249 if (result.literals != nullptr) { 12252 if (result.literals != nullptr) {
12250 DCHECK(shared->feedback_metadata()->is_empty() || 12253 DCHECK(shared->feedback_metadata()->is_empty() ||
(...skipping 7971 matching lines...) Expand 10 before | Expand all | Expand 10 after
20222 ns, Accessors::ModuleNamespaceEntryInfo(isolate, name, attr)) 20225 ns, Accessors::ModuleNamespaceEntryInfo(isolate, name, attr))
20223 .Check(); 20226 .Check();
20224 } 20227 }
20225 JSObject::PreventExtensions(ns, THROW_ON_ERROR).ToChecked(); 20228 JSObject::PreventExtensions(ns, THROW_ON_ERROR).ToChecked();
20226 20229
20227 return ns; 20230 return ns;
20228 } 20231 }
20229 20232
20230 } // namespace internal 20233 } // namespace internal
20231 } // namespace v8 20234 } // namespace v8
OLDNEW
« src/objects.h ('K') | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698