Page MenuHomePhabricator

Bug 1891182 - part 10 - remove Metadata and make AsmJSMetadata standalone. r=rhunt.
ClosedPublic

Authored by jseward on May 22 2024, 9:14 AM.
Referenced Files
Unknown Object (File)
Nov 15 2025, 7:04 AM
Unknown Object (File)
Nov 15 2025, 3:42 AM
Unknown Object (File)
Nov 14 2025, 10:56 AM
Unknown Object (File)
Nov 14 2025, 6:09 AM
Unknown Object (File)
Nov 13 2025, 10:03 PM
Unknown Object (File)
Nov 7 2025, 9:39 AM
Unknown Object (File)
Nov 6 2025, 12:45 PM
Unknown Object (File)
Nov 6 2025, 5:27 AM
Subscribers

Details

Summary

The #09 patch removed all wasm-specific fields from wasm::Metadata, but did
not remove wasm::Metadata itself, because it is inherited from by
AsmJSMetadata, and used to provide different behaviour for wasm vs asm.js in a
few obscure cases related to the profiler.

This patch restricts wasm::Metadata to be an abstract class that provides
access to (is the pure virtual base class of) AsmJSMetadata. wasm::Metadata is
removed from WasmCode.h and instead reappears in AsmJS.h in pure virtual form.
Any place that previously took a Metadata& now takes takes a Metadata*, and
that is non-null only in the case when we are compiling asm.js.

The effect is to restrict wasm::Metadata and js::AsmJSMetadata to providing
support for asm.js compilation only. The next patch in the series (#11)
completes the transformation by renaming those two types appropriately.

Diff Detail

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.
rhunt added inline comments.
js/src/wasm/AsmJS.cpp
417–419

Yeah this is not correct, but it wasn't correct before this patch either.

You'd need to include the sizes of all the malloc data. It's probably not worth it for now?

js/src/wasm/WasmCode.h
256–267

This should be a method on CodeMetadata, it's only ever called using fields from that class.

This revision is now accepted and ready to land.Jun 4 2024, 5:10 PM

Code analysis found 3 defects in diff 878325:

  • 1 defect found by clang-format
  • 2 defects found by clang-tidy
WARNING: Found 3 defects (warning level) that can be dismissed.

You can run this analysis locally with:

  • ./mach static-analysis check --outgoing (C/C++)
  • ./mach clang-format -p js/src/wasm/AsmJS.h

For your convenience, here is a patch that fixes all the clang-format defects (use it in your repository with hg import or git apply -p0).


If you see a problem in this automated review, please report it here.

You can view these defects in the Diff Detail section of Phabricator diff 878325.

This revision is now accepted and ready to land.Jun 19 2024, 9:46 PM

Code analysis found 3 defects in diff 879687:

  • 1 defect found by clang-format
  • 2 defects found by clang-tidy
WARNING: Found 3 defects (warning level) that can be dismissed.

You can run this analysis locally with:

  • ./mach static-analysis check --outgoing (C/C++)
  • ./mach clang-format -p js/src/wasm/AsmJS.h

For your convenience, here is a patch that fixes all the clang-format defects (use it in your repository with hg import or git apply -p0).


If you see a problem in this automated review, please report it here.

You can view these defects in the Diff Detail section of Phabricator diff 879687.