Home | History | Annotate | Download | only in src

Lines Matching refs:info

165 static void AbortAndDisable(CompilationInfo* info) {
166 // Disable optimization for the shared function info and mark the
167 // code as non-optimizable. The marker on the shared function info
170 // regenerated and set on the shared function info it is marked as
172 // function info.
173 Handle<SharedFunctionInfo> shared = info->shared_info();
178 info->SetCode(code);
180 isolate->compilation_cache()->MarkForLazyOptimizing(info->closure());
183 info->closure()->PrintName();
185 reinterpret_cast<intptr_t>(*info->closure()));
190 static bool MakeCrankshaftCode(CompilationInfo* info) {
193 if (!info->AllowOptimize()) info->DisableOptimization();
197 if (!info->IsOptimizing()) {
198 return FullCodeGenerator::MakeCode(info);
203 Handle<Code> code(info->shared_info()->code());
207 // shared function info.
208 ASSERT(!info->shared_info()->optimization_disabled());
214 info->SetCode(code);
222 if (info->shared_info()->opt_count() > kMaxOptCount) {
223 AbortAndDisable(info);
238 Scope* scope = info->scope();
240 (info->osr_ast_id() != AstNode::kNoNumber &&
242 AbortAndDisable(info);
250 Handle<String> name = info->function()->debug_name();
253 info->SetCode(code);
262 bool should_recompile = !info->shared_info()->has_deoptimization_support();
265 CompilationInfo unoptimized(info->shared_info());
268 unoptimized.SetFunction(info->function());
269 unoptimized.SetScope(info->scope());
274 Handle<SharedFunctionInfo> shared = info->shared_info();
288 ASSERT(info->shared_info()->has_deoptimization_support());
293 HTracer::Instance()->TraceCompilation(info->function());
296 Handle<Context> global_context(info->closure()->context()->global_context());
298 HGraphBuilder builder(info, &oracle);
301 if (info->isolate()->has_pending_exception()) {
302 info->SetCode(Handle<Code>::null());
307 Handle<Code> optimized_code = graph->Compile(info);
309 info->SetCode(optimized_code);
310 FinishOptimization(info->closure(), start);
317 AbortAndDisable(info);
324 static bool MakeCode(CompilationInfo* info) {
326 // the compilation info is set if compilation succeeded.
327 ASSERT(info->function() != NULL);
329 if (Rewriter::Rewrite(info) && Scope::Analyze(info)) {
330 if (V8::UseCrankshaft()) return MakeCrankshaftCode(info);
333 return FullCodeGenerator::MakeCode(info);
341 bool Compiler::MakeCodeForLiveEdit(CompilationInfo* info) {
343 // the compilation info is set if compilation succeeded.
344 bool succeeded = MakeCode(info);
345 if (!info->shared_info().is_null()) {
347 SerializedScopeInfo::Create(info->scope());
348 info->shared_info()->set_scope_info(*scope_info);
355 static Handle<SharedFunctionInfo> MakeFunctionInfo(CompilationInfo* info) {
358 Isolate* isolate = info->isolate();
362 Handle<Script> script = info->script();
366 if (info->is_eval()) {
371 if (info->is_eval()) {
389 ASSERT(info->is_eval() || info->is_global());
391 if (!ParserApi::Parse(info)) return Handle<SharedFunctionInfo>::null();
396 HistogramTimer* rate = info->is_eval()
397 ? info->isolate()->counters()->compile_eval()
398 : info->isolate()->counters()->compile();
402 FunctionLiteral* lit = info->function();
404 if (!MakeCode(info)) {
410 ASSERT(!info->code().is_null());
415 info->code(),
416 SerializedScopeInfo::Create(info->scope()));
423 info->is_eval()
426 *info->code(),
431 info->code()));
434 info->is_eval()
437 *info->code(),
440 GDBJIT(AddCode(Handle<String>(), script, info->code()));
524 CompilationInfo info(script);
525 info.MarkAsGlobal();
526 info.SetExtension(extension);
527 info.SetPreParseData(pre_data);
528 result = MakeFunctionInfo(&info);
568 CompilationInfo info(script);
569 info.MarkAsEval();
570 if (is_global) info.MarkAsGlobal();
571 if (strict_mode == kStrictMode) info.MarkAsStrictMode();
572 info.SetCallingContext(context);
573 result = MakeFunctionInfo(&info);
588 bool Compiler::CompileLazy(CompilationInfo* info) {
592 VMState state(info->isolate(), COMPILER);
594 Isolate* isolate = info->isolate();
597 Handle<SharedFunctionInfo> shared = info->shared_info();
602 if (ParserApi::Parse(info)) {
609 if (info->function()->strict_mode()) {
611 info->MarkAsStrictMode();
615 if (!MakeCode(info)) {
620 ASSERT(!info->code().is_null());
621 Handle<Code> code = info->code();
623 // function info, e.g., we might have flushed the code and must
627 Handle<JSFunction> function = info->closure();
628 RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info, shared);
630 if (info->IsOptimizing()) {
633 // Update the shared function info with the compiled code and the
634 // scope info. Please note, that the order of the shared function
635 // info initialization is important since set_scope_info might
639 SerializedScopeInfo::Create(info->scope());
648 FunctionLiteral* lit = info->function();
663 if (info->AllowOptimize() && !shared->optimization_disabled()) {
683 ASSERT(info->code().is_null());
691 CompilationInfo info(script);
692 info.SetFunction(literal);
693 info.SetScope(literal->scope());
695 LiveEditFunctionTracker live_edit_tracker(info.isolate(), literal);
702 !LiveEditFunctionTracker::IsActive(info.isolate());
708 Handle<Code> code = info.isolate()->builtins()->LazyCompile();
709 info.SetCode(code);
710 } else if ((V8::UseCrankshaft() && MakeCrankshaftCode(&info)) ||
711 (!V8::UseCrankshaft() && FullCodeGenerator::MakeCode(&info))) {
712 ASSERT(!info.code().is_null());
713 scope_info = SerializedScopeInfo::Create(info.scope());
718 // Create a shared function info object.
722 info.code(),
725 RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, result);
737 // Sets the function info on a function.
763 CompilationInfo* info,
771 if (info->isolate()->logger()->is_logging() || CpuProfiler::is_profiling()) {
772 Handle<Script> script = info->script();
773 Handle<Code> code = info->code();
774 if (*code == info->isolate()->builtins()->builtin(Builtins::kLazyCompile))
779 PROFILE(info->isolate(),
786 PROFILE(info->isolate(),
795 Handle<Script>(info->script()),
796 Handle<Code>(info->code())));