}
-static void UpdateSharedFunctionInfo(CompilationInfo* info) {
- // Update the shared function info with the compiled code and the
- // scope info. Please note, that the order of the shared function
- // info initialization is important since set_scope_info might
- // trigger a GC, causing the DCHECK below to be invalid if the code
- // was flushed. By setting the code object last we avoid this.
- Handle<SharedFunctionInfo> shared = info->shared_info();
- Handle<ScopeInfo> scope_info =
- ScopeInfo::Create(info->scope(), info->zone());
- shared->set_scope_info(*scope_info);
-
- Handle<Code> code = info->code();
- CHECK(code->kind() == Code::FUNCTION);
- shared->ReplaceCode(*code);
- if (shared->optimization_disabled()) code->set_optimizable(false);
-
- shared->set_feedback_vector(*info->feedback_vector());
-
- // Set the expected number of properties for instances.
- FunctionLiteral* lit = info->function();
- int expected = lit->expected_property_count();
- SetExpectedNofPropertiesFromEstimate(shared, expected);
-
- // Check the function has compiled code.
- DCHECK(shared->is_compiled());
- shared->set_bailout_reason(lit->dont_optimize_reason());
- shared->set_ast_node_count(lit->ast_node_count());
- shared->set_strict_mode(lit->strict_mode());
-}
-
-
// Sets the function info on a function.
// The start_position points to the first '(' character after the function name
// in the full script source. When counting characters in the script source the
CompilationInfo* info) {
VMState<COMPILER> state(info->isolate());
PostponeInterruptsScope postpone(info->isolate());
+
+ // Parse and update CompilationInfo with the results.
if (!Parser::Parse(info)) return MaybeHandle<Code>();
- info->SetStrictMode(info->function()->strict_mode());
+ Handle<SharedFunctionInfo> shared = info->shared_info();
+ FunctionLiteral* lit = info->function();
+ shared->set_strict_mode(lit->strict_mode());
+ SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count());
+ shared->set_bailout_reason(lit->dont_optimize_reason());
+ shared->set_ast_node_count(lit->ast_node_count());
+ // Compile unoptimized code.
if (!CompileUnoptimizedCode(info)) return MaybeHandle<Code>();
+
+ CHECK_EQ(Code::FUNCTION, info->code()->kind());
Compiler::RecordFunctionCompilation(
Logger::LAZY_COMPILE_TAG, info, info->shared_info());
- UpdateSharedFunctionInfo(info);
- DCHECK_EQ(Code::FUNCTION, info->code()->kind());
+
+ // Update the shared function info with the scope info. Allocating the
+ // ScopeInfo object may cause a GC.
+ Handle<ScopeInfo> scope_info = ScopeInfo::Create(info->scope(), info->zone());
+ shared->set_scope_info(*scope_info);
+
+ // Update the code and feedback vector for the shared function info.
+ shared->ReplaceCode(*info->code());
+ if (shared->optimization_disabled()) info->code()->set_optimizable(false);
+ shared->set_feedback_vector(*info->feedback_vector());
+
return info->code();
}
info.MarkAsGlobal();
if (!Parser::Parse(&info)) return;
- info.SetStrictMode(info.function()->strict_mode());
LiveEditFunctionTracker tracker(info.isolate(), info.function());
if (!CompileUnoptimizedCode(&info)) return;
static bool CompileOptimizedPrologue(CompilationInfo* info) {
if (!Parser::Parse(info)) return false;
- info->SetStrictMode(info->function()->strict_mode());
-
if (!Rewriter::Rewrite(info)) return false;
if (!Scope::Analyze(info)) return false;
DCHECK(info->scope() != NULL);
# TODO(mstarzinger): Takes too long with TF.
'array-sort': [PASS, NO_VARIANTS],
- 'compiler/osr-warm': [PASS, NO_VARIANTS],
'regress/regress-91008': [PASS, NO_VARIANTS],
}], # 'gc_stress == True'
'bit-not': [PASS, SLOW],
'compiler/alloc-number': [PASS, SLOW],
'compiler/osr-assert': [PASS, SLOW],
- 'compiler/osr-warm': [PASS, TIMEOUT, SLOW],
'compiler/osr-with-args': [PASS, SLOW],
'debug-scopes': [PASS, SLOW],
'generated-transition-stub': [PASS, SLOW],