Closed Bug 1607429 Opened 5 years ago Closed 5 years ago

Remove unused functionality from ParseNode::getConstantValue

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(7 files)

No description provided.

The ForCopyOnWriteArray and DontAllowObjects flags are both unused, so we
can remove them along with the AllowConstantObjects parameter.

Also remove the NewObjectKind parameter because it's always TenuredObject.

Depends on D58927

getConstantValue() is only called for callsite objects, so we only need to handle
TemplateStringExpr, RawUndefinedExpr, CallSiteObj, and ArrayExpr (for the
raw nodes).

Depends on D58928

Also remove the recursion for template-string and raw-undefined nodes.

With the recursion gone, it's easy to see the call to CombineArrayElementTypes
can be removed as well, because ncompare is always 0, which makes
CombineArrayElementTypes a no-op.

Finally we can then also remove the compare and ncompare parameters from
getConstantValue.

Depends on D58929

NewArrayKind::Normal is the default value when calling newArrayObject, so
there's no need to pass it explicitly.

Depends on D58930

Priority: -- → P1
Pushed by rmaries@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e4ba2e73e400 Part 1: Remove unused function BytecodeEmitter::emitSingletonInitialiser. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/d61e2e6e9c07 Part 2: Remove no longer necessary AllowConstantObjects parameter. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/ebc34e43593e Part 3: Don't handle parse nodes not present in callsite objects. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/7263c1322f9f Part 4: Only support callsite objects in getConstantValue. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/a97c70e9b377 Part 5: Remove explicit NewArrayKind parameter. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/c09ecff23a9e Part 6: Change getConstantValue to directly return an array object. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/118536529169 Part 7: Move getConstantValue into CallSiteNode and rename it to getArrayValue. r=mgaudet
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: