Closed Bug 1789243 Opened 3 months ago Closed 3 months ago

Various clean-ups for js/src/frontend

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox106 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(24 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

Remove unused functions, update some code to C++17, etc.

This allows to call dump() from contexts where we don't have a parser anymore,
for example from BytecodeEmitter.

Depends on D156432

This avoids some ParseNodeKind::ParamsBody checks and allows more changes
for the next parts.

Depends on D156434

And update some code which assumed the previous implementation details around
the function body are still present:

ReflectParse:

  • Remove duplicate parameter from functionArgs() in preparation for the
    next part.
  • Directly access the function body as LexicalScopeNode.
  • Moved functionArgs() before the switch statement, because it's always
    called with the same parameters.

FunctionFormalParametersList():

  • Moved into AsmJS because it's only used there. Also simplified it slightly.

Depends on D156435

Add a helper to access the function body node.

Depends on D156436

Add a helper to access the function parameters.

Depends on D156437

This is a bit nicer than manually traversing through pn_next.

Depends on D156438

More changes similar to the last part.

Depends on D156439

Drive-by change:

  • Remove unnecessary EMIT_LINENOTE default parameters.

Depends on D156441

These methods aren't used anymore.

Depends on D156442

This gives a bit more type safety at compile-time and lets us remove some
helper functions in the next parts.

Depends on D156444

This function isn't used anymore after the last part except for a single
assertion.

Depends on D156445

Remove the direct access to the BytecodeEmitter::parser in preparation for
the next parts.

Depends on D156446

Change BCEParserHandle with ErrorReporter member, because we only need
the ErrorReporter methods.

Drive-by change:

  • Simplify a constructor to only pass the relevant arguments.

Depends on D156447

We don't need this abstraction anymore.

Depends on D156448

Make all ErrorReporter methods const in preparation for the next part.

Depends on D156449

Using a reference avoids some extra setup code.

Depends on D156450

Using lambda functions allows to remove extra code.

Depends on D156452

InitExpr can't occur in this context.

Depends on D156453

It's confusing to create an AssignmentNode which doesn't pass the
is<AssignmentNode>() test.

Depends on D156454

Drive-by change:

  • Remove unused prependAndUpdatePos method

Depends on D156455

Pushed by andre.bargull@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/f58446bee033
Part 1: Add two missing cases for script flags dump. r=arai
https://hg.mozilla.org/integration/autoland/rev/98295959abc4
Part 2: Change ParseNode::dump() to accept ParserAtomsTable instead of ParserBase. r=arai
https://hg.mozilla.org/integration/autoland/rev/f9222fee2d8d
Part 3: Add a separate ParseNode type for ParamsBody. r=arai
https://hg.mozilla.org/integration/autoland/rev/7bdd388b64d0
Part 4: Correct descriptions of Function and ParamsBody nodes. r=arai
https://hg.mozilla.org/integration/autoland/rev/12c3dbf79386
Part 5: Add ParamsBodyNode::body(). r=arai
https://hg.mozilla.org/integration/autoland/rev/26765b9912eb
Part 6: Add ParamsBodyNode::parameters(). r=arai
https://hg.mozilla.org/integration/autoland/rev/929247c8da95
Part 7: Use range-based for-loops for array byte code emission. r=arai
https://hg.mozilla.org/integration/autoland/rev/253d94a7d37d
Part 8: Use range-based for-loops for remaining cases. r=arai
https://hg.mozilla.org/integration/autoland/rev/8034afec3002
Part 9: Remove duplicate updateSourceCoordNotes call. r=arai
https://hg.mozilla.org/integration/autoland/rev/aeae85054fcb
Part 10: Make emitArray() less branchy for Spread expressions. r=arai
https://hg.mozilla.org/integration/autoland/rev/cd0461cc27db
Part 11: Remove unused ErrorReporter methods. r=arai
https://hg.mozilla.org/integration/autoland/rev/5801438ffb41
Part 12: Remove unused BCEParserHandle methods. r=arai
https://hg.mozilla.org/integration/autoland/rev/a34ac5290669
Part 13: Add a separate ParseNode type for declaration lists. r=arai
https://hg.mozilla.org/integration/autoland/rev/0ce5e30616aa
Part 14: Remove BCEParserHandle::astGenerator(). r=arai
https://hg.mozilla.org/integration/autoland/rev/dc214bb8e2bb
Part 15: Add BytecodeEmitter::errorReporter(). r=arai
https://hg.mozilla.org/integration/autoland/rev/796769160dc7
Part 16: Remove BytecodeEmitter::parser member. r=arai
https://hg.mozilla.org/integration/autoland/rev/1f7c7051aec9
Part 17: Remove BCEParserHandle. r=arai
https://hg.mozilla.org/integration/autoland/rev/3b19b19ff38b
Part 18: Make ErrorReporter methods const. r=arai
https://hg.mozilla.org/integration/autoland/rev/7588e7120056
Part 19: Change BytecodeEmitter::errorReporter to a const reference. r=arai
https://hg.mozilla.org/integration/autoland/rev/bae5f4d0fd93
Part 20: Remove unused EitherParser methods. r=arai
https://hg.mozilla.org/integration/autoland/rev/676813f8d98a
Part 21: Simplify matchers in EitherParser. r=arai
https://hg.mozilla.org/integration/autoland/rev/0f54fd157566
Part 22: Remove some bogus checks for InitExpr. r=arai
https://hg.mozilla.org/integration/autoland/rev/49007d72a1f7
Part 23: Don't use AssignmentNode for InitExpr. r=arai
https://hg.mozilla.org/integration/autoland/rev/2de02f478dc9
Part 24: Inline ListNode::makeEmpty(). r=arai
Blocks: sm-frontend
Severity: -- → N/A
Priority: -- → P1
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
You need to log in before you can comment on or make changes to this bug.