Commit 51d39325 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[turbofan] Deprecate CompilationInfo::has_literal predicate.

Now that the SharedFunctionInfo is available to compilers all of the
time, we no longer need to rely on the literal for source printing.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35326}
parent 2e9fc937
......@@ -115,11 +115,6 @@ bool CompilationInfo::has_context() const {
}
bool CompilationInfo::has_literal() const {
return parse_info_ && parse_info_->literal() != nullptr;
}
bool CompilationInfo::has_scope() const {
return parse_info_ && parse_info_->scope() != nullptr;
}
......
......@@ -185,7 +185,6 @@ class CompilationInfo {
Handle<SharedFunctionInfo> shared_info() const;
bool has_shared_info() const;
bool has_context() const;
bool has_literal() const;
bool has_scope() const;
// -----------------------------------------------------------
......
......@@ -118,13 +118,6 @@ bool CallDescriptor::CanTailCall(const Node* node,
CallDescriptor* Linkage::ComputeIncoming(Zone* zone, CompilationInfo* info) {
DCHECK(!info->IsStub());
if (info->has_literal()) {
// If we already have the function literal, use the number of parameters
// plus the receiver.
return GetJSCallDescriptor(zone, info->is_osr(),
1 + info->literal()->parameter_count(),
CallDescriptor::kNoFlags);
}
if (!info->closure().is_null()) {
// If we are compiling a JS function, use a JS call descriptor,
// plus the receiver.
......
......@@ -1112,12 +1112,10 @@ Handle<Code> Pipeline::GenerateCode() {
int pos = info()->shared_info()->start_position();
json_of << "{\"function\":\"" << function_name.get()
<< "\", \"sourcePosition\":" << pos << ", \"source\":\"";
if (info()->has_literal() && !script->IsUndefined() &&
!script->source()->IsUndefined()) {
if (!script->IsUndefined() && !script->source()->IsUndefined()) {
DisallowHeapAllocation no_allocation;
FunctionLiteral* function = info()->literal();
int start = function->start_position();
int len = function->end_position() - start;
int start = info()->shared_info()->start_position();
int len = info()->shared_info()->end_position() - start;
String::SubStringRange source(String::cast(script->source()), start,
len);
for (const auto& c : source) {
......
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