Commit 62d2aa45 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[compiler] Move feedback vector allocation to pipeline.

This moves the call-sites that ensure we have a feedback vector present
before kicking off a compiler into the actual compilation pipeline. The
backends no longer need to worry about the feedback vector.

R=mvstanton@chromium.org

Review URL: https://codereview.chromium.org/1811973006

Cr-Commit-Position: refs/heads/master@{#34900}
parent 3b537f38
......@@ -790,7 +790,7 @@ void RecordFunctionCompilation(Logger::LogEventsAndTags tag,
bool CompileUnoptimizedCode(CompilationInfo* info) {
DCHECK(AllowCompilation::IsAllowed(info->isolate()));
if (!Compiler::Analyze(info->parse_info()) ||
!FullCodeGenerator::MakeCode(info)) {
!(info->EnsureFeedbackVector(), FullCodeGenerator::MakeCode(info))) {
Isolate* isolate = info->isolate();
if (!isolate->has_pending_exception()) isolate->StackOverflow();
return false;
......@@ -843,6 +843,7 @@ int CodeAndMetadataSize(CompilationInfo* info) {
bool GenerateBaselineCode(CompilationInfo* info) {
bool success;
info->EnsureFeedbackVector();
if (FLAG_ignition && UseIgnition(info)) {
success = interpreter::Interpreter::MakeBytecode(info);
} else {
......@@ -1458,6 +1459,7 @@ bool Compiler::EnsureDeoptimizationSupport(CompilationInfo* info) {
shared->code()->has_reloc_info_for_serialization()) {
unoptimized.PrepareForSerializing();
}
unoptimized.EnsureFeedbackVector();
if (!FullCodeGenerator::MakeCode(&unoptimized)) return false;
shared->EnableDeoptimizationSupport(*unoptimized.code());
......
......@@ -30,9 +30,6 @@ bool FullCodeGenerator::MakeCode(CompilationInfo* info) {
TimerEventScope<TimerEventCompileFullCode> timer(info->isolate());
TRACE_EVENT0("v8", "V8.CompileFullCode");
// Ensure that the feedback vector is large enough.
info->EnsureFeedbackVector();
Handle<Script> script = info->script();
if (!script->IsUndefined() && !script->source()->IsUndefined()) {
int len = String::cast(script->source())->length();
......
......@@ -95,7 +95,6 @@ bool Interpreter::MakeBytecode(CompilationInfo* info) {
#endif // DEBUG
BytecodeGenerator generator(info->isolate(), info->zone());
info->EnsureFeedbackVector();
Handle<BytecodeArray> bytecodes = generator.MakeBytecode(info);
if (generator.HasStackOverflow()) return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment