Commit 4c7a51d7 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

Deprecate ability to generate stubs via Compiler class.

This removes the ability to generate stub code via the full-fledged
compiler pipeline that parses and analyzes JavaScript source code.
Generation of stub code has been moved to a lower-level entry point.

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#32847}
parent 74bc6916
......@@ -178,7 +178,6 @@ CompilationInfo::CompilationInfo(ParseInfo* parse_info, CodeStub* code_stub,
parameter_count_(0),
optimization_id_(-1),
osr_expr_stack_height_(0),
function_type_(nullptr),
debug_name_(debug_name) {
// Parameter count is number of stack parameters.
if (code_stub_ != NULL) {
......@@ -205,14 +204,6 @@ CompilationInfo::~CompilationInfo() {
}
void CompilationInfo::SetStub(CodeStub* code_stub) {
SetMode(STUB);
code_stub_ = code_stub;
debug_name_ = CodeStub::MajorName(code_stub->MajorKey());
set_output_code_kind(code_stub->GetCodeKind());
}
int CompilationInfo::num_parameters() const {
return has_scope() ? scope()->num_parameters() : parameter_count_;
}
......@@ -998,23 +989,6 @@ MaybeHandle<Code> Compiler::GetLazyCode(Handle<JSFunction> function) {
}
MaybeHandle<Code> Compiler::GetStubCode(Handle<JSFunction> function,
CodeStub* stub) {
// Build a "hybrid" CompilationInfo for a JSFunction/CodeStub pair.
Zone zone;
ParseInfo parse_info(&zone, function);
CompilationInfo info(&parse_info);
info.SetFunctionType(stub->GetCallInterfaceDescriptor().GetFunctionType());
info.MarkAsFunctionContextSpecializing();
info.MarkAsDeoptimizationEnabled();
info.SetStub(stub);
// Run a "mini pipeline", extracted from compiler.cc.
if (!ParseAndAnalyze(&parse_info)) return MaybeHandle<Code>();
return compiler::Pipeline(&info).GenerateCode();
}
bool Compiler::Compile(Handle<JSFunction> function, ClearExceptionFlag flag) {
if (function->is_compiled()) return true;
MaybeHandle<Code> maybe_code = Compiler::GetLazyCode(function);
......
......@@ -314,13 +314,6 @@ class CompilationInfo {
set_output_code_kind(Code::OPTIMIZED_FUNCTION);
}
void SetFunctionType(Type::FunctionType* function_type) {
function_type_ = function_type;
}
Type::FunctionType* function_type() const { return function_type_; }
void SetStub(CodeStub* code_stub);
// Deoptimization support.
bool HasDeoptimizationSupport() const {
return GetFlag(kDeoptimizationSupport);
......@@ -525,8 +518,6 @@ class CompilationInfo {
// The current OSR frame for specialization or {nullptr}.
JavaScriptFrame* osr_frame_ = nullptr;
Type::FunctionType* function_type_;
const char* debug_name_;
DISALLOW_COPY_AND_ASSIGN(CompilationInfo);
......@@ -651,8 +642,6 @@ class Compiler : public AllStatic {
Handle<JSFunction> function);
MUST_USE_RESULT static MaybeHandle<Code> GetLazyCode(
Handle<JSFunction> function);
MUST_USE_RESULT static MaybeHandle<Code> GetStubCode(
Handle<JSFunction> function, CodeStub* stub);
static bool Compile(Handle<JSFunction> function, ClearExceptionFlag flag);
static bool CompileDebugCode(Handle<JSFunction> function);
......
......@@ -1141,7 +1141,7 @@ Handle<Code> Pipeline::GenerateCode() {
info()->is_deoptimization_enabled()
? Typer::kDeoptimizationEnabled
: Typer::kNoFlags,
info()->dependencies(), info()->function_type()));
info()->dependencies()));
Run<TyperPhase>(typer.get());
RunPrintAndVerify("Typed");
}
......
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