Loading config/external/wasm2c_sandbox_compiler/moz.yaml +2 −3 Original line number Diff line number Diff line Loading @@ -9,8 +9,8 @@ origin: description: wasm2c fork used for rlbox sandboxing url: https://github.com/WebAssembly/wabt release: 5abbeaab97eb802acccf866d9c8cc021c1f7e570 (2023-05-02T18:27:21Z). revision: 5abbeaab97eb802acccf866d9c8cc021c1f7e570 release: 805bebffde3c41fe4f1255deccc7bcb5b7e05dfa (2023-04-26T15:06:45Z). revision: 805bebffde3c41fe4f1255deccc7bcb5b7e05dfa license: Apache-2.0 license-file: LICENSE Loading Loading @@ -44,4 +44,3 @@ vendoring: - src/tools/wast* - src/tools/wat* - src/tools/wasm2w* - wasm2c/wasm-rt-exceptions* third_party/wasm2c/include/wabt/c-writer.h +0 −3 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ #include <functional> #include "wabt/common.h" #include "wabt/feature.h" #include "wabt/ir.h" namespace wabt { Loading @@ -29,8 +28,6 @@ class Stream; struct WriteCOptions { std::string_view module_name; /* Set of wasm features enabled for wasm2c */ Features* features; /* * name_to_output_file_index takes const iterators to begin and end of a list * of all functions in the module, number of imported functions, and number of Loading third_party/wasm2c/src/c-writer.cc +9 −22 Original line number Diff line number Diff line Loading @@ -297,7 +297,6 @@ class CWriter { static void SerializeFuncType(const FuncType&, std::string&); std::string GetGlobalName(ModuleFieldType, const std::string&) const; std::string GetLocalName(const std::string&, bool is_label) const; void Indent(int size = INDENT_SIZE); void Dedent(int size = INDENT_SIZE); Loading Loading @@ -368,7 +367,6 @@ class CWriter { const std::string&); void WriteCallIndirectFuncDeclaration(const FuncDeclaration&, const std::string&); void WriteFeatureMacros(); void WriteModuleInstance(); void WriteGlobals(); void WriteGlobal(const Global&, const std::string&); Loading Loading @@ -912,13 +910,6 @@ std::string CWriter::DefineLocalScopeName(std::string_view name, kLocalSymbolPrefix + MangleName(StripLeadingDollar(name))); } std::string CWriter::GetLocalName(const std::string& name, bool is_label) const { std::string mangled = name + (is_label ? kLabelSuffix : kParamSuffix); assert(local_sym_map_.count(mangled) == 1); return local_sym_map_.at(mangled); } std::string CWriter::DefineParamName(std::string_view name) { return DefineLocalScopeName(name, false); } Loading Loading @@ -1030,15 +1021,21 @@ void CWriter::Write(std::string_view s) { } void CWriter::Write(const ParamName& name) { Write(GetLocalName(name.name, false)); std::string mangled = name.name + kParamSuffix; assert(local_sym_map_.count(mangled) == 1); Write(local_sym_map_[mangled]); } void CWriter::Write(const LabelName& name) { Write(GetLocalName(name.name, true)); std::string mangled = name.name + kLabelSuffix; assert(local_sym_map_.count(mangled) == 1); Write(local_sym_map_[mangled]); } void CWriter::Write(const GlobalName& name) { Write(GetGlobalName(name.type, name.name)); std::string mangled = name.name + MangleField(name.type); assert(global_sym_map_.count(mangled) == 1); Write(global_sym_map_.at(mangled)); } void CWriter::Write(const ExternalPtr& name) { Loading Loading @@ -1790,15 +1787,6 @@ void CWriter::WriteCallIndirectFuncDeclaration(const FuncDeclaration& decl, Write(")"); } void CWriter::WriteFeatureMacros() { if (options_.features->exceptions_enabled()) { Write("#define WASM_RT_ENABLE_EXCEPTION_HANDLING", Newline(), Newline()); } if (options_.features->simd_enabled()) { Write("#define WASM_RT_ENABLE_SIMD", Newline(), Newline()); } } void CWriter::WriteModuleInstance() { BeginInstance(); WriteGlobals(); Loading Loading @@ -5132,7 +5120,6 @@ void CWriter::WriteCHeader() { Write("#ifndef ", guard, Newline()); Write("#define ", guard, Newline()); Write(Newline()); WriteFeatureMacros(); Write(s_header_top); Write(Newline()); WriteModuleInstance(); Loading third_party/wasm2c/src/prebuilt/wasm2c_header_top.cc +0 −7 Original line number Diff line number Diff line Loading @@ -4,13 +4,6 @@ R"w2c_template( #include "wasm-rt.h" )w2c_template" R"w2c_template( #if defined(WASM_RT_ENABLE_EXCEPTION_HANDLING) )w2c_template" R"w2c_template(#include "wasm-rt-exceptions.h" )w2c_template" R"w2c_template(#endif )w2c_template" R"w2c_template( #if defined(WASM_RT_ENABLE_SIMD) )w2c_template" R"w2c_template(#include "simde/wasm/simd128.h" Loading third_party/wasm2c/src/tools/wasm2c.cc +2 −3 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ examples: static const std::string supported_features[] = { "multi-memory", "multi-value", "sign-extension", "saturating-float-to-int", "exceptions", "memory64", "extended-const", "simd"}; "exceptions", "memory64", "extended-const"}; static bool IsFeatureSupported(const std::string& feature) { return std::find(std::begin(supported_features), std::end(supported_features), Loading Loading @@ -100,13 +100,12 @@ static void ParseOptions(int argc, char** argv) { ConvertBackslashToSlash(&s_infile); }); parser.Parse(argc, argv); s_write_c_options.features = &s_features; bool any_non_supported_feature = false; #define WABT_FEATURE(variable, flag, default_, help) \ any_non_supported_feature |= \ (s_features.variable##_enabled() != default_) && \ s_features.variable##_enabled() && !IsFeatureSupported(flag); !IsFeatureSupported(flag); #include "wabt/feature.def" #undef WABT_FEATURE Loading Loading
config/external/wasm2c_sandbox_compiler/moz.yaml +2 −3 Original line number Diff line number Diff line Loading @@ -9,8 +9,8 @@ origin: description: wasm2c fork used for rlbox sandboxing url: https://github.com/WebAssembly/wabt release: 5abbeaab97eb802acccf866d9c8cc021c1f7e570 (2023-05-02T18:27:21Z). revision: 5abbeaab97eb802acccf866d9c8cc021c1f7e570 release: 805bebffde3c41fe4f1255deccc7bcb5b7e05dfa (2023-04-26T15:06:45Z). revision: 805bebffde3c41fe4f1255deccc7bcb5b7e05dfa license: Apache-2.0 license-file: LICENSE Loading Loading @@ -44,4 +44,3 @@ vendoring: - src/tools/wast* - src/tools/wat* - src/tools/wasm2w* - wasm2c/wasm-rt-exceptions*
third_party/wasm2c/include/wabt/c-writer.h +0 −3 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ #include <functional> #include "wabt/common.h" #include "wabt/feature.h" #include "wabt/ir.h" namespace wabt { Loading @@ -29,8 +28,6 @@ class Stream; struct WriteCOptions { std::string_view module_name; /* Set of wasm features enabled for wasm2c */ Features* features; /* * name_to_output_file_index takes const iterators to begin and end of a list * of all functions in the module, number of imported functions, and number of Loading
third_party/wasm2c/src/c-writer.cc +9 −22 Original line number Diff line number Diff line Loading @@ -297,7 +297,6 @@ class CWriter { static void SerializeFuncType(const FuncType&, std::string&); std::string GetGlobalName(ModuleFieldType, const std::string&) const; std::string GetLocalName(const std::string&, bool is_label) const; void Indent(int size = INDENT_SIZE); void Dedent(int size = INDENT_SIZE); Loading Loading @@ -368,7 +367,6 @@ class CWriter { const std::string&); void WriteCallIndirectFuncDeclaration(const FuncDeclaration&, const std::string&); void WriteFeatureMacros(); void WriteModuleInstance(); void WriteGlobals(); void WriteGlobal(const Global&, const std::string&); Loading Loading @@ -912,13 +910,6 @@ std::string CWriter::DefineLocalScopeName(std::string_view name, kLocalSymbolPrefix + MangleName(StripLeadingDollar(name))); } std::string CWriter::GetLocalName(const std::string& name, bool is_label) const { std::string mangled = name + (is_label ? kLabelSuffix : kParamSuffix); assert(local_sym_map_.count(mangled) == 1); return local_sym_map_.at(mangled); } std::string CWriter::DefineParamName(std::string_view name) { return DefineLocalScopeName(name, false); } Loading Loading @@ -1030,15 +1021,21 @@ void CWriter::Write(std::string_view s) { } void CWriter::Write(const ParamName& name) { Write(GetLocalName(name.name, false)); std::string mangled = name.name + kParamSuffix; assert(local_sym_map_.count(mangled) == 1); Write(local_sym_map_[mangled]); } void CWriter::Write(const LabelName& name) { Write(GetLocalName(name.name, true)); std::string mangled = name.name + kLabelSuffix; assert(local_sym_map_.count(mangled) == 1); Write(local_sym_map_[mangled]); } void CWriter::Write(const GlobalName& name) { Write(GetGlobalName(name.type, name.name)); std::string mangled = name.name + MangleField(name.type); assert(global_sym_map_.count(mangled) == 1); Write(global_sym_map_.at(mangled)); } void CWriter::Write(const ExternalPtr& name) { Loading Loading @@ -1790,15 +1787,6 @@ void CWriter::WriteCallIndirectFuncDeclaration(const FuncDeclaration& decl, Write(")"); } void CWriter::WriteFeatureMacros() { if (options_.features->exceptions_enabled()) { Write("#define WASM_RT_ENABLE_EXCEPTION_HANDLING", Newline(), Newline()); } if (options_.features->simd_enabled()) { Write("#define WASM_RT_ENABLE_SIMD", Newline(), Newline()); } } void CWriter::WriteModuleInstance() { BeginInstance(); WriteGlobals(); Loading Loading @@ -5132,7 +5120,6 @@ void CWriter::WriteCHeader() { Write("#ifndef ", guard, Newline()); Write("#define ", guard, Newline()); Write(Newline()); WriteFeatureMacros(); Write(s_header_top); Write(Newline()); WriteModuleInstance(); Loading
third_party/wasm2c/src/prebuilt/wasm2c_header_top.cc +0 −7 Original line number Diff line number Diff line Loading @@ -4,13 +4,6 @@ R"w2c_template( #include "wasm-rt.h" )w2c_template" R"w2c_template( #if defined(WASM_RT_ENABLE_EXCEPTION_HANDLING) )w2c_template" R"w2c_template(#include "wasm-rt-exceptions.h" )w2c_template" R"w2c_template(#endif )w2c_template" R"w2c_template( #if defined(WASM_RT_ENABLE_SIMD) )w2c_template" R"w2c_template(#include "simde/wasm/simd128.h" Loading
third_party/wasm2c/src/tools/wasm2c.cc +2 −3 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ examples: static const std::string supported_features[] = { "multi-memory", "multi-value", "sign-extension", "saturating-float-to-int", "exceptions", "memory64", "extended-const", "simd"}; "exceptions", "memory64", "extended-const"}; static bool IsFeatureSupported(const std::string& feature) { return std::find(std::begin(supported_features), std::end(supported_features), Loading Loading @@ -100,13 +100,12 @@ static void ParseOptions(int argc, char** argv) { ConvertBackslashToSlash(&s_infile); }); parser.Parse(argc, argv); s_write_c_options.features = &s_features; bool any_non_supported_feature = false; #define WABT_FEATURE(variable, flag, default_, help) \ any_non_supported_feature |= \ (s_features.variable##_enabled() != default_) && \ s_features.variable##_enabled() && !IsFeatureSupported(flag); !IsFeatureSupported(flag); #include "wabt/feature.def" #undef WABT_FEATURE Loading