Commit 13afe427 authored by jochen's avatar jochen Committed by Commit bot

Revert of Introduce a separate FunctionLiteral ID for Eval (patchset #1 id:1...

Revert of Introduce a separate FunctionLiteral ID for Eval (patchset #1 id:1 of https://codereview.chromium.org/2533303006/ )

Reason for revert:
My assumption that eval and top-level code should be handled differently was wrong

Original issue's description:
> Introduce a separate FunctionLiteral ID for Eval
>
> Top level SharedFunctionInfos will end up in a scripts SFI list, but
> eval'd SFIs shouldn't. Separate IDs will allow for adding a
> corresponding DCHECK.
>
> BUG=v8:5589
> R=marja@chromium.org
>
> Committed: https://crrev.com/c6d421ff9aee7f3cab9e48faac88f6b08d2f1cf5
> Cr-Commit-Position: refs/heads/master@{#41421}

TBR=marja@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:5589

Review-Url: https://codereview.chromium.org/2544003003
Cr-Commit-Position: refs/heads/master@{#41448}
parent 11f0a0e8
......@@ -2543,7 +2543,7 @@ class FunctionLiteral final : public Expression {
kAccessorOrMethod
};
enum IdType { kIdTypeEval = -2, kIdTypeInvalid = -1, kIdTypeTopLevel = 0 };
enum IdType { kIdTypeInvalid = -1, kIdTypeTopLevel = 0 };
enum ParameterFlag { kNoDuplicateParameters, kHasDuplicateParameters };
......@@ -3445,14 +3445,14 @@ class AstNodeFactory final BASE_EMBEDDED {
FunctionLiteral* NewScriptOrEvalFunctionLiteral(
DeclarationScope* scope, ZoneList<Statement*>* body,
int materialized_literal_count, int expected_property_count,
int parameter_count, int function_literal_id) {
int parameter_count) {
return new (zone_) FunctionLiteral(
zone_, ast_value_factory_->empty_string(), ast_value_factory_, scope,
body, materialized_literal_count, expected_property_count,
parameter_count, parameter_count, FunctionLiteral::kAnonymousExpression,
FunctionLiteral::kNoDuplicateParameters,
FunctionLiteral::kShouldLazyCompile, 0, false, true,
function_literal_id);
FunctionLiteral::kIdTypeTopLevel);
}
ClassLiteral::Property* NewClassLiteralProperty(
......
......@@ -729,7 +729,6 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) {
ParsingModeScope mode(this, allow_lazy_ ? PARSE_LAZILY : PARSE_EAGERLY);
ResetFunctionLiteralId();
DCHECK(info->function_literal_id() == FunctionLiteral::kIdTypeTopLevel ||
info->function_literal_id() == FunctionLiteral::kIdTypeEval ||
info->function_literal_id() == FunctionLiteral::kIdTypeInvalid);
FunctionLiteral* result = NULL;
......@@ -817,9 +816,7 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) {
int parameter_count = parsing_module_ ? 1 : 0;
result = factory()->NewScriptOrEvalFunctionLiteral(
scope, body, function_state.materialized_literal_count(),
function_state.expected_property_count(), parameter_count,
info->is_eval() ? FunctionLiteral::kIdTypeEval
: FunctionLiteral::kIdTypeTopLevel);
function_state.expected_property_count(), parameter_count);
}
}
......
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