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

Side by Side Diff: src/compiler.cc

Issue 951053002: [turbofan] Only compile hot asm functions with TurboFan if --turbo-osr flag is turned on. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 8
9 #include "src/ast-numbering.h" 9 #include "src/ast-numbering.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 // Check the whitelist for TurboFan. 494 // Check the whitelist for TurboFan.
495 if ((FLAG_turbo_asm && info()->shared_info()->asm_function()) || 495 if ((FLAG_turbo_asm && info()->shared_info()->asm_function()) ||
496 info()->closure()->PassesFilter(FLAG_turbo_filter)) { 496 info()->closure()->PassesFilter(FLAG_turbo_filter)) {
497 if (FLAG_trace_opt) { 497 if (FLAG_trace_opt) {
498 OFStream os(stdout); 498 OFStream os(stdout);
499 os << "[compiling method " << Brief(*info()->closure()) 499 os << "[compiling method " << Brief(*info()->closure())
500 << " using TurboFan"; 500 << " using TurboFan";
501 if (info()->is_osr()) os << " OSR"; 501 if (info()->is_osr()) os << " OSR";
502 os << "]" << std::endl; 502 os << "]" << std::endl;
503 } 503 }
504
505 if (info()->shared_info()->asm_function()) {
506 info()->MarkAsContextSpecializing();
507 }
508
504 Timer t(this, &time_taken_to_create_graph_); 509 Timer t(this, &time_taken_to_create_graph_);
505 compiler::Pipeline pipeline(info()); 510 compiler::Pipeline pipeline(info());
506 pipeline.GenerateCode(); 511 pipeline.GenerateCode();
507 if (!info()->code().is_null()) { 512 if (!info()->code().is_null()) {
508 return SetLastStatus(SUCCEEDED); 513 return SetLastStatus(SUCCEEDED);
509 } 514 }
510 } 515 }
511 516
512 if (FLAG_trace_opt) { 517 if (FLAG_trace_opt) {
513 OFStream os(stdout); 518 OFStream os(stdout);
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 928
924 929
925 MaybeHandle<Code> Compiler::GetLazyCode(Handle<JSFunction> function) { 930 MaybeHandle<Code> Compiler::GetLazyCode(Handle<JSFunction> function) {
926 Isolate* isolate = function->GetIsolate(); 931 Isolate* isolate = function->GetIsolate();
927 DCHECK(!isolate->has_pending_exception()); 932 DCHECK(!isolate->has_pending_exception());
928 DCHECK(!function->is_compiled()); 933 DCHECK(!function->is_compiled());
929 AggregatedHistogramTimerScope timer(isolate->counters()->compile_lazy()); 934 AggregatedHistogramTimerScope timer(isolate->counters()->compile_lazy());
930 // If the debugger is active, do not compile with turbofan unless we can 935 // If the debugger is active, do not compile with turbofan unless we can
931 // deopt from turbofan code. 936 // deopt from turbofan code.
932 if (FLAG_turbo_asm && function->shared()->asm_function() && 937 if (FLAG_turbo_asm && function->shared()->asm_function() &&
933 (FLAG_turbo_deoptimization || !isolate->debug()->is_active())) { 938 (FLAG_turbo_deoptimization || !isolate->debug()->is_active()) &&
939 !FLAG_turbo_osr) {
934 CompilationInfoWithZone info(function); 940 CompilationInfoWithZone info(function);
935 941
936 VMState<COMPILER> state(isolate); 942 VMState<COMPILER> state(isolate);
937 PostponeInterruptsScope postpone(isolate); 943 PostponeInterruptsScope postpone(isolate);
938 944
939 info.SetOptimizing(BailoutId::None(), handle(function->shared()->code())); 945 info.SetOptimizing(BailoutId::None(), handle(function->shared()->code()));
940 info.MarkAsContextSpecializing(); 946 info.MarkAsContextSpecializing();
941 947
942 if (GetOptimizedCodeNow(&info)) { 948 if (GetOptimizedCodeNow(&info)) {
943 DCHECK(function->shared()->is_compiled()); 949 DCHECK(function->shared()->is_compiled());
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
1600 } 1606 }
1601 1607
1602 1608
1603 #if DEBUG 1609 #if DEBUG
1604 void CompilationInfo::PrintAstForTesting() { 1610 void CompilationInfo::PrintAstForTesting() {
1605 PrintF("--- Source from AST ---\n%s\n", 1611 PrintF("--- Source from AST ---\n%s\n",
1606 PrettyPrinter(isolate(), zone()).PrintProgram(function())); 1612 PrettyPrinter(isolate(), zone()).PrintProgram(function()));
1607 } 1613 }
1608 #endif 1614 #endif
1609 } } // namespace v8::internal 1615 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698