Commit 3d7ad2e7 authored by Adam Klein's avatar Adam Klein Committed by Commit Bot

Reland "[parser] Remove pretenuring of closures assigned to properties"

The memory gains were significant, so despite the bluebird-doxbee
regression, we think it's better to have this patch than not.
See the attached Chromium bug for more discussion.

This is a reland of 20e346bd.

Original change's description:
> [parser] Remove pretenuring of closures assigned to properties
>
> This pretenuring was added in https://codereview.chromium.org/5220007,
> back when it was necessary in order to allow use of the closure
> as a "constant function" property. This should no longer be the case,
> and the pretenuring causes some unfortunate downstream effects.
>
> This patch removes the parser's setting of this bit. If it doesn't
> cause regressions on the perf bots, followup CLs will remove the
> rest of the support for this feature.
>
> Bug: v8:7442
> Change-Id: I27c43dd4293ce5de921be6c78571e712778d138a
> Reviewed-on: https://chromium-review.googlesource.com/914610
> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
> Commit-Queue: Adam Klein <adamk@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#51254}

Bug: v8:7442, chromium:814182
Change-Id: I228c59dccef3844803f115749e72ae6c5f286eda
Reviewed-on: https://chromium-review.googlesource.com/938241Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51668}
parent 54c4c8ce
......@@ -3006,8 +3006,6 @@ ParserBase<Impl>::ParseAssignmentExpression(bool accept_IN, bool* ok) {
function_state_->AddProperty();
}
impl()->CheckAssigningFunctionLiteralToProperty(expression, right);
if (fni_ != nullptr) {
// Check if the right hand side is a call to avoid inferring a
// name if we're dealing with "a = function(){...}();"-like
......
......@@ -687,16 +687,6 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
fni_->Infer();
}
// If we assign a function literal to a property we pretenure the
// literal so it can be added as a constant function property.
V8_INLINE static void CheckAssigningFunctionLiteralToProperty(
Expression* left, Expression* right) {
DCHECK_NOT_NULL(left);
if (left->IsProperty() && right->IsFunctionLiteral()) {
right->AsFunctionLiteral()->set_pretenure();
}
}
// Determine if the expression is a variable proxy and mark it as being used
// in an assignment or with a increment/decrement operator.
V8_INLINE static void MarkExpressionAsAssigned(Expression* expression) {
......
......@@ -1344,9 +1344,6 @@ class PreParser : public ParserBase<PreParser> {
const PreParserExpression& expression) {}
V8_INLINE static void InferFunctionName() {}
V8_INLINE static void CheckAssigningFunctionLiteralToProperty(
const PreParserExpression& left, const PreParserExpression& right) {}
V8_INLINE void MarkExpressionAsAssigned(
const PreParserExpression& expression) {
// TODO(marja): To be able to produce the same errors, the preparser needs
......
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