Skip to content

Commit

Permalink
Unreviewed, build fix
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=246794

Don't include Width.h in WasmOps.h.

* Source/JavaScriptCore/wasm/WasmTypeDefinition.h:
(JSC::Wasm::Type::width const):
* Source/JavaScriptCore/wasm/generateWasmOpsHeader.py:

Canonical link: https://commits.webkit.org/255774@main
  • Loading branch information
Constellation committed Oct 20, 2022
1 parent 6c53388 commit b394482
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
11 changes: 11 additions & 0 deletions Source/JavaScriptCore/wasm/WasmTypeDefinition.h
Expand Up @@ -30,6 +30,7 @@
#if ENABLE(WEBASSEMBLY)

#include "WasmOps.h"
#include "Width.h"
#include "WriteBarrier.h"
#include <wtf/CheckedArithmetic.h>
#include <wtf/HashSet.h>
Expand All @@ -48,6 +49,16 @@ using StructFieldCount = uint32_t;
using RecursionGroupCount = uint32_t;
using ProjectionIndex = uint32_t;

inline Width Type::width() const
{
switch (kind) {
#define CREATE_CASE(name, id, b3type, inc, wasmName, width, ...) case TypeKind::name: return widthForBytes(width / 8);
FOR_EACH_WASM_TYPE(CREATE_CASE)
#undef CREATE_CASE
}
RELEASE_ASSERT_NOT_REACHED();
}

constexpr size_t typeKindSizeInBytes(TypeKind kind)
{
switch (kind) {
Expand Down
17 changes: 6 additions & 11 deletions Source/JavaScriptCore/wasm/generateWasmOpsHeader.py
Expand Up @@ -205,15 +205,18 @@ def atomicMemoryLog2AlignmentGenerator(filter):
#if ENABLE(WEBASSEMBLY)
#include "Width.h"
#include <cstdint>
#include <wtf/PrintStream.h>
#if ENABLE(WEBASSEMBLY_B3JIT)
#include "B3Type.h"
#endif
namespace JSC { namespace Wasm {
namespace JSC {
enum class Width : uint8_t;
namespace Wasm {
static constexpr unsigned expectedVersionNumber = """ + wasm.expectedVersionNumber + """;
Expand Down Expand Up @@ -257,15 +260,7 @@ def atomicMemoryLog2AlignmentGenerator(filter):
}
}
Width width() const
{
switch (kind) {
#define CREATE_CASE(name, id, b3type, inc, wasmName, width, ...) case TypeKind::name: return widthForBytes(width / 8);
FOR_EACH_WASM_TYPE(CREATE_CASE)
#undef CREATE_CASE
}
RELEASE_ASSERT_NOT_REACHED();
}
Width width() const;
// Use Wasm::isFuncref and Wasm::isExternref instead because they check againts all kind of representations of function referenes and external references.
Expand Down

0 comments on commit b394482

Please sign in to comment.