Lines Matching refs:info
266 Handle<JSFunction> function = info()->closure();
302 static bool MakeCrankshaftCode(CompilationInfo* info) {
303 OptimizingCompiler compiler(info);
321 ASSERT(info()->IsOptimizing());
322 ASSERT(!info()->IsCompilingForDebugging());
326 Handle<Code> code(info()->shared_info()->code());
330 // shared function info.
331 ASSERT(!info()->shared_info()->optimization_disabled());
337 info()->SetCode(code);
345 if (info()->opt_count() > kMaxOptCount) {
346 info()->set_bailout_reason(kOptimizedTooManyTimes);
358 Scope* scope = info()->scope();
360 info()->set_bailout_reason(kTooManyParameters);
365 if (!info()->osr_ast_id().IsNone() &&
367 info()->set_bailout_reason(kTooManyParametersLocals);
372 if (!info()->closure()->PassesHydrogenFilter()) {
373 info()->SetCode(code);
381 bool should_recompile = !info()->shared_info()->has_deoptimization_support();
387 CompilationInfoWithZone unoptimized(info()->shared_info());
390 unoptimized.SetFunction(info()->function());
391 unoptimized.SetScope(info()->scope());
392 unoptimized.SetContext(info()->context());
397 Handle<SharedFunctionInfo> shared = info()->shared_info();
415 ASSERT(info()->shared_info()->has_deoptimization_support());
418 Handle<String> name = info()->function()->debug_name();
421 isolate()->GetHTracer()->TraceCompilation(info());
425 AstTyper::Run(info());
427 graph_builder_ = new(info()->zone()) HOptimizedGraphBuilder(info());
433 info()->SetCode(Handle<Code>::null());
450 if (info()->HasAbortedDueToDependencyChange()) {
485 ASSERT(!info()->HasAbortedDueToDependencyChange());
498 if (info()->bailout_reason() == kNoReason) {
499 info()->set_bailout_reason(kCodeGenerationFailed);
503 info()->SetCode(optimized_code);
510 static bool GenerateCode(CompilationInfo* info) {
512 !info->IsCompilingForDebugging() &&
513 info->IsOptimizing();
516 info->isolate(), Logger::TimerEventScope::v8_recompile_synchronous);
517 return MakeCrankshaftCode(info);
519 if (info->IsOptimizing()) {
522 info->DisableOptimization();
525 info->isolate(), Logger::TimerEventScope::v8_compile_full_code);
526 return FullCodeGenerator::MakeCode(info);
531 static bool MakeCode(CompilationInfo* info) {
533 // the compilation info is set if compilation succeeded.
534 ASSERT(info->function() != NULL);
535 return Rewriter::Rewrite(info) && Scope::Analyze(info) && GenerateCode(info);
540 bool Compiler::MakeCodeForLiveEdit(CompilationInfo* info) {
542 // the compilation info is set if compilation succeeded.
543 bool succeeded = MakeCode(info);
544 if (!info->shared_info().is_null()) {
545 Handle<ScopeInfo> scope_info = ScopeInfo::Create(info->scope(),
546 info->zone());
547 info->shared_info()->set_scope_info(*scope_info);
554 static bool DebuggerWantsEagerCompilation(CompilationInfo* info,
556 return LiveEditFunctionTracker::IsActive(info->isolate()) ||
557 (info->isolate()->DebuggerHasBreakPoints() && !allow_lazy_without_ctx);
561 static Handle<SharedFunctionInfo> MakeFunctionInfo(CompilationInfo* info) {
562 Isolate* isolate = info->isolate();
566 Handle<Script> script = info->script();
572 if (info->is_eval()) {
576 if (info->is_eval()) {
593 ASSERT(info->is_eval() || info->is_global());
595 Parser parser(info);
596 if ((info->pre_parse_data() != NULL ||
598 !DebuggerWantsEagerCompilation(info))
608 HistogramTimer* rate = info->is_eval()
609 ? info->isolate()->counters()->compile_eval()
610 : info->isolate()->counters()->compile();
614 FunctionLiteral* lit = info->function();
616 if (!MakeCode(info)) {
622 ASSERT(!info->code().is_null());
628 info->code(),
629 ScopeInfo::Create(info->scope(), info->zone()));
636 info->is_eval()
639 *info->code(),
641 info,
645 info->code(),
646 info));
649 info->is_eval()
652 *info->code(),
654 info,
656 GDBJIT(AddCode(Handle<String>(), script, info->code(), info));
672 live_edit_tracker.RecordFunctionInfo(result, lit, info->zone());
735 CompilationInfoWithZone info(script);
736 info.MarkAsGlobal();
737 info.SetExtension(extension);
738 info.SetPreParseData(pre_data);
739 info.SetContext(context);
741 info.SetLanguageMode(FLAG_harmony_scoping ? EXTENDED_MODE : STRICT_MODE);
743 result = MakeFunctionInfo(&info);
785 CompilationInfoWithZone info(script);
786 info.MarkAsEval();
787 if (is_global) info.MarkAsGlobal();
788 info.SetLanguageMode(language_mode);
789 info.SetParseRestriction(restriction);
790 info.SetContext(context);
791 result = MakeFunctionInfo(&info);
820 static bool InstallFullCode(CompilationInfo* info) {
821 // Update the shared function info with the compiled code and the
822 // scope info. Please note, that the order of the shared function
823 // info initialization is important since set_scope_info might
826 Handle<SharedFunctionInfo> shared = info->shared_info();
827 Handle<Code> code = info->code();
829 Handle<JSFunction> function = info->closure();
831 ScopeInfo::Create(info->scope(), info->zone());
840 FunctionLiteral* lit = info->function();
867 static void InstallCodeCommon(CompilationInfo* info) {
868 Handle<SharedFunctionInfo> shared = info->shared_info();
869 Handle<Code> code = info->code();
873 // function info, e.g., we might have flushed the code and must
881 Compiler::RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info, shared);
885 static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) {
886 Handle<Code> code = info->code();
888 info
890 Handle<JSFunction> function = info->closure();
900 static bool InstallCodeFromOptimizedCodeMap(CompilationInfo* info) {
902 info->osr_ast_id().IsNone() &&
903 info->IsOptimizing()) {
904 Handle<SharedFunctionInfo> shared = info->shared_info();
905 Handle<JSFunction> function = info->closure();
924 bool Compiler::CompileLazy(CompilationInfo* info) {
925 Isolate* isolate = info->isolate();
932 Handle<SharedFunctionInfo> shared = info->shared_info();
936 if (InstallCodeFromOptimizedCodeMap(info)) return true;
939 if (Parser::Parse(info)) {
946 LanguageMode language_mode = info->function()->language_mode();
947 info->SetLanguageMode(language_mode);
951 if (!MakeCode(info)) {
956 InstallCodeCommon(info);
958 if (info->IsOptimizing()) {
959 Handle<Code> code = info->code();
961 info->closure()->ReplaceCode(*code);
962 InsertCodeIntoOptimizedCodeMap(info);
965 return InstallFullCode(info);
970 ASSERT(info->code().is_null());
993 SmartPointer<CompilationInfo> info(new CompilationInfoWithZone(closure));
997 Handle<SharedFunctionInfo> shared = info->shared_info();
1000 info->SetOptimizing(BailoutId::None());
1003 CompilationHandleScope handle_scope(*info);
1005 if (InstallCodeFromOptimizedCodeMap(*info)) {
1009 if (Parser::Parse(*info)) {
1010 LanguageMode language_mode = info->function()->language_mode();
1011 info->SetLanguageMode(language_mode);
1013 info->SaveHandles();
1015 if (Rewriter::Rewrite(*info) && Scope::Analyze(*info)) {
1017 new(info->zone()) OptimizingCompiler(*info);
1020 info.Detach();
1025 InstallFullCode(*info);
1050 SmartPointer<CompilationInfo> info(optimizing_compiler->info());
1053 if (info->shared_info()->optimization_disabled()) {
1054 info->AbortOptimization();
1055 InstallFullCode(*info);
1058 info->closure()->PrintName();
1061 ASSERT(!info->closure()->IsMarkedForInstallingRecompiledCode());
1065 Isolate* isolate = info->isolate();
1072 if (info->HasAbortedDueToDependencyChange()) {
1073 info->set_bailout_reason(kBailedOutDueToDependencyChange);
1076 info->set_bailout_reason(kFailedBailedOutLastTime);
1079 info->set_bailout_reason(kDebuggerIsActive);
1087 InstallCodeCommon(*info);
1089 Handle<Code> code = info->code();
1090 ASSERT(info->shared_info()->scope_info() != ScopeInfo::Empty(isolate));
1091 info->closure()->ReplaceCode(*code);
1092 if (info->shared_info()->SearchOptimizedCodeMap(
1093 info->closure()->context()->native_context()) == -1) {
1094 InsertCodeIntoOptimizedCodeMap(*info);
1098 info->closure()->PrintName();
1102 info->SetCode(Handle<Code>(info->shared_info()->code()));
1103 InstallFullCode(*info);
1107 info->shared_info()->code()->set_profiler_ticks(0);
1108 ASSERT(!info->closure()->IsMarkedForInstallingRecompiledCode());
1115 CompilationInfoWithZone info(script);
1116 info.SetFunction(literal);
1117 info.SetScope(literal->scope());
1118 info.SetLanguageMode(literal->scope()->language_mode());
1120 Isolate* isolate = info.isolate();
1134 !DebuggerWantsEagerCompilation(&info, allow_lazy_without_ctx);
1141 info.SetCode(code);
1142 } else if (GenerateCode(&info)) {
1143 ASSERT(!info.code().is_null());
1144 scope_info = ScopeInfo::Create(info.scope(), info.zone());
1149 // Create a shared function info object.
1154 info.code(),
1157 RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, result);
1165 live_edit_tracker.RecordFunctionInfo(result, literal, info.zone());
1170 // Sets the function info on a function.
1204 CompilationInfo* info,
1212 if (info->isolate()->logger()->is_logging_code_events() ||
1213 info->isolate()->cpu_profiler()->is_profiling()) {
1214 Handle<Script> script = info->script();
1215 Handle<Code> code = info->code();
1216 if (*code == info->isolate()->builtins()->builtin(Builtins::kLazyCompile))
1221 PROFILE(info->isolate(),
1225 info,
1229 PROFILE(info->isolate(),
1233 info,
1234 info->isolate()->heap()->empty_string(),
1240 Handle<Script>(info->script()),
1241 Handle<Code>(info->code()),
1242 info));
1246 CompilationPhase::CompilationPhase(const char* name, CompilationInfo* info)
1247 : name_(name), info_(info), zone_(info->isolate()) {
1249 info_zone_start_allocation_size_ = info->zone()->allocation_size();
1268 bool tracing_on = info()->IsStub() ?