Lines Matching refs:info
181 // passed in shared info, rather than creating a new one.
297 explicit HOptimizedGraphBuilderWithPositions(CompilationInfo* info)
298 : HOptimizedGraphBuilder(info) {
333 DCHECK(info()->IsOptimizing());
334 DCHECK(!info()->IsCompilingForDebugging());
337 // shared function info.
338 DCHECK(!info()->shared_info()->optimization_disabled());
349 if (info()->opt_count() > kMaxOptCount) {
361 Scope* scope = info()->scope();
367 if (info()->is_osr() &&
377 if (!info()->closure()->PassesFilter(FLAG_hydrogen_filter)) {
386 bool should_recompile = !info()->shared_info()->has_deoptimization_support();
392 if (!Compiler::EnsureDeoptimizationSupport(info())) {
400 DCHECK(info()->shared_info()->has_deoptimization_support());
403 if ((FLAG_turbo_asm && info()->shared_info()->asm_function()) ||
404 info()->closure()->PassesFilter(FLAG_turbo_filter)) {
405 compiler::Pipeline pipeline(info());
407 if (!info()->code().is_null()) {
409 info()->context()->native_context()->AddOptimizedCode(*info()->code());
416 Handle<String> name = info()->function()->debug_name();
419 isolate()->GetHTracer()->TraceCompilation(info());
423 AstTyper::Run(info());
426 ? new(info()->zone()) HOptimizedGraphBuilderWithPositions(info())
427 : new(info()->zone()) HOptimizedGraphBuilder(info());
430 info()->set_this_has_uses(false);
439 if (info()->HasAbortedDueToDependencyChange()) {
456 if (!info()->code().is_null()) {
478 if (!info()->code().is_null()) {
483 DCHECK(!info()->HasAbortedDueToDependencyChange());
497 if (info()->bailout_reason() == kNoReason) {
502 info()->SetCode(optimized_code);
506 info()->context()->native_context()->AddOptimizedCode(*info()->code());
512 Handle<JSFunction> function = info()->closure();
572 // Sets the function info on a function.
606 CompilationInfo* info,
614 if (info->isolate()->logger()->is_logging_code_events() ||
615 info->isolate()->cpu_profiler()->is_profiling()) {
616 Handle<Script> script = info->script();
617 Handle<Code> code = info->code();
618 if (code.is_identical_to(info->isolate()->builtins()->CompileLazy())) {
626 : info->isolate()->heap()->empty_string();
628 PROFILE(info->isolate(),
629 CodeCreateEvent(log_tag, *code, *shared, info, script_name,
634 Handle<Script>(info->script()), Handle<Code>(info->code()),
635 info));
639 static bool CompileUnoptimizedCode(CompilationInfo* info) {
640 DCHECK(AllowCompilation::IsAllowed(info->isolate()));
641 DCHECK(info->function() != NULL);
642 if (!Rewriter::Rewrite(info)) return false;
643 if (!Scope::Analyze(info)) return false;
644 DCHECK(info->scope() != NULL);
646 if (!FullCodeGenerator::MakeCode(info)) {
647 Isolate* isolate = info->isolate();
656 CompilationInfo* info) {
657 VMState<COMPILER> state(info->isolate());
658 PostponeInterruptsScope postpone(info->isolate());
661 if (!Parser::Parse(info)) return MaybeHandle<Code>();
662 Handle<SharedFunctionInfo> shared = info->shared_info();
663 FunctionLiteral* lit = info->function();
670 if (!CompileUnoptimizedCode(info)) return MaybeHandle<Code>();
672 CHECK_EQ(Code::FUNCTION, info->code()->kind());
673 RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info, shared);
675 // Update the shared function info with the scope info. Allocating the
677 Handle<ScopeInfo> scope_info = ScopeInfo::Create(info->scope(), info->zone());
680 // Update the code and feedback vector for the shared function info.
681 shared->ReplaceCode(*info->code());
682 if (shared->optimization_disabled()) info->code()->set_optimizable(false);
683 shared->set_feedback_vector(*info->feedback_vector());
685 return info->code();
716 static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) {
717 Handle<Code> code = info->code();
721 if (code->is_turbofanned() && info->is_context_specializing()) return;
725 Handle<JSFunction> function = info->closure();
732 literals, info->osr_ast_id());
737 static bool CompileOptimizedPrologue(CompilationInfo* info) {
738 if (!Parser::Parse(info)) return false;
739 if (!Rewriter::Rewrite(info)) return false;
740 if (!Scope::Analyze(info)) return false;
741 DCHECK(info->scope() != NULL);
746 static bool GetOptimizedCodeNow(CompilationInfo* info) {
747 if (!CompileOptimizedPrologue(info)) return false;
749 TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate());
751 OptimizedCompileJob job(info);
757 info->closure()->ShortPrint();
758 PrintF(" because: %s]\n", GetBailoutReason(info->bailout_reason()));
764 DCHECK(!info->isolate()->has_pending_exception());
765 InsertCodeIntoOptimizedCodeMap(info);
766 RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info,
767 info->shared_info());
770 info->closure()->ShortPrint();
777 static bool GetOptimizedCodeLater(CompilationInfo* info) {
778 Isolate* isolate = info->isolate();
782 info->closure()->ShortPrint();
788 CompilationHandleScope handle_scope(info);
789 if (!CompileOptimizedPrologue(info)) return false;
790 info->SaveHandles(); // Copy handles to the compilation handle scope.
792 TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate());
794 OptimizedCompileJob* job = new (info->zone()) OptimizedCompileJob(info);
801 info->closure()->ShortPrint();
802 if (info->is_osr()) {
803 PrintF(" for concurrent OSR at %d.\n", info->osr_ast_id().ToInt());
819 CompilationInfoWithZone info(function);
821 ASSIGN_RETURN_ON_EXCEPTION(info.isolate(), result,
822 GetUnoptimizedCodeCommon(&info),
833 CompilationInfoWithZone info(function);
835 VMState<COMPILER> state(info.isolate());
836 PostponeInterruptsScope postpone(info.isolate());
838 info.SetOptimizing(BailoutId::None(),
841 info.MarkAsContextSpecializing();
842 info.MarkAsTypingEnabled();
843 info.MarkAsInliningDisabled();
845 if (GetOptimizedCodeNow(&info)) return info.code();
852 CompilationInfoWithZone info(function);
854 ASSIGN_RETURN_ON_EXCEPTION(info.isolate(), result,
855 GetUnoptimizedCodeCommon(&info), Code);
858 info.isolate()->use_crankshaft() &&
859 !info.shared_info()->optimization_disabled() &&
860 !info.isolate()->DebuggerHasBreakPoints()) {
878 CompilationInfoWithZone info(shared);
879 return GetUnoptimizedCodeCommon(&info);
902 bool Compiler::EnsureDeoptimizationSupport(CompilationInfo* info) {
903 if (!info->shared_info()->has_deoptimization_support()) {
904 CompilationInfoWithZone unoptimized(info->shared_info());
907 unoptimized.SetFunction(info->function());
908 unoptimized.PrepareForCompilation(info->scope());
909 unoptimized.SetContext(info->context());
913 Handle<SharedFunctionInfo> shared = info->shared_info();
917 // The scope info might not have been set if a lazily compiled
919 if (shared->scope_info() == ScopeInfo::Empty(info->isolate())) {
921 ScopeInfo::Create(info->scope(), info->zone());
942 CompilationInfoWithZone info(function);
943 Isolate* isolate = info.isolate();
946 info.MarkAsDebug();
953 info.MarkCompilingForDebugging();
955 info.EnableDeoptimizationSupport();
957 info.MarkNonOptimizable();
959 MaybeHandle<Code> maybe_new_code = GetUnoptimizedCodeCommon(&info);
973 CompilationInfoWithZone info(script);
974 PostponeInterruptsScope postpone(info.isolate());
975 VMState<COMPILER> state(info.isolate());
977 info.MarkAsGlobal();
978 if (!Parser::Parse(&info)) return;
980 LiveEditFunctionTracker tracker(info.isolate(), info.function());
981 if (!CompileUnoptimizedCode(&info)) return;
982 if (!info.shared_info().is_null()) {
983 Handle<ScopeInfo> scope_info = ScopeInfo::Create(info.scope(),
984 info.zone());
985 info.shared_info()->set_scope_info(*scope_info);
987 tracker.RecordRootFunctionInfo(info.code());
991 static Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
992 Isolate* isolate = info->isolate();
995 Handle<Script> script = info->script();
1003 DCHECK(info->is_eval() || info->is_global());
1007 { VMState<COMPILER> state(info->isolate());
1008 if (info->function() == NULL) {
1012 (info->compile_options() == ScriptCompiler::kConsumeParserCache ||
1015 !Compiler::DebuggerWantsEagerCompilation(info);
1018 (info->compile_options() == ScriptCompiler::kProduceParserCache ||
1019 info->compile_options() == ScriptCompiler::kConsumeParserCache)) {
1024 info->SetCachedData(NULL, ScriptCompiler::kNoCompileOptions);
1026 if (!Parser::Parse(info, parse_allow_lazy)) {
1031 FunctionLiteral* lit = info->function();
1037 HistogramTimer* rate = info->is_eval()
1038 ? info->isolate()->counters()->compile_eval()
1039 : info->isolate()->counters()->compile();
1043 if (!CompileUnoptimizedCode(info)) {
1048 DCHECK(!info->code().is_null());
1051 info->code(), ScopeInfo::Create(info->scope(), info->zone()),
1052 info->feedback_vector());
1060 Logger::LogEventsAndTags log_tag = info->is_eval()
1065 log_tag, *info->code(), *result, info, *script_name));
1066 GDBJIT(AddCode(script_name, script, info->code(), info));
1077 live_edit_tracker.RecordFunctionInfo(result, lit, info->zone());
1103 CompilationInfoWithZone info(script);
1104 info.MarkAsEval();
1105 if (context->IsNativeContext()) info.MarkAsGlobal();
1106 info.SetStrictMode(strict_mode);
1107 info.SetParseRestriction(restriction);
1108 info.SetContext(context);
1112 shared_info = CompileToplevel(&info);
1199 CompilationInfoWithZone info(script);
1200 info.MarkAsGlobal();
1201 info.SetCachedData(cached_data, compile_options);
1202 info.SetExtension(extension);
1203 info.SetContext(context);
1206 info.PrepareForSerializing();
1208 if (FLAG_use_strict) info.SetStrictMode(STRICT);
1210 result = CompileToplevel(&info);
1234 CompilationInfo* info, int source_length) {
1235 Isolate* isolate = info->isolate();
1239 if (FLAG_use_strict) info->SetStrictMode(STRICT);
1242 return CompileToplevel(info);
1250 CompilationInfoWithZone info(script);
1251 info.SetFunction(literal);
1252 info.PrepareForCompilation(literal->scope());
1253 info.SetStrictMode(literal->scope()->strict_mode());
1254 if (outer_info->will_serialize()) info.PrepareForSerializing();
1256 Isolate* isolate = info.isolate();
1270 !DebuggerWantsEagerCompilation(&info, allow_lazy_without_ctx);
1276 info.SetCode(code);
1278 } else if (FullCodeGenerator::MakeCode(&info)) {
1279 DCHECK(!info.code().is_null());
1280 scope_info = ScopeInfo::Create(info.scope(), info.zone());
1285 // Create a shared function info object.
1288 info.code(), scope_info, info.feedback_vector());
1290 RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, result);
1298 live_edit_tracker.RecordFunctionInfo(result, literal, info.zone());
1313 SmartPointer<CompilationInfo> info(new CompilationInfoWithZone(function));
1314 Isolate* isolate = info->isolate();
1320 Handle<SharedFunctionInfo> shared = info->shared_info();
1324 // TODO(titzer): reuse the AST and scope info from this compile.
1334 info
1337 if (GetOptimizedCodeLater(info.get())) {
1338 info.Detach(); // The background recompile job owns this now.
1342 if (GetOptimizedCodeNow(info.get())) return info->code();
1351 // Take ownership of compilation info. Deleting compilation info
1353 SmartPointer<CompilationInfo> info(job->info());
1354 Isolate* isolate = info->isolate();
1357 TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate());
1359 Handle<SharedFunctionInfo> shared = info->shared_info();
1371 } else if (info->HasAbortedDueToDependencyChange()) {
1376 RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info.get(), shared);
1377 if (info->shared_info()->SearchOptimizedCodeMap(
1378 info->context()->native_context(), info->osr_ast_id()) == -1) {
1379 InsertCodeIntoOptimizedCodeMap(info.get());
1383 info->closure()->ShortPrint();
1386 return Handle<Code>(*info->code());
1393 info->closure()->ShortPrint();
1394 PrintF(" because: %s]\n", GetBailoutReason(info->bailout_reason()));
1400 bool Compiler::DebuggerWantsEagerCompilation(CompilationInfo* info,
1402 return LiveEditFunctionTracker::IsActive(info->isolate()) ||
1403 (info->isolate()->DebuggerHasBreakPoints() && !allow_lazy_without_ctx);
1407 CompilationPhase::CompilationPhase(const char* name, CompilationInfo* info)
1408 : name_(name), info_(info), zone_(info->isolate()) {
1410 info_zone_start_allocation_size_ = info->zone()->allocation_size();
1429 bool tracing_on = info()->IsStub()
1432 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter));