From dd2fb0af91b1ebed6bb4ed39669c34f1c2c8ecb1 Mon Sep 17 00:00:00 2001 From: Ryan Hyun Choi Date: Thu, 4 Nov 2021 11:25:21 +0900 Subject: [PATCH] LWNode_Release_211104_926ca98 Change-Id: I1809355761778188f1141c15e3be139d30adef4d Signed-off-by: Ryan Choi --- README.md | 13 +- common.gypi | 9 + configure.py | 21 +- lib/internal/modules/cjs/loader.js | 14 +- lib/internal/process/per_thread.js | 8 + lwnode/build.sh | 4 +- lwnode/code/escargotshim/common.gypi | 5 + .../escargotshim/deps/escargot/Jenkinsfile | 4 - .../deps/escargot/docs/Debugger.md | 64 + .../escargotshim/deps/escargot/src/Escargot.h | 4 + .../deps/escargot/src/api/EscargotPublic.cpp | 193 +- .../deps/escargot/src/api/EscargotPublic.h | 80 +- .../escargot/src/builtins/BuiltinAtomics.cpp | 2 +- .../escargot/src/builtins/BuiltinError.cpp | 14 + .../escargot/src/builtins/BuiltinIntl.cpp | 305 +- .../deps/escargot/src/debugger/Debugger.cpp | 130 +- .../deps/escargot/src/debugger/Debugger.h | 55 +- .../escargot/src/debugger/DebuggerTcp.cpp | 1 + .../src/interpreter/ByteCodeGenerator.cpp | 47 +- .../src/interpreter/ByteCodeGenerator.h | 6 +- .../src/interpreter/ByteCodeInterpreter.cpp | 40 +- .../deps/escargot/src/intl/Intl.cpp | 41 +- .../deps/escargot/src/intl/Intl.h | 39 + .../deps/escargot/src/intl/IntlCollator.cpp | 11 +- .../escargot/src/intl/IntlDateTimeFormat.cpp | 110 +- .../escargot/src/intl/IntlDateTimeFormat.h | 2 +- .../escargot/src/intl/IntlDisplayNames.cpp | 369 + .../deps/escargot/src/intl/IntlDisplayNames.h | 77 + .../deps/escargot/src/intl/IntlListFormat.cpp | 308 + .../deps/escargot/src/intl/IntlListFormat.h | 66 + .../deps/escargot/src/intl/IntlLocale.cpp | 293 +- .../deps/escargot/src/intl/IntlLocale.h | 8 + .../deps/escargot/src/parser/CodeBlock.h | 12 +- .../deps/escargot/src/parser/Script.cpp | 34 +- .../deps/escargot/src/parser/Script.h | 8 +- .../deps/escargot/src/parser/ScriptParser.cpp | 13 +- .../deps/escargot/src/parser/ast/ASTContext.h | 2 +- .../escargot/src/parser/ast/FunctionNode.h | 26 + .../escargot/src/parser/ast/IdentifierNode.h | 13 +- .../escargot/src/parser/ast/LiteralNode.h | 2 +- .../src/parser/ast/ReturnStatementNode.h | 2 +- .../src/parser/esprima_cpp/esprima.cpp | 4 +- .../deps/escargot/src/runtime/ArrayBuffer.cpp | 1 - .../deps/escargot/src/runtime/ArrayBuffer.h | 4 - .../src/runtime/ArrayBufferObject.cpp | 15 +- .../escargot/src/runtime/BackingStore.cpp | 121 +- .../deps/escargot/src/runtime/BackingStore.h | 147 +- .../escargot/src/runtime/EnvironmentRecord.h | 29 - .../escargot/src/runtime/ExecutionPauser.cpp | 26 + .../escargot/src/runtime/ExecutionPauser.h | 11 + .../escargot/src/runtime/ExecutionState.cpp | 30 +- .../escargot/src/runtime/ExecutionState.h | 47 +- .../escargot/src/runtime/FunctionObject.cpp | 106 +- .../escargot/src/runtime/FunctionObject.h | 2 +- .../escargot/src/runtime/FunctionTemplate.cpp | 5 +- .../escargot/src/runtime/GlobalObject.cpp | 18 + .../deps/escargot/src/runtime/GlobalObject.h | 8 +- .../escargot/src/runtime/IteratorObject.h | 5 +- .../deps/escargot/src/runtime/Job.cpp | 18 + .../escargot/src/runtime/ObjectTemplate.cpp | 4 + .../deps/escargot/src/runtime/PointerValue.h | 36 + .../escargot/src/runtime/PromiseObject.cpp | 6 + .../deps/escargot/src/runtime/PromiseObject.h | 10 + .../deps/escargot/src/runtime/SandBox.cpp | 20 +- .../deps/escargot/src/runtime/SandBox.h | 2 +- .../src/runtime/ScriptFunctionObject.cpp | 1 + .../src/runtime/SharedArrayBufferObject.cpp | 39 +- .../src/runtime/SharedArrayBufferObject.h | 35 +- .../escargot/src/runtime/StaticStrings.cpp | 12 +- .../deps/escargot/src/runtime/StaticStrings.h | 44 +- .../deps/escargot/src/runtime/String.cpp | 5 - .../deps/escargot/src/runtime/String.h | 15 +- .../deps/escargot/src/runtime/Template.cpp | 16 + .../deps/escargot/src/runtime/Template.h | 2 + .../deps/escargot/src/runtime/ThreadLocal.cpp | 91 + .../deps/escargot/src/runtime/ThreadLocal.h | 52 + .../deps/escargot/src/runtime/VMInstance.cpp | 183 +- .../deps/escargot/src/runtime/VMInstance.h | 39 +- .../SerializedSharedArrayBufferObjectValue.h | 6 +- .../src/runtime/serialization/Serializer.cpp | 2 +- .../deps/escargot/src/wasm/BuiltinWASM.cpp | 14 +- .../deps/escargot/src/wasm/WASMObject.cpp | 4 +- .../escargot/third_party/GCutil/Allocator.cpp | 27 - .../third_party/GCutil/bdwgc/include/gc.h | 7 - .../rapidjson/include/rapidjson/document.h | 4 +- .../runtime_icu_binder/ICUPolyfill.h | 25 + .../third_party/runtime_icu_binder/ICUTypes.h | 244 + .../runtime_icu_binder/RuntimeICUBinder.h | 35 +- .../third_party/wasm/wabt/CMakeLists.txt | 5 +- .../escargot/third_party/wasm/wabt/Makefile | 2 +- .../escargot/third_party/wasm/wabt/README.md | 35 +- .../third_party/wasm/wabt/src/apply-names.cc | 26 +- .../wasm/wabt/src/binary-reader-ir.cc | 300 +- .../wasm/wabt/src/binary-reader-logging.cc | 66 +- .../wasm/wabt/src/binary-reader-logging.h | 48 +- .../wasm/wabt/src/binary-reader-nop.h | 56 +- .../wasm/wabt/src/binary-reader-objdump.cc | 178 +- .../wasm/wabt/src/binary-reader-objdump.h | 3 +- .../wasm/wabt/src/binary-reader.cc | 228 +- .../third_party/wasm/wabt/src/binary-reader.h | 48 +- .../wasm/wabt/src/binary-writer.cc | 132 +- .../third_party/wasm/wabt/src/binary.h | 4 +- .../third_party/wasm/wabt/src/c-writer.cc | 201 +- .../third_party/wasm/wabt/src/common.cc | 4 +- .../third_party/wasm/wabt/src/common.h | 35 +- .../third_party/wasm/wabt/src/config.h.in | 5 + .../wasm/wabt/src/decompiler-ast.h | 8 + .../wasm/wabt/src/decompiler-naming.h | 2 +- .../wasm/wabt/src/emscripten-exported.json | 1 + .../third_party/wasm/wabt/src/expr-visitor.cc | 39 +- .../third_party/wasm/wabt/src/expr-visitor.h | 11 +- .../third_party/wasm/wabt/src/feature.cc | 6 + .../third_party/wasm/wabt/src/feature.def | 27 +- .../wasm/wabt/src/generate-names.cc | 31 +- .../wabt/src/interp/binary-reader-interp.cc | 54 +- .../wasm/wabt/src/interp/interp-inl.h | 28 +- .../wasm/wabt/src/interp/interp-math.h | 10 + .../wasm/wabt/src/interp/interp-wasi.cc | 166 +- .../wasm/wabt/src/interp/interp-wasm-c-api.cc | 6 +- .../wasm/wabt/src/interp/interp.cc | 241 +- .../third_party/wasm/wabt/src/interp/interp.h | 61 +- .../wasm/wabt/src/interp/istream.cc | 90 +- .../wasm/wabt/src/interp/istream.h | 3 + .../third_party/wasm/wabt/src/ir-util.cc | 15 +- .../escargot/third_party/wasm/wabt/src/ir.cc | 48 +- .../escargot/third_party/wasm/wabt/src/ir.h | 91 +- .../third_party/wasm/wabt/src/leb128.cc | 7 + .../third_party/wasm/wabt/src/leb128.h | 1 + .../wasm/wabt/src/lexer-keywords.txt | 72 +- .../third_party/wasm/wabt/src/opcode.cc | 26 +- .../third_party/wasm/wabt/src/opcode.def | 86 +- .../wasm/wabt/src/prebuilt/.clang-format | 2 + .../wasm/wabt/src/prebuilt/lexer-keywords.cc | 2635 ++-- .../wasm/wabt/src/prebuilt/wasm2c.include.c | 26 +- .../wasm/wabt/src/resolve-names.cc | 34 +- .../wasm/wabt/src/shared-validator.cc | 105 +- .../wasm/wabt/src/shared-validator.h | 17 +- .../third_party/wasm/wabt/src/test-interp.cc | 2 +- .../third_party/wasm/wabt/src/token.def | 8 +- .../wasm/wabt/src/tools/wasm-objdump.cc | 4 + .../third_party/wasm/wabt/src/type-checker.cc | 86 +- .../third_party/wasm/wabt/src/type-checker.h | 6 +- .../third_party/wasm/wabt/src/validator.cc | 57 +- .../third_party/wasm/wabt/src/wasm2c.c.tmpl | 26 +- .../third_party/wasm/wabt/src/wast-parser.cc | 222 +- .../third_party/wasm/wabt/src/wast-parser.h | 5 +- .../third_party/wasm/wabt/src/wat-writer.cc | 102 +- .../wasm/wabt/third_party/gtest/.clang-format | 4 + .../wasm/wabt/third_party/gtest/.gitignore | 84 + .../wasm/wabt/third_party/gtest/BUILD.bazel | 179 + .../wabt/third_party/gtest/CMakeLists.txt | 36 + .../wabt/third_party/gtest/CONTRIBUTING.md | 142 + .../wasm/wabt/third_party/gtest/LICENSE | 28 + .../wasm/wabt/third_party/gtest/README.md | 134 + .../wasm/wabt/third_party/gtest/WORKSPACE | 23 + .../wasm/wabt/third_party/gtest/appveyor.yml | 154 + .../third_party/gtest/ci/build-linux-bazel.sh | 37 + .../third_party/gtest/ci/build-platformio.sh | 2 + .../wabt/third_party/gtest/ci/env-linux.sh | 41 + .../wasm/wabt/third_party/gtest/ci/env-osx.sh | 47 + .../third_party/gtest/ci/get-nprocessors.sh | 48 + .../third_party/gtest/ci/install-linux.sh | 49 + .../wabt/third_party/gtest/ci/install-osx.sh | 40 + .../gtest/ci/install-platformio.sh | 5 + .../wabt/third_party/gtest/ci/log-config.sh | 51 + .../wasm/wabt/third_party/gtest/ci/travis.sh | 44 + .../gtest/googlemock/CMakeLists.txt | 233 + .../third_party/gtest/googlemock/CONTRIBUTORS | 40 + .../wabt/third_party/gtest/googlemock/LICENSE | 28 + .../third_party/gtest/googlemock/README.md | 44 + .../gtest/googlemock/cmake/gmock.pc.in | 11 + .../gtest/googlemock/cmake/gmock_main.pc.in | 11 + .../gtest/googlemock/docs/cheat_sheet.md | 781 ++ .../gtest/googlemock/docs/cook_book.md | 4270 ++++++ .../gtest/googlemock/docs/for_dummies.md | 700 + .../gtest/googlemock/docs/gmock_faq.md | 396 + .../googlemock/include/gmock/gmock-actions.h | 1142 ++ .../include/gmock/gmock-cardinalities.h | 157 + .../include/gmock/gmock-function-mocker.h | 253 + .../include/gmock/gmock-generated-actions.h | 1884 +++ .../gmock/gmock-generated-actions.h.pump | 627 + .../gmock/gmock-generated-function-mockers.h | 752 + .../gmock-generated-function-mockers.h.pump | 227 + .../include/gmock/gmock-generated-matchers.h | 1097 ++ .../gmock/gmock-generated-matchers.h.pump | 346 + .../googlemock/include/gmock/gmock-matchers.h | 4568 ++++++ .../include/gmock/gmock-more-actions.h | 162 + .../include/gmock/gmock-more-matchers.h | 92 + .../include/gmock/gmock-nice-strict.h | 215 + .../include/gmock/gmock-spec-builders.h | 1985 +++ .../gtest/googlemock/include/gmock/gmock.h | 101 + .../include/gmock/internal/custom/README.md | 16 + .../internal/custom/gmock-generated-actions.h | 10 + .../custom/gmock-generated-actions.h.pump | 12 + .../gmock/internal/custom/gmock-matchers.h | 36 + .../gmock/internal/custom/gmock-port.h | 39 + .../gmock/internal/gmock-internal-utils.h | 513 + .../include/gmock/internal/gmock-port.h | 87 + .../include/gmock/internal/gmock-pp.h | 317 + .../googlemock/scripts/fuse_gmock_files.py | 240 + .../googlemock/scripts/generator/LICENSE | 203 + .../gtest/googlemock/scripts/generator/README | 34 + .../scripts/generator/README.cppclean | 115 + .../scripts/generator/cpp/__init__.py | 0 .../googlemock/scripts/generator/cpp/ast.py | 1736 +++ .../scripts/generator/cpp/gmock_class.py | 227 + .../scripts/generator/cpp/gmock_class_test.py | 466 + .../scripts/generator/cpp/keywords.py | 59 + .../scripts/generator/cpp/tokenize.py | 287 + .../googlemock/scripts/generator/cpp/utils.py | 41 + .../googlemock/scripts/generator/gmock_gen.py | 31 + .../gtest/googlemock/scripts/gmock-config.in | 303 + .../gtest/googlemock/scripts/gmock_doctor.py | 640 + .../gtest/googlemock/scripts/upload.py | 1387 ++ .../gtest/googlemock/scripts/upload_gmock.py | 78 + .../gtest/googlemock/src/gmock-all.cc | 46 + .../googlemock/src/gmock-cardinalities.cc | 155 + .../googlemock/src/gmock-internal-utils.cc | 200 + .../gtest/googlemock/src/gmock-matchers.cc | 462 + .../googlemock/src/gmock-spec-builders.cc | 888 ++ .../third_party/gtest/googlemock/src/gmock.cc | 213 + .../gtest/googlemock/src/gmock_main.cc | 65 + .../gtest/googletest/CMakeLists.txt | 328 + .../third_party/gtest/googletest/CONTRIBUTORS | 37 + .../wabt/third_party/gtest/googletest/LICENSE | 28 + .../third_party/gtest/googletest/README.md | 244 + .../gtest/googletest/cmake/Config.cmake.in | 9 + .../gtest/googletest/cmake/gtest.pc.in | 10 + .../gtest/googletest/cmake/gtest_main.pc.in | 11 + .../googletest/cmake/internal_utils.cmake | 358 + .../gtest/googletest/cmake/libgtest.la.in | 21 + .../gtest/googletest/docs/advanced.md | 2567 ++++ .../third_party/gtest/googletest/docs/faq.md | 753 + .../gtest/googletest/docs/pkgconfig.md | 141 + .../gtest/googletest/docs/primer.md | 567 + .../gtest/googletest/docs/pump_manual.md | 190 + .../gtest/googletest/docs/samples.md | 22 + .../include/gtest/gtest-death-test.h | 343 + .../googletest/include/gtest/gtest-matchers.h | 750 + .../googletest/include/gtest/gtest-message.h | 218 + .../include/gtest/gtest-param-test.h | 503 + .../googletest/include/gtest/gtest-printers.h | 928 ++ .../googletest/include/gtest/gtest-spi.h | 238 + .../include/gtest/gtest-test-part.h | 184 + .../include/gtest/gtest-typed-test.h | 330 + .../gtest/googletest/include/gtest/gtest.h | 2478 ++++ .../include/gtest/gtest_pred_impl.h | 359 + .../googletest/include/gtest/gtest_prod.h | 61 + .../include/gtest/internal/custom/README.md | 56 + .../gtest/internal/custom/gtest-port.h | 37 + .../gtest/internal/custom/gtest-printers.h | 42 + .../include/gtest/internal/custom/gtest.h | 37 + .../internal/gtest-death-test-internal.h | 304 + .../include/gtest/internal/gtest-filepath.h | 211 + .../include/gtest/internal/gtest-internal.h | 1380 ++ .../include/gtest/internal/gtest-param-util.h | 883 ++ .../include/gtest/internal/gtest-port-arch.h | 107 + .../include/gtest/internal/gtest-port.h | 2231 +++ .../include/gtest/internal/gtest-string.h | 171 + .../include/gtest/internal/gtest-type-util.h | 3335 +++++ .../gtest/internal/gtest-type-util.h.pump | 302 + .../gtest/googletest/samples/prime_tables.h | 126 + .../gtest/googletest/samples/sample1.cc | 66 + .../gtest/googletest/samples/sample1.h | 41 + .../googletest/samples/sample10_unittest.cc | 139 + .../googletest/samples/sample1_unittest.cc | 151 + .../gtest/googletest/samples/sample2.cc | 54 + .../gtest/googletest/samples/sample2.h | 81 + .../googletest/samples/sample2_unittest.cc | 107 + .../gtest/googletest/samples/sample3-inl.h | 172 + .../googletest/samples/sample3_unittest.cc | 149 + .../gtest/googletest/samples/sample4.cc | 54 + .../gtest/googletest/samples/sample4.h | 53 + .../googletest/samples/sample4_unittest.cc | 53 + .../googletest/samples/sample5_unittest.cc | 196 + .../googletest/samples/sample6_unittest.cc | 224 + .../googletest/samples/sample7_unittest.cc | 117 + .../googletest/samples/sample8_unittest.cc | 154 + .../googletest/samples/sample9_unittest.cc | 156 + .../gtest/googletest/scripts/common.py | 83 + .../googletest/scripts/fuse_gtest_files.py | 253 + .../googletest/scripts/gen_gtest_pred_impl.py | 730 + .../gtest/googletest/scripts/gtest-config.in | 274 + .../gtest/googletest/scripts/pump.py | 855 ++ .../gtest/googletest/scripts/release_docs.py | 158 + .../gtest/googletest/scripts/upload.py | 1387 ++ .../gtest/googletest/scripts/upload_gtest.py | 78 + .../gtest/googletest/src/gtest-all.cc | 48 + .../gtest/googletest/src/gtest-death-test.cc | 1653 +++ .../gtest/googletest/src/gtest-filepath.cc | 379 + .../gtest/googletest/src/gtest-internal-inl.h | 1211 ++ .../gtest/googletest/src/gtest-matchers.cc | 97 + .../gtest/googletest/src/gtest-port.cc | 1399 ++ .../gtest/googletest/src/gtest-printers.cc | 442 + .../gtest/googletest/src/gtest-test-part.cc | 104 + .../gtest/googletest/src/gtest-typed-test.cc | 118 + .../third_party/gtest/googletest/src/gtest.cc | 6177 ++++++++ .../gtest/googletest/src/gtest_main.cc | 47 + .../wasm/wabt/third_party/gtest/library.json | 59 + .../wabt/third_party/gtest/platformio.ini | 31 + .../wasm/wabt/third_party/ply/.gitignore | 9 + .../wasm/wabt/third_party/ply/ANNOUNCE | 40 + .../wasm/wabt/third_party/ply/CHANGES | 1343 ++ .../wasm/wabt/third_party/ply/MANIFEST.in | 8 + .../wasm/wabt/third_party/ply/README.md | 273 + .../wasm/wabt/third_party/ply/TODO | 16 + .../wabt/third_party/ply/doc/internal.html | 874 ++ .../wasm/wabt/third_party/ply/doc/makedoc.py | 194 + .../wasm/wabt/third_party/ply/doc/ply.html | 3459 +++++ .../wabt/third_party/ply/example/BASIC/README | 79 + .../third_party/ply/example/BASIC/basic.py | 71 + .../third_party/ply/example/BASIC/basiclex.py | 74 + .../third_party/ply/example/BASIC/basiclog.py | 79 + .../ply/example/BASIC/basinterp.py | 441 + .../third_party/ply/example/BASIC/basparse.py | 424 + .../third_party/ply/example/BASIC/dim.bas | 14 + .../third_party/ply/example/BASIC/func.bas | 5 + .../third_party/ply/example/BASIC/gcd.bas | 22 + .../third_party/ply/example/BASIC/gosub.bas | 13 + .../third_party/ply/example/BASIC/hello.bas | 4 + .../third_party/ply/example/BASIC/linear.bas | 17 + .../third_party/ply/example/BASIC/maxsin.bas | 12 + .../third_party/ply/example/BASIC/powers.bas | 13 + .../third_party/ply/example/BASIC/rand.bas | 4 + .../third_party/ply/example/BASIC/sales.bas | 20 + .../third_party/ply/example/BASIC/sears.bas | 18 + .../third_party/ply/example/BASIC/sqrt1.bas | 5 + .../third_party/ply/example/BASIC/sqrt2.bas | 4 + .../ply/example/GardenSnake/GardenSnake.py | 709 + .../ply/example/GardenSnake/README | 5 + .../wasm/wabt/third_party/ply/example/README | 10 + .../wabt/third_party/ply/example/ansic/README | 2 + .../third_party/ply/example/ansic/clex.py | 164 + .../third_party/ply/example/ansic/cparse.py | 864 ++ .../wabt/third_party/ply/example/calc/calc.py | 107 + .../third_party/ply/example/calcdebug/calc.py | 113 + .../third_party/ply/example/calceof/calc.py | 115 + .../third_party/ply/example/classcalc/calc.py | 157 + .../wabt/third_party/ply/example/cleanup.sh | 2 + .../ply/example/closurecalc/calc.py | 130 + .../third_party/ply/example/hedit/hedit.py | 48 + .../ply/example/newclasscalc/calc.py | 160 + .../third_party/ply/example/optcalc/README | 9 + .../third_party/ply/example/optcalc/calc.py | 119 + .../third_party/ply/example/unicalc/calc.py | 117 + .../wabt/third_party/ply/example/yply/README | 41 + .../wabt/third_party/ply/example/yply/ylex.py | 112 + .../third_party/ply/example/yply/yparse.py | 217 + .../wabt/third_party/ply/example/yply/yply.py | 53 + .../wasm/wabt/third_party/ply/ply/__init__.py | 5 + .../wasm/wabt/third_party/ply/ply/cpp.py | 908 ++ .../wasm/wabt/third_party/ply/ply/ctokens.py | 133 + .../wasm/wabt/third_party/ply/ply/lex.py | 1097 ++ .../wasm/wabt/third_party/ply/ply/yacc.py | 3471 +++++ .../wasm/wabt/third_party/ply/ply/ygen.py | 74 + .../wasm/wabt/third_party/ply/setup.cfg | 2 + .../wasm/wabt/third_party/ply/setup.py | 31 + .../wabt/third_party/testsuite/.gitignore | 2 + .../third_party/testsuite/Contributing.md | 8 + .../wasm/wabt/third_party/testsuite/LICENSE | 202 + .../wasm/wabt/third_party/testsuite/README.md | 18 + .../wabt/third_party/testsuite/address.wast | 610 + .../wabt/third_party/testsuite/align.wast | 866 ++ .../third_party/testsuite/binary-leb128.wast | 1001 ++ .../wabt/third_party/testsuite/binary.wast | 993 ++ .../wabt/third_party/testsuite/block.wast | 1491 ++ .../wasm/wabt/third_party/testsuite/br.wast | 657 + .../wabt/third_party/testsuite/br_if.wast | 665 + .../wabt/third_party/testsuite/br_table.wast | 1628 +++ .../wasm/wabt/third_party/testsuite/call.wast | 518 + .../third_party/testsuite/call_indirect.wast | 971 ++ .../wabt/third_party/testsuite/comments.wast | Bin 0 -> 701 bytes .../wabt/third_party/testsuite/const.wast | 1061 ++ .../third_party/testsuite/conversions.wast | 702 + .../wabt/third_party/testsuite/custom.wast | 120 + .../wasm/wabt/third_party/testsuite/data.wast | 458 + .../wasm/wabt/third_party/testsuite/elem.wast | 442 + .../third_party/testsuite/endianness.wast | 217 + .../wabt/third_party/testsuite/exports.wast | 230 + .../third_party/testsuite/extract-parts.sh | 35 + .../wasm/wabt/third_party/testsuite/f32.wast | 2533 ++++ .../third_party/testsuite/f32_bitwise.wast | 376 + .../wabt/third_party/testsuite/f32_cmp.wast | 2422 ++++ .../wasm/wabt/third_party/testsuite/f64.wast | 2533 ++++ .../third_party/testsuite/f64_bitwise.wast | 376 + .../wabt/third_party/testsuite/f64_cmp.wast | 2422 ++++ .../wasm/wabt/third_party/testsuite/fac.wast | 109 + .../third_party/testsuite/float_exprs.wast | 2570 ++++ .../third_party/testsuite/float_literals.wast | 507 + .../third_party/testsuite/float_memory.wast | 157 + .../third_party/testsuite/float_misc.wast | 678 + .../wabt/third_party/testsuite/forward.wast | 20 + .../wasm/wabt/third_party/testsuite/func.wast | 961 ++ .../wabt/third_party/testsuite/func_ptrs.wast | 106 + .../wabt/third_party/testsuite/global.wast | 599 + .../wasm/wabt/third_party/testsuite/i32.wast | 976 ++ .../wasm/wabt/third_party/testsuite/i64.wast | 485 + .../wasm/wabt/third_party/testsuite/if.wast | 1550 ++ .../wabt/third_party/testsuite/imports.wast | 644 + .../third_party/testsuite/inline-module.wast | 1 + .../wabt/third_party/testsuite/int_exprs.wast | 350 + .../third_party/testsuite/int_literals.wast | 151 + .../wabt/third_party/testsuite/labels.wast | 328 + .../third_party/testsuite/left-to-right.wast | 233 + .../wabt/third_party/testsuite/linking.wast | 388 + .../wasm/wabt/third_party/testsuite/load.wast | 567 + .../wabt/third_party/testsuite/local_get.wast | 226 + .../wabt/third_party/testsuite/local_set.wast | 362 + .../wabt/third_party/testsuite/local_tee.wast | 639 + .../wasm/wabt/third_party/testsuite/loop.wast | 785 ++ .../wabt/third_party/testsuite/memory.wast | 242 + .../third_party/testsuite/memory_grow.wast | 355 + .../testsuite/memory_redundancy.wast | 65 + .../third_party/testsuite/memory_size.wast | 85 + .../third_party/testsuite/memory_trap.wast | 270 + .../wabt/third_party/testsuite/names.wast | 1107 ++ .../wasm/wabt/third_party/testsuite/nop.wast | 426 + .../proposals/annotations/annotations.wast | 195 + .../bulk-memory-operations/binary.wast | 1090 ++ .../bulk-memory-operations/bulk.wast | 351 + .../bulk-memory-operations/custom.wast | 130 + .../bulk-memory-operations/data.wast | 345 + .../bulk-memory-operations/elem.wast | 433 + .../bulk-memory-operations/imports.wast | 593 + .../bulk-memory-operations/linking.wast | 395 + .../bulk-memory-operations/memory_copy.wast | 5577 ++++++++ .../bulk-memory-operations/memory_fill.wast | 685 + .../bulk-memory-operations/memory_init.wast | 967 ++ .../bulk-memory-operations/table_copy.wast | 1595 +++ .../bulk-memory-operations/table_init.wast | 1776 +++ .../exception-handling/binary-leb128.wast | 964 ++ .../proposals/exception-handling/binary.wast | 1545 ++ .../exception-handling/br_table.wast | 1619 +++ .../proposals/exception-handling/bulk.wast | 351 + .../exception-handling/call_indirect.wast | 1017 ++ .../proposals/exception-handling/custom.wast | 130 + .../proposals/exception-handling/data.wast | 345 + .../proposals/exception-handling/elem.wast | 468 + .../proposals/exception-handling/exports.wast | 196 + .../proposals/exception-handling/global.wast | 507 + .../proposals/exception-handling/imports.wast | 605 + .../proposals/exception-handling/linking.wast | 453 + .../exception-handling/memory_copy.wast | 5578 ++++++++ .../exception-handling/memory_fill.wast | 686 + .../exception-handling/memory_grow.wast | 379 + .../exception-handling/memory_init.wast | 967 ++ .../exception-handling/ref_func.wast | 115 + .../exception-handling/ref_is_null.wast | 58 + .../exception-handling/ref_null.wast | 10 + .../proposals/exception-handling/select.wast | 492 + .../exception-handling/table-sub.wast | 21 + .../proposals/exception-handling/table.wast | 54 + .../exception-handling/table_copy.wast | 3082 ++++ .../exception-handling/table_fill.wast | 153 + .../exception-handling/table_get.wast | 88 + .../exception-handling/table_grow.wast | 173 + .../exception-handling/table_init.wast | 2143 +++ .../exception-handling/table_set.wast | 119 + .../exception-handling/table_size.wast | 86 + .../exception-handling/unreached-invalid.wast | 710 + .../function-references/binary-leb128.wast | 964 ++ .../proposals/function-references/binary.wast | 1546 ++ .../function-references/br_on_null.wast | 75 + .../function-references/br_table.wast | 1693 +++ .../proposals/function-references/bulk.wast | 351 + .../function-references/call_indirect.wast | 1017 ++ .../function-references/call_ref.wast | 193 + .../proposals/function-references/custom.wast | 130 + .../proposals/function-references/data.wast | 345 + .../proposals/function-references/elem.wast | 468 + .../function-references/exports.wast | 196 + .../proposals/function-references/func.wast | 948 ++ .../function-references/func_bind.wast | 529 + .../proposals/function-references/global.wast | 507 + .../proposals/function-references/if.wast | 1550 ++ .../function-references/imports.wast | 605 + .../proposals/function-references/let.wast | 302 + .../function-references/linking.wast | 627 + .../function-references/memory_copy.wast | 5578 ++++++++ .../function-references/memory_fill.wast | 686 + .../function-references/memory_grow.wast | 379 + .../function-references/memory_init.wast | 967 ++ .../proposals/function-references/ref.wast | 80 + .../function-references/ref_as_non_null.wast | 46 + .../function-references/ref_func.wast | 115 + .../function-references/ref_is_null.wast | 85 + .../function-references/ref_null.wast | 14 + .../function-references/return_call_ref.wast | 351 + .../proposals/function-references/select.wast | 519 + .../function-references/table-sub.wast | 32 + .../proposals/function-references/table.wast | 70 + .../function-references/table_copy.wast | 3082 ++++ .../function-references/table_fill.wast | 153 + .../function-references/table_get.wast | 88 + .../function-references/table_grow.wast | 173 + .../function-references/table_init.wast | 2143 +++ .../function-references/table_set.wast | 119 + .../function-references/table_size.wast | 86 + .../function-references/type-equivalence.wast | 447 + .../unreached-invalid.wast | 706 + .../testsuite/proposals/memory64/address.wast | 610 + .../proposals/memory64/address64.wast | 582 + .../testsuite/proposals/memory64/align64.wast | 866 ++ .../proposals/memory64/binary-leb128.wast | 1001 ++ .../testsuite/proposals/memory64/binary.wast | 993 ++ .../proposals/memory64/endianness64.wast | 217 + .../proposals/memory64/float_memory64.wast | 157 + .../testsuite/proposals/memory64/load64.wast | 567 + .../testsuite/proposals/memory64/memory.wast | 242 + .../proposals/memory64/memory64.wast | 188 + .../proposals/memory64/memory_grow64.wast | 95 + .../memory64/memory_redundancy64.wast | 65 + .../proposals/memory64/memory_trap64.wast | 269 + .../reference-types/binary-leb128.wast | 964 ++ .../proposals/reference-types/binary.wast | 1545 ++ .../proposals/reference-types/br_table.wast | 1619 +++ .../proposals/reference-types/bulk.wast | 351 + .../reference-types/call_indirect.wast | 1017 ++ .../proposals/reference-types/custom.wast | 130 + .../proposals/reference-types/data.wast | 345 + .../proposals/reference-types/elem.wast | 468 + .../proposals/reference-types/exports.wast | 196 + .../proposals/reference-types/global.wast | 513 + .../proposals/reference-types/imports.wast | 605 + .../proposals/reference-types/linking.wast | 453 + .../reference-types/memory_copy.wast | 5578 ++++++++ .../reference-types/memory_fill.wast | 686 + .../reference-types/memory_grow.wast | 379 + .../reference-types/memory_init.wast | 967 ++ .../proposals/reference-types/ref_func.wast | 115 + .../reference-types/ref_is_null.wast | 58 + .../proposals/reference-types/ref_null.wast | 10 + .../proposals/reference-types/select.wast | 492 + .../proposals/reference-types/table-sub.wast | 21 + .../proposals/reference-types/table.wast | 54 + .../proposals/reference-types/table_copy.wast | 3082 ++++ .../proposals/reference-types/table_fill.wast | 153 + .../proposals/reference-types/table_get.wast | 88 + .../proposals/reference-types/table_grow.wast | 173 + .../proposals/reference-types/table_init.wast | 2143 +++ .../proposals/reference-types/table_set.wast | 119 + .../proposals/reference-types/table_size.wast | 86 + .../reference-types/unreached-invalid.wast | 710 + .../proposals/simd/simd_address.wast | 157 + .../testsuite/proposals/simd/simd_align.wast | 355 + .../proposals/simd/simd_bit_shift.wast | 1104 ++ .../proposals/simd/simd_bitwise.wast | 812 ++ .../proposals/simd/simd_boolean.wast | 1058 ++ .../testsuite/proposals/simd/simd_const.wast | 1664 +++ .../proposals/simd/simd_conversions.wast | 899 ++ .../testsuite/proposals/simd/simd_f32x4.wast | 2407 ++++ .../proposals/simd/simd_f32x4_arith.wast | 5476 ++++++++ .../proposals/simd/simd_f32x4_cmp.wast | 8167 +++++++++++ .../proposals/simd/simd_f32x4_pmin_pmax.wast | 11676 ++++++++++++++++ .../proposals/simd/simd_f32x4_rounding.wast | 424 + .../testsuite/proposals/simd/simd_f64x2.wast | 2459 ++++ .../proposals/simd/simd_f64x2_arith.wast | 5483 ++++++++ .../proposals/simd/simd_f64x2_cmp.wast | 8337 +++++++++++ .../proposals/simd/simd_f64x2_pmin_pmax.wast | 11676 ++++++++++++++++ .../proposals/simd/simd_f64x2_rounding.wast | 424 + .../proposals/simd/simd_i16x8_arith.wast | 634 + .../proposals/simd/simd_i16x8_arith2.wast | 610 + .../proposals/simd/simd_i16x8_cmp.wast | 1901 +++ .../simd_i16x8_extadd_pairwise_i8x16.wast | 68 + .../simd/simd_i16x8_extmul_i8x16.wast | 404 + .../simd/simd_i16x8_q15mulr_sat_s.wast | 110 + .../proposals/simd/simd_i16x8_sat_arith.wast | 742 + .../proposals/simd/simd_i32x4_arith.wast | 634 + .../proposals/simd/simd_i32x4_arith2.wast | 494 + .../proposals/simd/simd_i32x4_cmp.wast | 1920 +++ .../proposals/simd/simd_i32x4_dot_i16x8.wast | 110 + .../simd_i32x4_extadd_pairwise_i16x8.wast | 68 + .../simd/simd_i32x4_extmul_i16x8.wast | 404 + .../simd/simd_i32x4_trunc_sat_f32x4.wast | 239 + .../simd/simd_i32x4_trunc_sat_f64x2.wast | 239 + .../proposals/simd/simd_i64x2_arith.wast | 652 + .../proposals/simd/simd_i64x2_arith2.wast | 78 + .../proposals/simd/simd_i64x2_cmp.wast | 414 + .../simd/simd_i64x2_extmul_i32x4.wast | 404 + .../proposals/simd/simd_i8x16_arith.wast | 426 + .../proposals/simd/simd_i8x16_arith2.wast | 713 + .../proposals/simd/simd_i8x16_cmp.wast | 1847 +++ .../proposals/simd/simd_i8x16_sat_arith.wast | 718 + .../simd/simd_int_to_int_extend.wast | 599 + .../testsuite/proposals/simd/simd_lane.wast | 1265 ++ .../testsuite/proposals/simd/simd_load.wast | 188 + .../proposals/simd/simd_load16_lane.wast | 211 + .../proposals/simd/simd_load32_lane.wast | 143 + .../proposals/simd/simd_load64_lane.wast | 97 + .../proposals/simd/simd_load8_lane.wast | 299 + .../proposals/simd/simd_load_extend.wast | 384 + .../proposals/simd/simd_load_splat.wast | 261 + .../proposals/simd/simd_load_zero.wast | 154 + .../testsuite/proposals/simd/simd_splat.wast | 430 + .../testsuite/proposals/simd/simd_store.wast | 166 + .../proposals/simd/simd_store16_lane.wast | 299 + .../proposals/simd/simd_store32_lane.wast | 199 + .../proposals/simd/simd_store64_lane.wast | 131 + .../proposals/simd/simd_store8_lane.wast | 427 + .../proposals/tail-call/return_call.wast | 202 + .../tail-call/return_call_indirect.wast | 511 + .../testsuite/proposals/threads/atomic.wast | 539 + .../testsuite/proposals/threads/exports.wast | 205 + .../testsuite/proposals/threads/imports.wast | 605 + .../testsuite/proposals/threads/memory.wast | 246 + .../wabt/third_party/testsuite/return.wast | 479 + .../wabt/third_party/testsuite/select.wast | 487 + .../testsuite/skip-stack-guard-page.wast | 2284 +++ .../wabt/third_party/testsuite/stack.wast | 239 + .../wabt/third_party/testsuite/start.wast | 105 + .../wabt/third_party/testsuite/store.wast | 417 + .../wabt/third_party/testsuite/switch.wast | 150 + .../wabt/third_party/testsuite/table.wast | 54 + .../wabt/third_party/testsuite/token.wast | 10 + .../wabt/third_party/testsuite/traps.wast | 91 + .../wasm/wabt/third_party/testsuite/type.wast | 50 + .../third_party/testsuite/unreachable.wast | 304 + .../testsuite/unreached-invalid.wast | 709 + .../wabt/third_party/testsuite/unwind.wast | 267 + .../third_party/testsuite/update-testsuite.sh | 161 + .../testsuite/utf8-custom-section-id.wast | 1792 +++ .../testsuite/utf8-import-field.wast | 2672 ++++ .../testsuite/utf8-import-module.wast | 2672 ++++ .../testsuite/utf8-invalid-encoding.wast | 176 + .../wasm/wabt/third_party/uvwasi/.gitignore | 66 + .../wabt/third_party/uvwasi/CMakeLists.txt | 127 + .../wasm/wabt/third_party/uvwasi/LICENSE | 21 + .../wasm/wabt/third_party/uvwasi/README.md | 2456 ++++ .../wabt/third_party/uvwasi/include/uvwasi.h | 274 + .../third_party/uvwasi/include/wasi_serdes.h | 145 + .../third_party/uvwasi/include/wasi_types.h | 324 + .../wasm/wabt/third_party/uvwasi/src/clocks.c | 195 + .../wasm/wabt/third_party/uvwasi/src/clocks.h | 13 + .../wasm/wabt/third_party/uvwasi/src/debug.h | 15 + .../wabt/third_party/uvwasi/src/fd_table.c | 450 + .../wabt/third_party/uvwasi/src/fd_table.h | 70 + .../third_party/uvwasi/src/path_resolver.c | 488 + .../third_party/uvwasi/src/path_resolver.h | 19 + .../wabt/third_party/uvwasi/src/poll_oneoff.c | 267 + .../wabt/third_party/uvwasi/src/poll_oneoff.h | 60 + .../wabt/third_party/uvwasi/src/uv_mapping.c | 273 + .../wabt/third_party/uvwasi/src/uv_mapping.h | 16 + .../wasm/wabt/third_party/uvwasi/src/uvwasi.c | 2501 ++++ .../third_party/uvwasi/src/uvwasi_alloc.h | 11 + .../wabt/third_party/uvwasi/src/wasi_rights.c | 62 + .../wabt/third_party/uvwasi/src/wasi_rights.h | 104 + .../wabt/third_party/uvwasi/src/wasi_serdes.c | 259 + .../wabt/third_party/wasm-c-api/.gitignore | 2 + .../wabt/third_party/wasm-c-api/Dockerfile | 18 + .../wasm/wabt/third_party/wasm-c-api/LICENSE | 202 + .../wasm/wabt/third_party/wasm-c-api/Makefile | 306 + .../wabt/third_party/wasm-c-api/README.md | 112 + .../third_party/wasm-c-api/example/callback.c | 168 + .../wasm-c-api/example/callback.cc | 145 + .../wasm-c-api/example/callback.wasm | Bin 0 -> 102 bytes .../wasm-c-api/example/callback.wat | 10 + .../third_party/wasm-c-api/example/finalize.c | 109 + .../wasm-c-api/example/finalize.cc | 103 + .../wasm-c-api/example/finalize.wasm | Bin 0 -> 75 bytes .../wasm-c-api/example/finalize.wat | 5 + .../third_party/wasm-c-api/example/global.c | 232 + .../third_party/wasm-c-api/example/global.cc | 196 + .../wasm-c-api/example/global.wasm | Bin 0 -> 576 bytes .../third_party/wasm-c-api/example/global.wat | 27 + .../third_party/wasm-c-api/example/hello.c | 108 + .../third_party/wasm-c-api/example/hello.cc | 91 + .../third_party/wasm-c-api/example/hello.wasm | Bin 0 -> 71 bytes .../third_party/wasm-c-api/example/hello.wat | 4 + .../third_party/wasm-c-api/example/hostref.c | 269 + .../third_party/wasm-c-api/example/hostref.cc | 232 + .../wasm-c-api/example/hostref.wasm | Bin 0 -> 231 bytes .../wasm-c-api/example/hostref.wat | 24 + .../third_party/wasm-c-api/example/memory.c | 222 + .../third_party/wasm-c-api/example/memory.cc | 172 + .../wasm-c-api/example/memory.wasm | Bin 0 -> 146 bytes .../third_party/wasm-c-api/example/memory.wat | 11 + .../third_party/wasm-c-api/example/multi.c | 157 + .../third_party/wasm-c-api/example/multi.cc | 118 + .../third_party/wasm-c-api/example/multi.wasm | Bin 0 -> 81 bytes .../third_party/wasm-c-api/example/multi.wat | 7 + .../third_party/wasm-c-api/example/reflect.c | 169 + .../third_party/wasm-c-api/example/reflect.cc | 138 + .../wasm-c-api/example/reflect.wasm | Bin 0 -> 124 bytes .../wasm-c-api/example/reflect.wat | 6 + .../wasm-c-api/example/serialize.c | 123 + .../wasm-c-api/example/serialize.cc | 103 + .../wasm-c-api/example/serialize.wasm | Bin 0 -> 71 bytes .../wasm-c-api/example/serialize.wat | 4 + .../third_party/wasm-c-api/example/start.c | 105 + .../third_party/wasm-c-api/example/start.cc | 88 + .../third_party/wasm-c-api/example/start.wasm | Bin 0 -> 48 bytes .../third_party/wasm-c-api/example/start.wat | 4 + .../third_party/wasm-c-api/example/table.c | 213 + .../third_party/wasm-c-api/example/table.cc | 192 + .../third_party/wasm-c-api/example/table.wasm | Bin 0 -> 139 bytes .../third_party/wasm-c-api/example/table.wat | 12 + .../third_party/wasm-c-api/example/threads.c | 153 + .../third_party/wasm-c-api/example/threads.cc | 124 + .../wasm-c-api/example/threads.wasm | Bin 0 -> 84 bytes .../wasm-c-api/example/threads.wat | 5 + .../third_party/wasm-c-api/example/trap.c | 155 + .../third_party/wasm-c-api/example/trap.cc | 126 + .../third_party/wasm-c-api/example/trap.wasm | Bin 0 -> 105 bytes .../third_party/wasm-c-api/example/trap.wat | 5 + .../third_party/wasm-c-api/include/wasm.h | 704 + .../third_party/wasm-c-api/include/wasm.hh | 746 + .../0001-BUILD.gn-add-wasm-v8-lowlevel.patch | 28 + .../third_party/wasm-c-api/src/wasm-bin.cc | 570 + .../third_party/wasm-c-api/src/wasm-bin.hh | 25 + .../wabt/third_party/wasm-c-api/src/wasm-c.cc | 1019 ++ .../wasm-c-api/src/wasm-v8-lowlevel.cc | 443 + .../wasm-c-api/src/wasm-v8-lowlevel.hh | 79 + .../third_party/wasm-c-api/src/wasm-v8.cc | 2177 +++ .../deps/escargot/tools/debugger/debugger.py | 5 +- .../escargot/tools/debugger/debugger_core.py | 17 +- .../tools/debugger/tests/do_break_async.cmd | 12 + .../debugger/tests/do_break_async.expected | 31 + .../tests/do_break_async_generator.cmd | 14 + .../tests/do_break_async_generator.expected | 37 + .../debugger/tests/do_break_generator.cmd | 8 + .../tests/do_break_generator.expected | 26 + .../debugger/tests/do_break_promise_then.cmd | 9 + .../tests/do_break_promise_then.expected | 27 + .../tools/debugger/tests/do_step_class2.cmd | 22 + .../debugger/tests/do_step_class2.expected | 53 + lwnode/code/escargotshim/escargot.gyp | 1 + lwnode/code/escargotshim/escargotshim.gyp | 24 +- .../include/lwnode/lwnode-loader.h | 106 + .../code/escargotshim/include/lwnode/lwnode.h | 49 +- lwnode/code/escargotshim/src/api-data.cc | 162 +- .../code/escargotshim/src/api-environment.cc | 78 +- lwnode/code/escargotshim/src/api-template.cc | 325 +- lwnode/code/escargotshim/src/api.cc | 4 +- lwnode/code/escargotshim/src/api/engine.cc | 34 +- lwnode/code/escargotshim/src/api/engine.h | 5 +- lwnode/code/escargotshim/src/api/es-helper.cc | 143 +- lwnode/code/escargotshim/src/api/es-helper.h | 41 +- .../code/escargotshim/src/api/extra-data.cc | 152 +- lwnode/code/escargotshim/src/api/extra-data.h | 186 +- lwnode/code/escargotshim/src/api/isolate.cc | 66 +- lwnode/code/escargotshim/src/api/isolate.h | 19 +- lwnode/code/escargotshim/src/api/object.cc | 6 + .../code/escargotshim/src/api/stack-trace.cc | 2 +- lwnode/code/escargotshim/src/api/utils/gc.cc | 36 +- lwnode/code/escargotshim/src/api/utils/gc.h | 3 +- .../escargotshim/src/api/utils/string-util.cc | 52 + .../escargotshim/src/api/utils/string-util.h | 59 + .../escargotshim/src/execution/v8threads.cc | 87 +- .../escargotshim/src/execution/v8threads.h | 42 + .../src/lwnode/lwnode-gc-strategy.cc | 75 + .../src/lwnode/lwnode-gc-strategy.h | 68 + .../escargotshim/src/lwnode/lwnode-loader.cc | 312 + .../escargotshim/src/{ => lwnode}/lwnode.cc | 100 +- node.gyp | 6 +- packaging/lwnode.spec | 38 +- src/node_native_module_lwnode-inl.h | 242 +- src/node_platform.cc | 16 +- tools/js2c.py | 22 +- 758 files changed, 344086 insertions(+), 3298 deletions(-) create mode 100644 lwnode/code/escargotshim/deps/escargot/docs/Debugger.md create mode 100644 lwnode/code/escargotshim/deps/escargot/src/intl/IntlDisplayNames.cpp create mode 100644 lwnode/code/escargotshim/deps/escargot/src/intl/IntlDisplayNames.h create mode 100644 lwnode/code/escargotshim/deps/escargot/src/intl/IntlListFormat.cpp create mode 100644 lwnode/code/escargotshim/deps/escargot/src/intl/IntlListFormat.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/src/prebuilt/.clang-format create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/.clang-format create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/.gitignore create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/BUILD.bazel create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/CMakeLists.txt create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/CONTRIBUTING.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/LICENSE create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/README.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/WORKSPACE create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/appveyor.yml create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/ci/build-linux-bazel.sh create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/ci/build-platformio.sh create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/ci/env-linux.sh create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/ci/env-osx.sh create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/ci/get-nprocessors.sh create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/ci/install-linux.sh create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/ci/install-osx.sh create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/ci/install-platformio.sh create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/ci/log-config.sh create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/ci/travis.sh create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/CMakeLists.txt create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/CONTRIBUTORS create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/LICENSE create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/README.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/cmake/gmock.pc.in create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/cmake/gmock_main.pc.in create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/docs/cheat_sheet.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/docs/cook_book.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/docs/for_dummies.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/docs/gmock_faq.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/gmock-actions.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/gmock-cardinalities.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/gmock-function-mocker.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/gmock-generated-actions.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/gmock-generated-actions.h.pump create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/gmock-generated-matchers.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/gmock-generated-matchers.h.pump create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/gmock-matchers.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/gmock-more-actions.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/gmock-more-matchers.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/gmock-nice-strict.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/gmock-spec-builders.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/gmock.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/internal/custom/README.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/internal/custom/gmock-port.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/internal/gmock-internal-utils.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/internal/gmock-port.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/include/gmock/internal/gmock-pp.h create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/scripts/fuse_gmock_files.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/scripts/generator/LICENSE create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/scripts/generator/README create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/scripts/generator/README.cppclean create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/scripts/generator/cpp/__init__.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/scripts/generator/cpp/ast.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/scripts/generator/cpp/gmock_class.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/scripts/generator/cpp/gmock_class_test.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/scripts/generator/cpp/keywords.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/scripts/generator/cpp/tokenize.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/scripts/generator/cpp/utils.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/scripts/generator/gmock_gen.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/scripts/gmock-config.in create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/scripts/gmock_doctor.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/scripts/upload.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/scripts/upload_gmock.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/src/gmock-all.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/src/gmock-cardinalities.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/src/gmock-internal-utils.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/src/gmock-matchers.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/src/gmock-spec-builders.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/src/gmock.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googlemock/src/gmock_main.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/CMakeLists.txt create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/CONTRIBUTORS create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/LICENSE create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/README.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/cmake/Config.cmake.in create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/cmake/gtest.pc.in create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/cmake/gtest_main.pc.in create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/cmake/internal_utils.cmake create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/cmake/libgtest.la.in create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/docs/advanced.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/docs/faq.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/docs/pkgconfig.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/docs/primer.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/docs/pump_manual.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/docs/samples.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/gtest-death-test.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/gtest-matchers.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/gtest-message.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/gtest-param-test.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/gtest-printers.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/gtest-spi.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/gtest-test-part.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/gtest-typed-test.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/gtest.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/gtest_pred_impl.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/gtest_prod.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/internal/custom/README.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/internal/custom/gtest-port.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/internal/custom/gtest-printers.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/internal/custom/gtest.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/internal/gtest-filepath.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/internal/gtest-internal.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/internal/gtest-param-util.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/internal/gtest-port-arch.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/internal/gtest-port.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/internal/gtest-string.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/internal/gtest-type-util.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/include/gtest/internal/gtest-type-util.h.pump create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/samples/prime_tables.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/samples/sample1.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/samples/sample1.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/samples/sample10_unittest.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/samples/sample1_unittest.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/samples/sample2.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/samples/sample2.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/samples/sample2_unittest.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/samples/sample3-inl.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/samples/sample3_unittest.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/samples/sample4.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/samples/sample4.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/samples/sample4_unittest.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/samples/sample5_unittest.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/samples/sample6_unittest.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/samples/sample7_unittest.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/samples/sample8_unittest.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/samples/sample9_unittest.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/scripts/common.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/scripts/fuse_gtest_files.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/scripts/gen_gtest_pred_impl.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/scripts/gtest-config.in create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/scripts/pump.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/scripts/release_docs.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/scripts/upload.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/scripts/upload_gtest.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/src/gtest-all.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/src/gtest-death-test.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/src/gtest-filepath.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/src/gtest-internal-inl.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/src/gtest-matchers.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/src/gtest-port.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/src/gtest-printers.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/src/gtest-test-part.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/src/gtest-typed-test.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/src/gtest.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/googletest/src/gtest_main.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/library.json create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/gtest/platformio.ini create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/.gitignore create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/ANNOUNCE create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/CHANGES create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/MANIFEST.in create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/README.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/TODO create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/doc/internal.html create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/doc/makedoc.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/doc/ply.html create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/BASIC/README create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/BASIC/basic.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/BASIC/basiclex.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/BASIC/basiclog.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/BASIC/basinterp.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/BASIC/basparse.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/BASIC/dim.bas create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/BASIC/func.bas create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/BASIC/gcd.bas create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/BASIC/gosub.bas create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/BASIC/hello.bas create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/BASIC/linear.bas create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/BASIC/maxsin.bas create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/BASIC/powers.bas create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/BASIC/rand.bas create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/BASIC/sales.bas create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/BASIC/sears.bas create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/BASIC/sqrt1.bas create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/BASIC/sqrt2.bas create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/GardenSnake/GardenSnake.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/GardenSnake/README create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/README create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/ansic/README create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/ansic/clex.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/ansic/cparse.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/calc/calc.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/calcdebug/calc.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/calceof/calc.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/classcalc/calc.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/cleanup.sh create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/closurecalc/calc.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/hedit/hedit.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/newclasscalc/calc.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/optcalc/README create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/optcalc/calc.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/unicalc/calc.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/yply/README create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/yply/ylex.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/yply/yparse.py create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/example/yply/yply.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/ply/__init__.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/ply/cpp.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/ply/ctokens.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/ply/lex.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/ply/yacc.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/ply/ygen.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/setup.cfg create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/ply/setup.py create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/.gitignore create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/Contributing.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/LICENSE create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/README.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/address.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/align.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/binary-leb128.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/binary.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/block.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/br.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/br_if.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/br_table.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/call.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/call_indirect.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/comments.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/const.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/conversions.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/custom.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/data.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/elem.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/endianness.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/exports.wast create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/extract-parts.sh create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/f32.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/f32_bitwise.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/f32_cmp.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/f64.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/f64_bitwise.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/f64_cmp.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/fac.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/float_exprs.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/float_literals.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/float_memory.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/float_misc.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/forward.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/func.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/func_ptrs.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/global.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/i32.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/i64.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/if.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/imports.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/inline-module.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/int_exprs.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/int_literals.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/labels.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/left-to-right.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/linking.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/load.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/local_get.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/local_set.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/local_tee.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/loop.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/memory.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/memory_grow.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/memory_redundancy.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/memory_size.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/memory_trap.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/names.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/nop.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/annotations/annotations.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/bulk-memory-operations/binary.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/bulk-memory-operations/bulk.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/bulk-memory-operations/custom.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/bulk-memory-operations/data.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/bulk-memory-operations/elem.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/bulk-memory-operations/imports.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/bulk-memory-operations/linking.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/bulk-memory-operations/memory_copy.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/bulk-memory-operations/memory_fill.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/bulk-memory-operations/memory_init.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/bulk-memory-operations/table_copy.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/bulk-memory-operations/table_init.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/binary-leb128.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/binary.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/br_table.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/bulk.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/call_indirect.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/custom.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/data.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/elem.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/exports.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/global.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/imports.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/linking.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/memory_copy.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/memory_fill.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/memory_grow.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/memory_init.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/ref_func.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/ref_is_null.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/ref_null.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/select.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/table-sub.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/table.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/table_copy.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/table_fill.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/table_get.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/table_grow.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/table_init.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/table_set.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/table_size.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/exception-handling/unreached-invalid.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/binary-leb128.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/binary.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/br_on_null.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/br_table.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/bulk.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/call_indirect.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/call_ref.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/custom.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/data.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/elem.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/exports.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/func.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/func_bind.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/global.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/if.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/imports.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/let.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/linking.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/memory_copy.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/memory_fill.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/memory_grow.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/memory_init.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/ref.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/ref_as_non_null.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/ref_func.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/ref_is_null.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/ref_null.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/return_call_ref.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/select.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/table-sub.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/table.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/table_copy.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/table_fill.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/table_get.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/table_grow.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/table_init.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/table_set.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/table_size.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/type-equivalence.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/function-references/unreached-invalid.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/memory64/address.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/memory64/address64.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/memory64/align64.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/memory64/binary-leb128.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/memory64/binary.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/memory64/endianness64.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/memory64/float_memory64.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/memory64/load64.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/memory64/memory.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/memory64/memory64.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/memory64/memory_grow64.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/memory64/memory_redundancy64.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/memory64/memory_trap64.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/binary-leb128.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/binary.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/br_table.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/bulk.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/call_indirect.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/custom.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/data.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/elem.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/exports.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/global.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/imports.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/linking.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/memory_copy.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/memory_fill.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/memory_grow.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/memory_init.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/ref_func.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/ref_is_null.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/ref_null.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/select.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/table-sub.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/table.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/table_copy.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/table_fill.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/table_get.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/table_grow.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/table_init.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/table_set.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/table_size.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/reference-types/unreached-invalid.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_address.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_align.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_bit_shift.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_bitwise.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_boolean.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_const.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_conversions.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_f32x4.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_f32x4_arith.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_f32x4_cmp.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_f32x4_pmin_pmax.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_f32x4_rounding.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_f64x2.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_f64x2_arith.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_f64x2_cmp.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_f64x2_pmin_pmax.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_f64x2_rounding.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i16x8_arith.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i16x8_arith2.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i16x8_cmp.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i16x8_extadd_pairwise_i8x16.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i16x8_extmul_i8x16.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i16x8_q15mulr_sat_s.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i16x8_sat_arith.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i32x4_arith.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i32x4_arith2.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i32x4_cmp.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i32x4_dot_i16x8.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i32x4_extadd_pairwise_i16x8.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i32x4_extmul_i16x8.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i32x4_trunc_sat_f32x4.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i32x4_trunc_sat_f64x2.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i64x2_arith.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i64x2_arith2.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i64x2_cmp.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i64x2_extmul_i32x4.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i8x16_arith.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i8x16_arith2.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i8x16_cmp.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_i8x16_sat_arith.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_int_to_int_extend.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_lane.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_load.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_load16_lane.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_load32_lane.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_load64_lane.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_load8_lane.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_load_extend.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_load_splat.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_load_zero.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_splat.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_store.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_store16_lane.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_store32_lane.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_store64_lane.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/simd/simd_store8_lane.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/tail-call/return_call.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/tail-call/return_call_indirect.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/threads/atomic.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/threads/exports.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/threads/imports.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/proposals/threads/memory.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/return.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/select.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/skip-stack-guard-page.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/stack.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/start.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/store.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/switch.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/table.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/token.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/traps.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/type.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/unreachable.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/unreached-invalid.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/unwind.wast create mode 100755 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/update-testsuite.sh create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/utf8-custom-section-id.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/utf8-import-field.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/utf8-import-module.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/testsuite/utf8-invalid-encoding.wast create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/.gitignore create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/CMakeLists.txt create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/LICENSE create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/README.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/include/uvwasi.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/include/wasi_serdes.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/include/wasi_types.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/src/clocks.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/src/clocks.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/src/debug.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/src/fd_table.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/src/fd_table.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/src/path_resolver.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/src/path_resolver.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/src/poll_oneoff.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/src/poll_oneoff.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/src/uv_mapping.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/src/uv_mapping.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/src/uvwasi.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/src/uvwasi_alloc.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/src/wasi_rights.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/src/wasi_rights.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/uvwasi/src/wasi_serdes.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/.gitignore create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/Dockerfile create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/LICENSE create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/Makefile create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/README.md create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/callback.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/callback.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/callback.wasm create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/callback.wat create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/finalize.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/finalize.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/finalize.wasm create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/finalize.wat create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/global.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/global.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/global.wasm create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/global.wat create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/hello.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/hello.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/hello.wasm create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/hello.wat create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/hostref.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/hostref.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/hostref.wasm create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/hostref.wat create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/memory.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/memory.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/memory.wasm create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/memory.wat create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/multi.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/multi.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/multi.wasm create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/multi.wat create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/reflect.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/reflect.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/reflect.wasm create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/reflect.wat create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/serialize.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/serialize.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/serialize.wasm create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/serialize.wat create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/start.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/start.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/start.wasm create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/start.wat create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/table.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/table.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/table.wasm create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/table.wat create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/threads.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/threads.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/threads.wasm create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/threads.wat create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/trap.c create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/trap.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/trap.wasm create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/example/trap.wat create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/include/wasm.h create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/include/wasm.hh create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/patch/0001-BUILD.gn-add-wasm-v8-lowlevel.patch create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/src/wasm-bin.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/src/wasm-bin.hh create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/src/wasm-c.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/src/wasm-v8-lowlevel.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/src/wasm-v8-lowlevel.hh create mode 100644 lwnode/code/escargotshim/deps/escargot/third_party/wasm/wabt/third_party/wasm-c-api/src/wasm-v8.cc create mode 100644 lwnode/code/escargotshim/deps/escargot/tools/debugger/tests/do_break_async.cmd create mode 100644 lwnode/code/escargotshim/deps/escargot/tools/debugger/tests/do_break_async.expected create mode 100644 lwnode/code/escargotshim/deps/escargot/tools/debugger/tests/do_break_async_generator.cmd create mode 100644 lwnode/code/escargotshim/deps/escargot/tools/debugger/tests/do_break_async_generator.expected create mode 100644 lwnode/code/escargotshim/deps/escargot/tools/debugger/tests/do_break_generator.cmd create mode 100644 lwnode/code/escargotshim/deps/escargot/tools/debugger/tests/do_break_generator.expected create mode 100644 lwnode/code/escargotshim/deps/escargot/tools/debugger/tests/do_break_promise_then.cmd create mode 100644 lwnode/code/escargotshim/deps/escargot/tools/debugger/tests/do_break_promise_then.expected create mode 100644 lwnode/code/escargotshim/deps/escargot/tools/debugger/tests/do_step_class2.cmd create mode 100644 lwnode/code/escargotshim/deps/escargot/tools/debugger/tests/do_step_class2.expected create mode 100644 lwnode/code/escargotshim/include/lwnode/lwnode-loader.h create mode 100644 lwnode/code/escargotshim/src/api/utils/string-util.cc create mode 100644 lwnode/code/escargotshim/src/execution/v8threads.h create mode 100644 lwnode/code/escargotshim/src/lwnode/lwnode-gc-strategy.cc create mode 100644 lwnode/code/escargotshim/src/lwnode/lwnode-gc-strategy.h create mode 100644 lwnode/code/escargotshim/src/lwnode/lwnode-loader.cc rename lwnode/code/escargotshim/src/{ => lwnode}/lwnode.cc (74%) diff --git a/README.md b/README.md index 6331ee0..ea36b20 100644 --- a/README.md +++ b/README.md @@ -21,16 +21,16 @@ git submodule update --init --recursive sudo apt-get install -y build-essential cmake clang libicu-dev ``` -### Compile -1. Generate build config files and build node.js +### How to build and run ``` ./lwnode/build.sh -./lwnode/build-cctest.sh +./out/linux/Release/lwnode ./test/message/hello_world.js ``` -### How to run +### How to run testcases ``` -./node ./test/message/hello_world.js +./lwnode/build-cctest.sh +./cctest ``` ## How to Compile: Tizen @@ -47,5 +47,8 @@ Build Options * --define 'build_profile `none|tv|kiosk|soundbar`': default is `none` * --define 'build_mode `release|debug`': default is `release` +### Installing lwnode executable +Install `lwnode-devel.rpm` to get the `lwnode` executable. + ## Maintainers A list of maintainers can be found in [MAINTAINERS.md](MAINTAINERS.md). diff --git a/common.gypi b/common.gypi index 2ef53fd..a9496c7 100644 --- a/common.gypi +++ b/common.gypi @@ -388,6 +388,15 @@ }], ], 'conditions': [ + [ 'lwnode=="true"', { + 'cflags': [ + '-fdata-sections', # for gc-sections + '-ffunction-sections', # for gc-sections + ], + 'ldflags': [ + '-Wl,--gc-sections', + ], + }], [ 'target_arch=="ia32"', { 'cflags': [ '-m32' ], 'ldflags': [ '-m32' ], diff --git a/configure.py b/configure.py index 20a451d..074fdec 100755 --- a/configure.py +++ b/configure.py @@ -92,12 +92,18 @@ lwnode_optgroup.add_option('--profile', default='common', help='Build profile: common | tv | kiosk') -lwnode_optgroup.add_option('--enable-external-builtin-scripts', +lwnode_optgroup.add_option('--enable-external-builtin-script', action='store_true', - dest='enable_external_builtin_scripts', + dest='enable_external_builtin_script', default=False, help='Store builtin scripts outside of executable') +lwnode_optgroup.add_option('--enable-reload-script', + action='store_true', + dest='enable_reload_script', + default=False, + help='Reload scripts on demand') + lwnode_optgroup.add_option('--static-escargot', action='store_true', dest='static_escargot', @@ -124,10 +130,15 @@ def get_lwnode_gyp_options(): lwnode_jsengine_path = 'lwnode/code/escargotshim' args += ['-Dlwnode_jsengine_path='+ lwnode_jsengine_path] - if options.enable_external_builtin_scripts: - args += ['-Denable_external_builtin_scripts=true'] + if options.enable_external_builtin_script: + args += ['-Denable_external_builtin_script=true'] + else: + args += ['-Denable_external_builtin_script=false'] + + if options.enable_reload_script: + args += ['-Denable_reload_script=true'] else: - args += ['-Denable_external_builtin_scripts=false'] + args += ['-Denable_reload_script=false'] else: args += ['-Dlwnode='+ 'false'] diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index 223c6b2..d47a330 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -1087,7 +1087,19 @@ Module._extensions['.js'] = function(module, filename) { content = cached.source; cached.source = undefined; } else { - content = fs.readFileSync(filename, 'utf8'); + // @lwnode + let reloadableContent; + + if (process.lwnode && process.lwnode.isReloadScriptEnabled()) { + reloadableContent = + process.lwnode.CreateReloadableSourceFromFile(filename); + } + + if (reloadableContent) { + content = reloadableContent; + } else { + content = fs.readFileSync(filename, "utf8"); + } } module._compile(content, filename); }; diff --git a/lib/internal/process/per_thread.js b/lib/internal/process/per_thread.js index c4f1e2c..4fa7167 100644 --- a/lib/internal/process/per_thread.js +++ b/lib/internal/process/per_thread.js @@ -262,6 +262,14 @@ function wrapProcessMethods(binding) { return binding.MemSnapshot.apply(null, args); } }, + isReloadScriptEnabled: () => { + return !!(binding.CreateReloadableSourceFromFile); + }, + CreateReloadableSourceFromFile: (...args) => { + if (binding.CreateReloadableSourceFromFile) { + return binding.CreateReloadableSourceFromFile.apply(null, args); + } + }, }; return { diff --git a/lwnode/build.sh b/lwnode/build.sh index 5b6686d..a248671 100755 --- a/lwnode/build.sh +++ b/lwnode/build.sh @@ -18,7 +18,7 @@ set -e CONFIG="--without-npm --without-bundled-v8 \ --without-inspector --without-node-code-cache --without-node-snapshot \ - --with-intl none --shared-openssl --shared-zlib \ + --with-intl none --shared-zlib \ --dest-os linux --dest-cpu x64 \ --engine escargot --escargot-threading \ --ninja" @@ -26,8 +26,8 @@ CONFIG="--without-npm --without-bundled-v8 \ if [[ $1 =~ ^"-d" ]]; then ! [[ $1 =~ .*"b" ]] && ./configure $CONFIG --debug --debug-node ninja -v -C out/linux/Debug lwnode |& lwnode/tools/colorize.sh - else ./configure $CONFIG ninja -v -C out/linux/Release lwnode |& lwnode/tools/colorize.sh fi + diff --git a/lwnode/code/escargotshim/common.gypi b/lwnode/code/escargotshim/common.gypi index 5f64ff6..f7e074e 100755 --- a/lwnode/code/escargotshim/common.gypi +++ b/lwnode/code/escargotshim/common.gypi @@ -16,6 +16,11 @@ '-Wno-unused-but-set-variable', '-fPIC', '-ggdb', # all builds include debug symbols, which will be stripped before packaging + '-fdata-sections', # for gc-sections + '-ffunction-sections', # for gc-sections + ], + 'ldflags': [ + '-Wl,--gc-sections', ], 'link_settings': { 'libraries': [ '-ldl', '-lrt' ], diff --git a/lwnode/code/escargotshim/deps/escargot/Jenkinsfile b/lwnode/code/escargotshim/deps/escargot/Jenkinsfile index 1256dc4..4f4f1f2 100644 --- a/lwnode/code/escargotshim/deps/escargot/Jenkinsfile +++ b/lwnode/code/escargotshim/deps/escargot/Jenkinsfile @@ -35,10 +35,6 @@ def isPr() { } } - stage('Check tidy') { - sh 'python tools/check_tidy.py' - } - stage('Submodule update') { sh 'git submodule update --init test third_party/GCutil' } diff --git a/lwnode/code/escargotshim/deps/escargot/docs/Debugger.md b/lwnode/code/escargotshim/deps/escargot/docs/Debugger.md new file mode 100644 index 0000000..a22bfef --- /dev/null +++ b/lwnode/code/escargotshim/deps/escargot/docs/Debugger.md @@ -0,0 +1,64 @@ +# Internal operation of the Debugger + +The debugger uses a client server model where the server is the Escargot engine. +The connection between the client and server must be bi-directional and reliable. + +The debugger protocol uses packets, although the connection layer can split +these packets into smaller ones if needed. The maximum packet length is defined by +the connection layer. For example, it is 125 for the websockets layer. When a +message is longer than the maximum packet size, it is split into a sequence of +packets. The type of the last packet has an `_END` prefix. The following +example shows the transmission of strings: + +Characters of a string can be 8 or 16 bit long. When a string is transmitted, +it is split into a sequence of packets, and the type of these packets is either +`ESCARGOT_MESSAGE_STRING_8BIT` or `ESCARGOT_MESSAGE_STRING_16BIT`, except +the last one which type is either `ESCARGOT_MESSAGE_STRING_8BIT_END` +or `ESCARGOT_MESSAGE_STRING_16BIT_END`. If a string fits into a single packet, +only the type ending with `_END` is used. + +## Debugger modes + +The message types which can be transmitted depends on the current mode. These are +the current modes: + +* Free running mode: Escargot executes ECMAScript code. The engine may stop at +a breakpoint and notify the client. The client can also request an execution stop. + +* Parsing mode: when Escargot parses an ECMAScript code, it produces several +messages which follows the parsing process. For example, Escargot notifies the +client when it starts parsing a new nested function, or the breakpoint list is +available for a function. This reduces the memory consumption, since the data +is collected until the parsing ends. The debugger client sets up its internal +data about the structure of the ECMAScript code based on these messages. + +* Breakpoint mode: when Escargot stops at a breakpoint, the client can request +information about the execution status such as backtrace or lexical environment. +The objects and their properties can be enumerated as well. Escargot maintains +a reference to all objects which properties are enumerated until the execution +resumes. Therefore the properties of temporary objects (e.g. the result of a +getter) can be inspected later. These temporary objects may increase the memory +consumption. + +* Source sending mode: the client can send multiple source files to Escargot +in this mode, and the engine executes them. Escargot enters this mode when +the user instructs it or it has no code to execute. + +## Evaluating code + +In breakpoint mode, the client can evaluate ECMAScript code. After the evaluation +is completed, the client receives the string represenation of the result, if the +evaluation is successful, or the string representation of the exception otherwise. +These evaluations can have side effects, e.g. variables or properties can be created, +changed, or deleted. The engine does not maintain a separate environment for +executing code, the side effects remain after the execution resumes. Furthermore +the engine ignores all breakpoints during the evaluation, so infinite loops +will never stop. + +## Breakpoints + +The Escargot debugger emits disabled breakpoint instructions into the byte code +stream. The debugger client receives the offset of these instructions with their +corresponding line info. Using these offsets the client can request the server +to enable or disable breakpoints by changing the opcode to enabled or disabled +state. Escargot always stops when an enabled breakpoint is executed. diff --git a/lwnode/code/escargotshim/deps/escargot/src/Escargot.h b/lwnode/code/escargotshim/deps/escargot/src/Escargot.h index 77974ef..657b182 100755 --- a/lwnode/code/escargotshim/deps/escargot/src/Escargot.h +++ b/lwnode/code/escargotshim/deps/escargot/src/Escargot.h @@ -260,6 +260,10 @@ typedef unsigned char LChar; #include // for Intl #include // for Intl #include // for Intl +#include // for Intl +#include // for Intl +#include // for Intl +#include // for Intl // FIXME replace these vzone decl into include // I declare vzone api because there is no header file in include folder diff --git a/lwnode/code/escargotshim/deps/escargot/src/api/EscargotPublic.cpp b/lwnode/code/escargotshim/deps/escargot/src/api/EscargotPublic.cpp index 7e3c1c2..1bb2310 100644 --- a/lwnode/code/escargotshim/deps/escargot/src/api/EscargotPublic.cpp +++ b/lwnode/code/escargotshim/deps/escargot/src/api/EscargotPublic.cpp @@ -370,19 +370,69 @@ size_t Memory::totalSize() return GC_get_total_bytes(); } -static Memory::OnGCEventListener g_gcEventListener; -static void gcEventListener(GC_EventType evtType, void*) -{ - if (GC_EVENT_RECLAIM_END == evtType && g_gcEventListener) { - g_gcEventListener(); +void Memory::addGCEventListener(GCEventType type, OnGCEventListener l, void* data) +{ + GCEventListenerSet& list = ThreadLocal::gcEventListenerSet(); + GCEventListenerSet::EventListenerVector* listeners = nullptr; + + switch (type) { + case MARK_START: + listeners = list.ensureMarkStartListeners(); + break; + case MARK_END: + listeners = list.ensureMarkEndListeners(); + break; + case RECLAIM_START: + listeners = list.ensureReclaimStartListeners(); + break; + case RECLAIM_END: + listeners = list.ensureReclaimEndListeners(); + break; + default: + ASSERT_NOT_REACHED(); + break; + } + +#ifndef NDEBUG + auto iter = std::find(listeners->begin(), listeners->end(), std::make_pair(l, data)); + ASSERT(iter == listeners->end()); +#endif + + listeners->push_back(std::make_pair(l, data)); +} + +bool Memory::removeGCEventListener(GCEventType type, OnGCEventListener l, void* data) +{ + GCEventListenerSet& list = ThreadLocal::gcEventListenerSet(); + Optional listeners; + + switch (type) { + case MARK_START: + listeners = list.markStartListeners(); + break; + case MARK_END: + listeners = list.markEndListeners(); + break; + case RECLAIM_START: + listeners = list.reclaimStartListeners(); + break; + case RECLAIM_END: + listeners = list.reclaimEndListeners(); + break; + default: + ASSERT_NOT_REACHED(); + break; + } + + if (listeners) { + auto iter = std::find(listeners->begin(), listeners->end(), std::make_pair(l, data)); + if (iter != listeners->end()) { + listeners->erase(iter); + return true; + } } -} -void Memory::setGCEventListener(OnGCEventListener l) -{ - g_gcEventListener = l; - GC_remove_event_callback(gcEventListener, nullptr); - GC_add_event_callback(gcEventListener, nullptr); + return false; } // I store ref count as EncodedValue. this can prevent what bdwgc can see ref count as address (EncodedValue store integer value as odd) @@ -1019,17 +1069,31 @@ void VMInstanceRef::setOnVMInstanceDelete(OnVMInstanceDelete cb) { toImpl(this)->setOnDestroyCallback([](VMInstance* instance, void* data) { if (data) { - ((OnVMInstanceDelete)data)(toRef(instance)); + (reinterpret_cast(data))(toRef(instance)); } }, (void*)cb); } +void VMInstanceRef::registerErrorCreationCallback(ErrorCreationCallback cb) +{ + toImpl(this)->registerErrorCreationCallback([](ExecutionState& state, ErrorObject* err, void* cb) -> void { + ASSERT(!!cb); + (reinterpret_cast(cb))(toRef(&state), toRef(err)); + }, + (void*)cb); +} + +void VMInstanceRef::unregisterErrorCreationCallback() +{ + toImpl(this)->unregisterErrorCreationCallback(); +} + void VMInstanceRef::registerPromiseHook(PromiseHook promiseHook) { toImpl(this)->registerPromiseHook([](ExecutionState& state, VMInstance::PromiseHookType type, PromiseObject* promise, const Value& parent, void* hook) -> void { ASSERT(!!hook); - ((PromiseHook)hook)(toRef(&state), (PromiseHookType)type, toRef(promise), toRef(parent)); + (reinterpret_cast(hook))(toRef(&state), (PromiseHookType)type, toRef(promise), toRef(parent)); }, (void*)promiseHook); } @@ -2047,6 +2111,22 @@ FunctionObjectRef* FunctionObjectRef::createBuiltinFunction(ExecutionStateRef* s return createFunction(state, info, true); } +FunctionObjectRef* FunctionObjectRef::create(ExecutionStateRef* stateRef, AtomicStringRef* functionName, size_t argumentCount, ValueRef** argumentNameArray, ValueRef* body) +{ + ExecutionState& state = *toImpl(stateRef); + Value* newArgv = ALLOCA(sizeof(Value) * argumentCount, Value, state); + for (size_t i = 0; i < argumentCount; i++) { + newArgv[i] = toImpl(argumentNameArray[i]); + } + + auto functionSource = FunctionObject::createFunctionSourceFromScriptSource(state, toImpl(functionName), argumentCount, newArgv, toImpl(body), false, false, false, false); + + Object* proto = state.context()->globalObject()->functionPrototype(); + ScriptFunctionObject* result = new ScriptFunctionObject(state, proto, functionSource.codeBlock, functionSource.outerEnvironment, true, false, false); + + return toRef(result); +} + ValueRef* FunctionObjectRef::getFunctionPrototype(ExecutionStateRef* state) { FunctionObject* o = toImpl(this); @@ -2238,6 +2318,21 @@ GlobalObjectRef* ExecutionStateRef::resolveCallerLexicalGlobalObject() return toRef(ctx->globalObject()); } +bool ExecutionStateRef::onTry() +{ + return toImpl(this)->onTry(); +} + +bool ExecutionStateRef::onCatch() +{ + return toImpl(this)->onCatch(); +} + +bool ExecutionStateRef::onFinally() +{ + return toImpl(this)->onFinally(); +} + void ExecutionStateRef::throwException(ValueRef* value) { ExecutionState* imp = toImpl(this); @@ -2635,14 +2730,39 @@ bool ValueRef::instanceOf(ExecutionStateRef* state, const ValueRef* other) const return toImpl(this).instanceOf(*toImpl(state), toImpl(other)); } -IteratorObjectRef* IteratorObjectRef::create(ExecutionStateRef* state) +ValueRef* IteratorObjectRef::next(ExecutionStateRef* state) { - return toRef(new IteratorObject(*toImpl(state))); + return toRef(toImpl(this)->next(*toImpl(state))); } -ValueRef* IteratorObjectRef::next(ExecutionStateRef* state) +class GenericIteratorObject : public IteratorObject { +public: + GenericIteratorObject(ExecutionState& state, GenericIteratorObjectRef::GenericIteratorObjectRefCallback callback, void* callbackData) + : IteratorObject(state, state.context()->globalObject()->genericIteratorPrototype()) + , m_callback(callback) + , m_callbackData(callbackData) + { + } + + virtual bool isGenericIteratorObject() const override + { + return true; + } + + virtual std::pair advance(ExecutionState& state) override + { + auto ret = m_callback(toRef(&state), m_callbackData); + return std::make_pair(toImpl(ret.first), ret.second); + } + +private: + GenericIteratorObjectRef::GenericIteratorObjectRefCallback m_callback; + void* m_callbackData; +}; + +GenericIteratorObjectRef* GenericIteratorObjectRef::create(ExecutionStateRef* state, GenericIteratorObjectRefCallback callback, void* callbackData) { - return toRef(toImpl(this)->next(*toImpl(state))); + return toRef(new GenericIteratorObject(*toImpl(state), callback, callbackData)); } ArrayObjectRef* ArrayObjectRef::create(ExecutionStateRef* state) @@ -2853,16 +2973,37 @@ RegExpObjectRef::RegExpObjectOption RegExpObjectRef::option() return (RegExpObjectRef::RegExpObjectOption)toImpl(this)->option(); } -BackingStoreRef* BackingStoreRef::create(size_t byteLength) +BackingStoreRef* BackingStoreRef::createDefaultNonSharedBackingStore(size_t byteLength) { - return toRef(new BackingStore(byteLength)); + return toRef(BackingStore::createDefaultNonSharedBackingStore(byteLength)); } -BackingStoreRef* BackingStoreRef::create(void* data, size_t byteLength, BackingStoreRef::BackingStoreRefDeleterCallback callback, void* callbackData) +BackingStoreRef* BackingStoreRef::createNonSharedBackingStore(void* data, size_t byteLength, BackingStoreRef::BackingStoreRefDeleterCallback callback, void* callbackData) { - return toRef(new BackingStore(data, byteLength, (BackingStoreDeleterCallback)callback, callbackData)); + return toRef(BackingStore::createNonSharedBackingStore(data, byteLength, (BackingStoreDeleterCallback)callback, callbackData)); } +#if defined(ENABLE_THREADING) +BackingStoreRef* BackingStoreRef::createDefaultSharedBackingStore(size_t byteLength) +{ + return toRef(BackingStore::createDefaultSharedBackingStore(byteLength)); +} + +BackingStoreRef* BackingStoreRef::createSharedBackingStore(BackingStoreRef* backingStore) +{ + return toRef(BackingStore::createSharedBackingStore(toImpl(backingStore)->sharedDataBlockInfo())); +} +#else +BackingStoreRef* BackingStoreRef::createDefaultSharedBackingStore(size_t byteLength) +{ + RELEASE_ASSERT_NOT_REACHED(); +} +BackingStoreRef* BackingStoreRef::createSharedBackingStore(BackingStoreRef* backingStore) +{ + RELEASE_ASSERT_NOT_REACHED(); +} +#endif + void* BackingStoreRef::data() { return toImpl(this)->data(); @@ -2931,11 +3072,21 @@ SharedArrayBufferObjectRef* SharedArrayBufferObjectRef::create(ExecutionStateRef { return toRef(new SharedArrayBufferObject(*toImpl(state), toImpl(state)->context()->globalObject()->sharedArrayBufferPrototype(), byteLength)); } + +SharedArrayBufferObjectRef* SharedArrayBufferObjectRef::create(ExecutionStateRef* state, BackingStoreRef* backingStore) +{ + return toRef(new SharedArrayBufferObject(*toImpl(state), toImpl(state)->context()->globalObject()->sharedArrayBufferPrototype(), toImpl(backingStore))); +} #else SharedArrayBufferObjectRef* SharedArrayBufferObjectRef::create(ExecutionStateRef* state, size_t byteLength) { RELEASE_ASSERT_NOT_REACHED(); } + +SharedArrayBufferObjectRef* SharedArrayBufferObjectRef::create(ExecutionStateRef* state, BackingStoreRef* backingStore) +{ + RELEASE_ASSERT_NOT_REACHED(); +} #endif ArrayBufferRef* ArrayBufferViewRef::buffer() diff --git a/lwnode/code/escargotshim/deps/escargot/src/api/EscargotPublic.h b/lwnode/code/escargotshim/deps/escargot/src/api/EscargotPublic.h index 2014b38..c0d35a8 100644 --- a/lwnode/code/escargotshim/deps/escargot/src/api/EscargotPublic.h +++ b/lwnode/code/escargotshim/deps/escargot/src/api/EscargotPublic.h @@ -57,6 +57,7 @@ F(ErrorObject) \ F(FinalizationRegistryObject) \ F(FunctionObject) \ + F(GenericIteratorObject) \ F(GlobalObject) \ F(GlobalObjectProxyObject) \ F(IteratorObject) \ @@ -170,8 +171,17 @@ public: static size_t heapSize(); // Return the number of bytes in the heap. Excludes bdwgc private data structures. Excludes the unmapped memory static size_t totalSize(); // Return the total number of bytes allocated in this process - typedef void (*OnGCEventListener)(); - static void setGCEventListener(OnGCEventListener l); + enum GCEventType { + MARK_START, + MARK_END, + RECLAIM_START, + RECLAIM_END, + }; + // pointer `data` is not a GC object + typedef void (*OnGCEventListener)(void* data); + static void addGCEventListener(GCEventType type, OnGCEventListener l, void* data); + static bool removeGCEventListener(GCEventType type, OnGCEventListener l, void* data); + // NOTE bdwgc(c/c++ gc library escargot use) allocate at least N/GC_free_space_divisor bytes between collections // (Allocated memory by GC x 2) / (Frequency parameter value) // Increasing this value may use less space but there is more collection event @@ -603,6 +613,10 @@ public: GCManagedVector resolveCallstack(); // resolve list of callee GlobalObjectRef* resolveCallerLexicalGlobalObject(); // resolve caller's lexical global object + bool onTry(); + bool onCatch(); + bool onFinally(); + void throwException(ValueRef* value); GCManagedVector computeStackTraceData(); @@ -621,6 +635,12 @@ public: typedef void (*OnVMInstanceDelete)(VMInstanceRef* instance); void setOnVMInstanceDelete(OnVMInstanceDelete cb); + // register ErrorCreationCallback which is triggered when each Error constructor (e.g. new TypeError()) invoked + // parameter `err` is newly created ErrorObject + typedef void (*ErrorCreationCallback)(ExecutionStateRef* state, ErrorObjectRef* err); + void registerErrorCreationCallback(ErrorCreationCallback cb); + void unregisterErrorCreationCallback(); + enum PromiseHookType { Init, Resolve, @@ -834,26 +854,26 @@ public: { return createFromASCII(str, N - 1); } - static StringRef* createFromASCII(const char* s, size_t len); + static StringRef* createFromASCII(const char* s, size_t stringLength); template static StringRef* createFromUTF8(const char (&str)[N]) { return createFromUTF8(str, N - 1); } - static StringRef* createFromUTF8(const char* s, size_t len, bool maybeASCII = true); - static StringRef* createFromUTF16(const char16_t* s, size_t len); - static StringRef* createFromLatin1(const unsigned char* s, size_t len); + static StringRef* createFromUTF8(const char* s, size_t byteLength, bool maybeASCII = true); + static StringRef* createFromUTF16(const char16_t* s, size_t stringLength); + static StringRef* createFromLatin1(const unsigned char* s, size_t stringLength); - static StringRef* createExternalFromASCII(const char* s, size_t len); - static StringRef* createExternalFromLatin1(const unsigned char* s, size_t len); - static StringRef* createExternalFromUTF16(const char16_t* s, size_t len); + static StringRef* createExternalFromASCII(const char* s, size_t stringLength); + static StringRef* createExternalFromLatin1(const unsigned char* s, size_t stringLength); + static StringRef* createExternalFromUTF16(const char16_t* s, size_t stringLength); // you can use these functions only if you enabled string compression static bool isCompressibleStringEnabled(); - static StringRef* createFromUTF8ToCompressibleString(VMInstanceRef* instance, const char* s, size_t len, bool maybeASCII = true); - static StringRef* createFromUTF16ToCompressibleString(VMInstanceRef* instance, const char16_t* s, size_t len); - static StringRef* createFromASCIIToCompressibleString(VMInstanceRef* instance, const char* s, size_t len); - static StringRef* createFromLatin1ToCompressibleString(VMInstanceRef* instance, const unsigned char* s, size_t len); + static StringRef* createFromUTF8ToCompressibleString(VMInstanceRef* instance, const char* s, size_t byteLength, bool maybeASCII = true); + static StringRef* createFromUTF16ToCompressibleString(VMInstanceRef* instance, const char16_t* s, size_t stringLength); + static StringRef* createFromASCIIToCompressibleString(VMInstanceRef* instance, const char* s, size_t stringLength); + static StringRef* createFromLatin1ToCompressibleString(VMInstanceRef* instance, const unsigned char* s, size_t stringLength); static void* allocateStringDataBufferForCompressibleString(size_t byteLength); static void deallocateStringDataBufferForCompressibleString(void* ptr, size_t byteLength); static StringRef* createFromAlreadyAllocatedBufferToCompressibleString(VMInstanceRef* instance, void* buffer, size_t stringLen, bool is8Bit /* is ASCII or Latin1 */); @@ -861,7 +881,7 @@ public: // you can use these functions only if you enabled reloadable string static bool isReloadableStringEnabled(); static StringRef* createReloadableString(VMInstanceRef* instance, - bool is8BitString, size_t len, void* callbackData, + bool is8BitString, size_t stringLength, void* callbackData, void* (*loadCallback)(void* callbackData), // you should returns string buffer void (*unloadCallback)(void* memoryPtr, void* callbackData)); // you should free memoryPtr @@ -879,7 +899,7 @@ public: RopeStringRef* asRopeString(); bool equals(StringRef* src); - bool equalsWithASCIIString(const char* buf, size_t len); + bool equalsWithASCIIString(const char* buf, size_t stringLength); StringRef* substring(size_t from, size_t to); @@ -1313,6 +1333,7 @@ public: static FunctionObjectRef* create(ExecutionStateRef* state, NativeFunctionInfo info); static FunctionObjectRef* createBuiltinFunction(ExecutionStateRef* state, NativeFunctionInfo info); // protoype of builtin function is non-writable + static FunctionObjectRef* create(ExecutionStateRef* state, AtomicStringRef* functionName, size_t argumentCount, ValueRef** argumentNameArray, ValueRef* body); // get prototype property of constructible function(not [[prototype]]) // this property is used for new object construction. see https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarycreatefromconstructor @@ -1328,10 +1349,17 @@ public: class ESCARGOT_EXPORT IteratorObjectRef : public ObjectRef { public: - static IteratorObjectRef* create(ExecutionStateRef* state); ValueRef* next(ExecutionStateRef* state); }; +class ESCARGOT_EXPORT GenericIteratorObjectRef : public IteratorObjectRef { +public: + // returns result and done pair + typedef std::pair (*GenericIteratorObjectRefCallback)(ExecutionStateRef* state, void* data); + + static GenericIteratorObjectRef* create(ExecutionStateRef* state, GenericIteratorObjectRefCallback callback, void* callbackData); +}; + class ESCARGOT_EXPORT ArrayObjectRef : public ObjectRef { public: static ArrayObjectRef* create(ExecutionStateRef* state); @@ -1351,7 +1379,8 @@ public: SyntaxError, RangeError, URIError, - EvalError + EvalError, + AggregateError, }; static ErrorObjectRef* create(ExecutionStateRef* state, ErrorObjectRef::Code code, StringRef* errorMessage); }; @@ -1474,14 +1503,24 @@ class ESCARGOT_EXPORT BackingStoreRef { friend class ArrayBufferObject; public: - static BackingStoreRef* create(size_t byteLength); typedef void (*BackingStoreRefDeleterCallback)(void* data, size_t length, void* deleterData); - static BackingStoreRef* create(void* data, size_t byteLength, BackingStoreRefDeleterCallback callback, void* callbackData); + + // create default NonSharedBackingStore allocated by platform allocator + static BackingStoreRef* createDefaultNonSharedBackingStore(size_t byteLength); + // create customized NonSharedBackingStore allocated by other allocator + static BackingStoreRef* createNonSharedBackingStore(void* data, size_t byteLength, BackingStoreRefDeleterCallback callback, void* callbackData); + + // Note) SharedBackingStore is allocated for each worker(thread) and its internal data block is actually shared among workers. + // Also, SharedBackingStore's internal data block is allocated only by platform allocator now. + // create default SharedBackingStore allocated by platform allocator + static BackingStoreRef* createDefaultSharedBackingStore(size_t byteLength); + // create SharedBackingStore by sharing with already created one + static BackingStoreRef* createSharedBackingStore(BackingStoreRef* backingStore); void* data(); size_t byteLength(); - // Indicates whether the backing store is Shared Data Block (for SharedArrayBuffer) + // Indicates whether the backing store is SharedDataBlock(for SharedArrayBuffer) bool isShared(); void reallocate(size_t newByteLength); }; @@ -1505,6 +1544,7 @@ public: class ESCARGOT_EXPORT SharedArrayBufferObjectRef : public ArrayBufferRef { public: static SharedArrayBufferObjectRef* create(ExecutionStateRef* state, size_t bytelength); + static SharedArrayBufferObjectRef* create(ExecutionStateRef* state, BackingStoreRef* backingStore); }; class ESCARGOT_EXPORT ArrayBufferViewRef : public ObjectRef { diff --git a/lwnode/code/escargotshim/deps/escargot/src/builtins/BuiltinAtomics.cpp b/lwnode/code/escargotshim/deps/escargot/src/builtins/BuiltinAtomics.cpp index 4018e7e..9845f1a 100644 --- a/lwnode/code/escargotshim/deps/escargot/src/builtins/BuiltinAtomics.cpp +++ b/lwnode/code/escargotshim/deps/escargot/src/builtins/BuiltinAtomics.cpp @@ -603,7 +603,7 @@ static Value builtinAtomicsIsLockFree(ExecutionState& state, Value thisValue, si return Value(false); #else // spec want to do toInteger operation - size; + UNUSED_VARIABLE(size); return Value(false); #endif } diff --git a/lwnode/code/escargotshim/deps/escargot/src/builtins/BuiltinError.cpp b/lwnode/code/escargotshim/deps/escargot/src/builtins/BuiltinError.cpp index 3558c7c..3745b8e 100644 --- a/lwnode/code/escargotshim/deps/escargot/src/builtins/BuiltinError.cpp +++ b/lwnode/code/escargotshim/deps/escargot/src/builtins/BuiltinError.cpp @@ -20,6 +20,7 @@ #include "Escargot.h" #include "runtime/GlobalObject.h" #include "runtime/Context.h" +#include "runtime/VMInstance.h" #include "runtime/ErrorObject.h" #include "runtime/NativeFunctionObject.h" #include "runtime/ToStringRecursionPreventer.h" @@ -61,6 +62,11 @@ static Value builtinErrorConstructor(ExecutionState& state, Value thisValue, siz Value options = argc > 1 ? argv[1] : Value(); installErrorCause(state, obj, options); + + if (UNLIKELY(state.context()->vmInstance()->isErrorCreationCallbackRegistered())) { + state.context()->vmInstance()->triggerErrorCreationCallback(state, obj); + } + return obj; } @@ -81,6 +87,9 @@ static Value builtinErrorConstructor(ExecutionState& state, Value thisValue, siz } \ Value options = argc > 1 ? argv[1] : Value(); \ installErrorCause(state, obj, options); \ + if (UNLIKELY(state.context()->vmInstance()->isErrorCreationCallbackRegistered())) { \ + state.context()->vmInstance()->triggerErrorCreationCallback(state, obj); \ + } \ return obj; \ } @@ -121,6 +130,11 @@ static Value builtinAggregateErrorConstructor(ExecutionState& state, Value thisV // Perform ! DefinePropertyOrThrow(O, "errors", PropertyDescriptor { [[Configurable]]: true, [[Enumerable]]: false, [[Writable]]: true, [[Value]]: ! CreateArrayFromList(errorsList) }). O->defineOwnPropertyThrowsException(state, ObjectPropertyName(state, String::fromASCII("errors")), ObjectPropertyDescriptor(Value(Object::createArrayFromList(state, errorsList.size(), errorsList.data())), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectStructurePropertyDescriptor::ConfigurablePresent))); + + if (UNLIKELY(state.context()->vmInstance()->isErrorCreationCallbackRegistered())) { + state.context()->vmInstance()->triggerErrorCreationCallback(state, O); + } + // Return O. return O; } diff --git a/lwnode/code/escargotshim/deps/escargot/src/builtins/BuiltinIntl.cpp b/lwnode/code/escargotshim/deps/escargot/src/builtins/BuiltinIntl.cpp index e114ca7..38b7fe9 100644 --- a/lwnode/code/escargotshim/deps/escargot/src/builtins/BuiltinIntl.cpp +++ b/lwnode/code/escargotshim/deps/escargot/src/builtins/BuiltinIntl.cpp @@ -58,6 +58,8 @@ #include "intl/IntlPluralRules.h" #include "intl/IntlLocale.h" #include "intl/IntlRelativeTimeFormat.h" +#include "intl/IntlDisplayNames.h" +#include "intl/IntlListFormat.h" namespace Escargot { @@ -246,10 +248,8 @@ static Value builtinIntlDateTimeFormatFormatToParts(ExecutionState& state, Value return dtf->formatToParts(state, x); } -static void setFormatOpt(ExecutionState& state, Object* internalSlot, Object* result, const char* pName) +static void setFormatOpt(ExecutionState& state, Object* internalSlot, Object* result, String* prop) { - String* prop = String::fromASCII(pName); - ObjectGetResult r; r = internalSlot->get(state, ObjectPropertyName(state, prop)); @@ -391,23 +391,23 @@ static Value builtinIntlNumberFormatResolvedOptions(ExecutionState& state, Value Object* internalSlot = thisValue.asObject()->internalSlot(); Object* result = new Object(state); - setFormatOpt(state, internalSlot, result, "locale"); - setFormatOpt(state, internalSlot, result, "numberingSystem"); - setFormatOpt(state, internalSlot, result, "style"); - setFormatOpt(state, internalSlot, result, "currency"); - setFormatOpt(state, internalSlot, result, "currencyDisplay"); - setFormatOpt(state, internalSlot, result, "currencySign"); - setFormatOpt(state, internalSlot, result, "unit"); - setFormatOpt(state, internalSlot, result, "unitDisplay"); - setFormatOpt(state, internalSlot, result, "minimumIntegerDigits"); - setFormatOpt(state, internalSlot, result, "minimumFractionDigits"); - setFormatOpt(state, internalSlot, result, "maximumFractionDigits"); - setFormatOpt(state, internalSlot, result, "minimumSignificantDigits"); - setFormatOpt(state, internalSlot, result, "maximumSignificantDigits"); - setFormatOpt(state, internalSlot, result, "useGrouping"); - setFormatOpt(state, internalSlot, result, "notation"); - setFormatOpt(state, internalSlot, result, "compactDisplay"); - setFormatOpt(state, internalSlot, result, "signDisplay"); + setFormatOpt(state, internalSlot, result, String::fromASCII("locale")); + setFormatOpt(state, internalSlot, result, String::fromASCII("numberingSystem")); + setFormatOpt(state, internalSlot, result, String::fromASCII("style")); + setFormatOpt(state, internalSlot, result, String::fromASCII("currency")); + setFormatOpt(state, internalSlot, result, String::fromASCII("currencyDisplay")); + setFormatOpt(state, internalSlot, result, String::fromASCII("currencySign")); + setFormatOpt(state, internalSlot, result, String::fromASCII("unit")); + setFormatOpt(state, internalSlot, result, String::fromASCII("unitDisplay")); + setFormatOpt(state, internalSlot, result, String::fromASCII("minimumIntegerDigits")); + setFormatOpt(state, internalSlot, result, String::fromASCII("minimumFractionDigits")); + setFormatOpt(state, internalSlot, result, String::fromASCII("maximumFractionDigits")); + setFormatOpt(state, internalSlot, result, String::fromASCII("minimumSignificantDigits")); + setFormatOpt(state, internalSlot, result, String::fromASCII("maximumSignificantDigits")); + setFormatOpt(state, internalSlot, result, String::fromASCII("useGrouping")); + setFormatOpt(state, internalSlot, result, String::fromASCII("notation")); + setFormatOpt(state, internalSlot, result, String::fromASCII("compactDisplay")); + setFormatOpt(state, internalSlot, result, String::fromASCII("signDisplay")); return result; } @@ -840,6 +840,62 @@ static Value builtinIntlLocaleMinimize(ExecutionState& state, Value thisValue, s return new IntlLocaleObject(state, sb.finalize(), nullptr); } +static Value builtinIntlLocaleCalendarsGetter(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) +{ + if (!thisValue.isObject() || !thisValue.asObject()->isIntlLocaleObject()) { + ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "Method called on incompatible receiver"); + } + return thisValue.asObject()->asIntlLocaleObject()->calendars(state); +} + +static Value builtinIntlLocaleCollationsGetter(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) +{ + if (!thisValue.isObject() || !thisValue.asObject()->isIntlLocaleObject()) { + ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "Method called on incompatible receiver"); + } + return thisValue.asObject()->asIntlLocaleObject()->collations(state); +} + +static Value builtinIntlLocaleHourCyclesGetter(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) +{ + if (!thisValue.isObject() || !thisValue.asObject()->isIntlLocaleObject()) { + ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "Method called on incompatible receiver"); + } + return thisValue.asObject()->asIntlLocaleObject()->hourCycles(state); +} + +static Value builtinIntlLocaleNumberingSystemsGetter(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) +{ + if (!thisValue.isObject() || !thisValue.asObject()->isIntlLocaleObject()) { + ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "Method called on incompatible receiver"); + } + return thisValue.asObject()->asIntlLocaleObject()->numberingSystems(state); +} + +static Value builtinIntlLocaleTextInfoGetter(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) +{ + if (!thisValue.isObject() || !thisValue.asObject()->isIntlLocaleObject()) { + ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "Method called on incompatible receiver"); + } + return thisValue.asObject()->asIntlLocaleObject()->textInfo(state); +} + +static Value builtinIntlLocaleWeekInfoGetter(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) +{ + if (!thisValue.isObject() || !thisValue.asObject()->isIntlLocaleObject()) { + ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "Method called on incompatible receiver"); + } + return thisValue.asObject()->asIntlLocaleObject()->weekInfo(state); +} + +static Value builtinIntlLocaleTimeZonesGetter(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) +{ + if (!thisValue.isObject() || !thisValue.asObject()->isIntlLocaleObject()) { + ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "Method called on incompatible receiver"); + } + return thisValue.asObject()->asIntlLocaleObject()->timeZones(state); +} + static Value builtinIntlRelativeTimeFormatConstructor(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) { // If NewTarget is undefined, throw a TypeError exception. @@ -931,6 +987,117 @@ static Value builtinIntlRelativeTimeFormatFormatToParts(ExecutionState& state, V return thisValue.asObject()->asIntlRelativeTimeFormatObject()->formatToParts(state, value, unit); } +static Value builtinIntlDisplayNamesConstructor(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) +{ + // https://402.ecma-international.org/8.0/#sec-Intl.DisplayNames + // If NewTarget is undefined, throw a TypeError exception. + if (!newTarget) { + ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, ErrorObject::Messages::GlobalObject_ConstructorRequiresNew); + } + + Object* proto = Object::getPrototypeFromConstructor(state, newTarget.value(), [](ExecutionState& state, Context* realm) -> Object* { + return realm->globalObject()->intlDisplayNamesPrototype(); + }); + return new IntlDisplayNamesObject(state, proto, argv[0], argv[1]); +} + +static Value builtinIntlDisplayNamesOf(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) +{ + if (!thisValue.isObject() || !thisValue.asObject()->isIntlDisplayNamesObject()) { + ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "Method called on incompatible receiver"); + } + + IntlDisplayNamesObject* r = thisValue.asObject()->asIntlDisplayNamesObject(); + return r->of(state, argv[0]); +} + +static Value builtinIntlDisplayNamesResolvedOptions(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) +{ + if (!thisValue.isObject() || !thisValue.asObject()->isIntlDisplayNamesObject()) { + ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "Method called on incompatible receiver"); + } + + IntlDisplayNamesObject* r = thisValue.asObject()->asIntlDisplayNamesObject(); + + Object* options = new Object(state); + + auto& staticStrings = state.context()->staticStrings(); + options->defineOwnPropertyThrowsException(state, ObjectPropertyName(staticStrings.lazySmallLetterLocale()), ObjectPropertyDescriptor(r->locale(), ObjectPropertyDescriptor::AllPresent)); + options->defineOwnPropertyThrowsException(state, ObjectPropertyName(staticStrings.lazyStyle()), ObjectPropertyDescriptor(r->style(), ObjectPropertyDescriptor::AllPresent)); + options->defineOwnPropertyThrowsException(state, ObjectPropertyName(staticStrings.lazyType()), ObjectPropertyDescriptor(r->type(), ObjectPropertyDescriptor::AllPresent)); + options->defineOwnPropertyThrowsException(state, ObjectPropertyName(staticStrings.lazyFallback()), ObjectPropertyDescriptor(r->fallback(), ObjectPropertyDescriptor::AllPresent)); + options->defineOwnPropertyThrowsException(state, ObjectPropertyName(staticStrings.lazyLanguageDisplay()), ObjectPropertyDescriptor(r->languageDisplay(), ObjectPropertyDescriptor::AllPresent)); + return options; +} + +static Value builtinIntlListFormatConstructor(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) +{ + // If NewTarget is undefined, throw a TypeError exception. + if (!newTarget) { + ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, ErrorObject::Messages::GlobalObject_ConstructorRequiresNew); + } + + Object* proto = Object::getPrototypeFromConstructor(state, newTarget.value(), [](ExecutionState& state, Context* realm) -> Object* { + return realm->globalObject()->intlListFormatPrototype(); + }); + if (argc >= 2) { + return new IntlListFormatObject(state, proto, argv[0], argv[1]); + } else if (argc >= 1) { + return new IntlListFormatObject(state, proto, argv[0], Value()); + } else { + return new IntlListFormatObject(state, proto, Value(), Value()); + } +} + +static Value builtinIntlListFormatSupportedLocalesOf(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) +{ + Value locales = argv[0]; + Value options; + if (argc >= 2) { + options = argv[1]; + } + const auto& availableLocales = state.context()->vmInstance()->intlListFormatAvailableLocales(); + ValueVector requestedLocales = Intl::canonicalizeLocaleList(state, locales); + return Intl::supportedLocales(state, availableLocales, requestedLocales, options); +} + +static Value builtinIntlListFormatResolvedOptions(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) +{ + if (!thisValue.isObject() || !thisValue.asObject()->isIntlListFormatObject()) { + ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "Method called on incompatible receiver"); + } + + IntlListFormatObject* r = thisValue.asObject()->asIntlListFormatObject(); + + Object* options = new Object(state); + + auto& staticStrings = state.context()->staticStrings(); + options->defineOwnPropertyThrowsException(state, ObjectPropertyName(staticStrings.lazySmallLetterLocale()), ObjectPropertyDescriptor(r->locale(), ObjectPropertyDescriptor::AllPresent)); + options->defineOwnPropertyThrowsException(state, ObjectPropertyName(staticStrings.lazyType()), ObjectPropertyDescriptor(r->type(), ObjectPropertyDescriptor::AllPresent)); + options->defineOwnPropertyThrowsException(state, ObjectPropertyName(staticStrings.lazyStyle()), ObjectPropertyDescriptor(r->style(), ObjectPropertyDescriptor::AllPresent)); + return options; +} + +static Value builtinIntlListFormatFormat(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) +{ + if (!thisValue.isObject() || !thisValue.asObject()->isIntlListFormatObject()) { + ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "Method called on incompatible receiver"); + } + + IntlListFormatObject* r = thisValue.asObject()->asIntlListFormatObject(); + return r->format(state, argv[0]); +} + +static Value builtinIntlListFormatFormatToParts(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) +{ + if (!thisValue.isObject() || !thisValue.asObject()->isIntlListFormatObject()) { + ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "Method called on incompatible receiver"); + } + + IntlListFormatObject* r = thisValue.asObject()->asIntlListFormatObject(); + return r->formatToParts(state, argv[0]); +} + static Value builtinIntlGetCanonicalLocales(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) { // Let ll be ? CanonicalizeLocaleList(locales). @@ -956,7 +1123,7 @@ void GlobalObject::installIntl(ExecutionState& state) m_intl = new Object(state); m_intl->setGlobalIntrinsicObject(state); - const StaticStrings* strings = &state.context()->staticStrings(); + StaticStrings* strings = &state.context()->staticStrings(); redefineOwnProperty(state, ObjectPropertyName(strings->Intl), ObjectPropertyDescriptor(m_intl, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); @@ -1032,7 +1199,7 @@ void GlobalObject::installIntl(ExecutionState& state) ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->resolvedOptions, builtinIntlPluralRulesResolvedOptions, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent | ObjectPropertyDescriptor::WritablePresent))); m_intlPluralRulesPrototype->defineOwnPropertyThrowsException(state, ObjectPropertyName(state.context()->vmInstance()->globalSymbols().toStringTag), - ObjectPropertyDescriptor(Value(state.context()->staticStrings().Object.string()), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent))); + ObjectPropertyDescriptor(Value(state.context()->staticStrings().intlDotPluralRules.string()), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent))); m_intlPluralRules->defineOwnProperty(state, state.context()->staticStrings().supportedLocalesOf, ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->supportedLocalesOf, builtinIntlPluralRulesSupportedLocalesOf, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent | ObjectPropertyDescriptor::WritablePresent))); @@ -1126,6 +1293,55 @@ void GlobalObject::installIntl(ExecutionState& state) m_intlLocalePrototype->defineOwnProperty(state, state.context()->staticStrings().minimize, ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->minimize, builtinIntlLocaleMinimize, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent | ObjectPropertyDescriptor::WritablePresent))); + { + Value getter = new NativeFunctionObject(state, NativeFunctionInfo(strings->getCalendars, builtinIntlLocaleCalendarsGetter, 0, NativeFunctionInfo::Strict)); + JSGetterSetter gs(getter, Value()); + ObjectPropertyDescriptor desc(gs, ObjectPropertyDescriptor::ConfigurablePresent); + m_intlLocalePrototype->defineOwnProperty(state, ObjectPropertyName(state, strings->lazyCalendars()), desc); + } + + { + Value getter = new NativeFunctionObject(state, NativeFunctionInfo(strings->getCollations, builtinIntlLocaleCollationsGetter, 0, NativeFunctionInfo::Strict)); + JSGetterSetter gs(getter, Value()); + ObjectPropertyDescriptor desc(gs, ObjectPropertyDescriptor::ConfigurablePresent); + m_intlLocalePrototype->defineOwnProperty(state, ObjectPropertyName(state, strings->lazyCollations()), desc); + } + + { + Value getter = new NativeFunctionObject(state, NativeFunctionInfo(strings->getHourCycles, builtinIntlLocaleHourCyclesGetter, 0, NativeFunctionInfo::Strict)); + JSGetterSetter gs(getter, Value()); + ObjectPropertyDescriptor desc(gs, ObjectPropertyDescriptor::ConfigurablePresent); + m_intlLocalePrototype->defineOwnProperty(state, ObjectPropertyName(state, strings->lazyHourCycles()), desc); + } + + { + Value getter = new NativeFunctionObject(state, NativeFunctionInfo(strings->getNumberingSystems, builtinIntlLocaleNumberingSystemsGetter, 0, NativeFunctionInfo::Strict)); + JSGetterSetter gs(getter, Value()); + ObjectPropertyDescriptor desc(gs, ObjectPropertyDescriptor::ConfigurablePresent); + m_intlLocalePrototype->defineOwnProperty(state, ObjectPropertyName(state, strings->lazyNumberingSystems()), desc); + } + + { + Value getter = new NativeFunctionObject(state, NativeFunctionInfo(strings->getTextInfo, builtinIntlLocaleTextInfoGetter, 0, NativeFunctionInfo::Strict)); + JSGetterSetter gs(getter, Value()); + ObjectPropertyDescriptor desc(gs, ObjectPropertyDescriptor::ConfigurablePresent); + m_intlLocalePrototype->defineOwnProperty(state, ObjectPropertyName(state, strings->lazyTextInfo()), desc); + } + + { + Value getter = new NativeFunctionObject(state, NativeFunctionInfo(strings->getWeekInfo, builtinIntlLocaleWeekInfoGetter, 0, NativeFunctionInfo::Strict)); + JSGetterSetter gs(getter, Value()); + ObjectPropertyDescriptor desc(gs, ObjectPropertyDescriptor::ConfigurablePresent); + m_intlLocalePrototype->defineOwnProperty(state, ObjectPropertyName(state, strings->lazyWeekInfo()), desc); + } + + { + Value getter = new NativeFunctionObject(state, NativeFunctionInfo(strings->getTimeZones, builtinIntlLocaleTimeZonesGetter, 0, NativeFunctionInfo::Strict)); + JSGetterSetter gs(getter, Value()); + ObjectPropertyDescriptor desc(gs, ObjectPropertyDescriptor::ConfigurablePresent); + m_intlLocalePrototype->defineOwnProperty(state, ObjectPropertyName(state, strings->lazyTimeZones()), desc); + } + m_intlRelativeTimeFormat = new NativeFunctionObject(state, NativeFunctionInfo(strings->RelativeTimeFormat, builtinIntlRelativeTimeFormatConstructor, 0), NativeFunctionObject::__ForBuiltinConstructor__); m_intlRelativeTimeFormat->setGlobalIntrinsicObject(state); @@ -1147,6 +1363,45 @@ void GlobalObject::installIntl(ExecutionState& state) m_intlRelativeTimeFormat->defineOwnProperty(state, state.context()->staticStrings().supportedLocalesOf, ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->supportedLocalesOf, builtinIntlRelativeTimeFormatSupportedLocalesOf, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent | ObjectPropertyDescriptor::WritablePresent))); + m_intlDisplayNames = new NativeFunctionObject(state, NativeFunctionInfo(strings->DisplayNames, builtinIntlDisplayNamesConstructor, 2), NativeFunctionObject::__ForBuiltinConstructor__); + m_intlDisplayNames->setGlobalIntrinsicObject(state); + + m_intlDisplayNamesPrototype = m_intlDisplayNames->getFunctionPrototype(state).asObject(); + m_intlDisplayNamesPrototype->setGlobalIntrinsicObject(state, true); + + m_intlDisplayNamesPrototype->defineOwnPropertyThrowsException(state, ObjectPropertyName(state.context()->vmInstance()->globalSymbols().toStringTag), + ObjectPropertyDescriptor(Value(strings->intlDotDisplayNames.string()), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent))); + + m_intlDisplayNamesPrototype->defineOwnProperty(state, state.context()->staticStrings().of, + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->of, builtinIntlDisplayNamesOf, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent | ObjectPropertyDescriptor::WritablePresent))); + + m_intlDisplayNamesPrototype->defineOwnProperty(state, state.context()->staticStrings().resolvedOptions, + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->resolvedOptions, builtinIntlDisplayNamesResolvedOptions, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent | ObjectPropertyDescriptor::WritablePresent))); + + m_intlListFormat = new NativeFunctionObject(state, NativeFunctionInfo(strings->ListFormat, builtinIntlListFormatConstructor, 0), NativeFunctionObject::__ForBuiltinConstructor__); + m_intlListFormat->setGlobalIntrinsicObject(state); + + m_intlListFormat->defineOwnProperty(state, state.context()->staticStrings().supportedLocalesOf, + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->supportedLocalesOf, builtinIntlListFormatSupportedLocalesOf, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent | ObjectPropertyDescriptor::WritablePresent))); + + m_intlListFormatPrototype = m_intlListFormat->getFunctionPrototype(state).asObject(); + m_intlListFormatPrototype->setGlobalIntrinsicObject(state, true); + + m_intlListFormatPrototype->defineOwnProperty(state, state.context()->staticStrings().resolvedOptions, + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->resolvedOptions, builtinIntlListFormatResolvedOptions, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent | ObjectPropertyDescriptor::WritablePresent))); + + m_intlListFormatPrototype->defineOwnProperty(state, state.context()->staticStrings().format, + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->format, builtinIntlListFormatFormat, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent | ObjectPropertyDescriptor::WritablePresent))); + + m_intlListFormatPrototype->defineOwnProperty(state, state.context()->staticStrings().formatToParts, + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->formatToParts, builtinIntlListFormatFormatToParts, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent | ObjectPropertyDescriptor::WritablePresent))); + + m_intlListFormatPrototype->defineOwnPropertyThrowsException(state, ObjectPropertyName(state.context()->vmInstance()->globalSymbols().toStringTag), + ObjectPropertyDescriptor(Value(strings->intlDotListFormat.string()), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent))); + + m_intl->defineOwnPropertyThrowsException(state, ObjectPropertyName(state.context()->vmInstance()->globalSymbols().toStringTag), + ObjectPropertyDescriptor(Value(state.context()->staticStrings().Intl.string()), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent))); + m_intl->defineOwnProperty(state, ObjectPropertyName(strings->Collator), ObjectPropertyDescriptor(m_intlCollator, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); @@ -1165,6 +1420,12 @@ void GlobalObject::installIntl(ExecutionState& state) m_intl->defineOwnProperty(state, ObjectPropertyName(strings->RelativeTimeFormat), ObjectPropertyDescriptor(m_intlRelativeTimeFormat, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_intl->defineOwnProperty(state, ObjectPropertyName(strings->DisplayNames), + ObjectPropertyDescriptor(m_intlDisplayNames, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + + m_intl->defineOwnProperty(state, ObjectPropertyName(strings->ListFormat), + ObjectPropertyDescriptor(m_intlListFormat, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + FunctionObject* getCanonicalLocales = new NativeFunctionObject(state, NativeFunctionInfo(strings->getCanonicalLocales, builtinIntlGetCanonicalLocales, 1, NativeFunctionInfo::Strict)); m_intl->defineOwnProperty(state, ObjectPropertyName(strings->getCanonicalLocales), ObjectPropertyDescriptor(getCanonicalLocales, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); diff --git a/lwnode/code/escargotshim/deps/escargot/src/debugger/Debugger.cpp b/lwnode/code/escargotshim/deps/escargot/src/debugger/Debugger.cpp index acdbff5..07daaf2 100644 --- a/lwnode/code/escargotshim/deps/escargot/src/debugger/Debugger.cpp +++ b/lwnode/code/escargotshim/deps/escargot/src/debugger/Debugger.cpp @@ -290,9 +290,20 @@ void Debugger::getBacktrace(ExecutionState* state, uint32_t minDepth, uint32_t m { SandBox::StackTraceDataVector stackTraceData; - SandBox::createStackTraceData(stackTraceData, *state); + bool hasSavedStackTrace = SandBox::createStackTraceData(stackTraceData, *state, true); - uint32_t total = (uint32_t)stackTraceData.size(); + uint32_t size = (uint32_t)stackTraceData.size(); + uint32_t total = 0; + + for (uint32_t i = 0; i < size; i++) { + if ((size_t)stackTraceData[i].second.loc.actualCodeBlock != SIZE_MAX) { + total++; + } + } + + if (hasSavedStackTrace) { + total += (uint32_t)m_activeSavedStackTrace->size(); + } if (getTotal && !send(ESCARGOT_MESSAGE_BACKTRACE_TOTAL, &total, sizeof(uint32_t))) { return; @@ -307,33 +318,63 @@ void Debugger::getBacktrace(ExecutionState* state, uint32_t minDepth, uint32_t m } ByteCodeLOCDataMap locMap; - for (uint32_t i = minDepth; i < maxDepth; i++) { - if ((size_t)stackTraceData[i].second.loc.index == SIZE_MAX && (size_t)stackTraceData[i].second.loc.actualCodeBlock != SIZE_MAX) { + uint32_t counter = 0; + + for (uint32_t i = 0; i < size && counter < maxDepth; i++) { + if ((size_t)stackTraceData[i].second.loc.actualCodeBlock != SIZE_MAX) { + if (++counter <= minDepth) { + continue; + } + ByteCodeBlock* byteCodeBlock = stackTraceData[i].second.loc.actualCodeBlock; - size_t byteCodePosition = stackTraceData[i].second.loc.byteCodePosition; + uint32_t line, column; + + if ((size_t)stackTraceData[i].second.loc.index == SIZE_MAX) { + size_t byteCodePosition = stackTraceData[i].second.loc.byteCodePosition; + + ByteCodeLOCData* locData; + auto iterMap = locMap.find(byteCodeBlock); + if (iterMap == locMap.end()) { + locData = new ByteCodeLOCData(); + locMap.insert(std::make_pair(byteCodeBlock, locData)); + } else { + locData = iterMap->second; + } - ByteCodeLOCData* locData; - auto iterMap = locMap.find(byteCodeBlock); - if (iterMap == locMap.end()) { - locData = new ByteCodeLOCData(); - locMap.insert(std::make_pair(byteCodeBlock, locData)); + ExtendedNodeLOC loc = byteCodeBlock->computeNodeLOCFromByteCode(state->context(), byteCodePosition, byteCodeBlock->m_codeBlock, locData); + line = (uint32_t)loc.line; + column = (uint32_t)loc.column; } else { - locData = iterMap->second; + line = (uint32_t)stackTraceData[i].second.loc.line; + column = (uint32_t)stackTraceData[i].second.loc.column; } - ExtendedNodeLOC loc = byteCodeBlock->computeNodeLOCFromByteCode(state->context(), byteCodePosition, byteCodeBlock->m_codeBlock, locData); - - sendBacktraceInfo(ESCARGOT_MESSAGE_BACKTRACE, byteCodeBlock, (uint32_t)loc.line, (uint32_t)loc.column, (uint32_t)stackTraceData[i].second.executionStateDepth); + sendBacktraceInfo(ESCARGOT_MESSAGE_BACKTRACE, byteCodeBlock, line, column, (uint32_t)stackTraceData[i].second.executionStateDepth); if (!enabled()) { return; } } } + for (auto iter = locMap.begin(); iter != locMap.end(); iter++) { delete iter->second; } + if (hasSavedStackTrace) { + SavedStackTraceData* savedStackTracePtr = m_activeSavedStackTrace->begin(); + SavedStackTraceData* savedStackTraceEnd = m_activeSavedStackTrace->end(); + + while (counter < maxDepth && savedStackTracePtr < savedStackTraceEnd) { + if (++counter <= minDepth) { + continue; + } + + sendBacktraceInfo(ESCARGOT_MESSAGE_BACKTRACE, savedStackTracePtr->byteCodeBlock, savedStackTracePtr->line, savedStackTracePtr->column, UINT32_MAX); + savedStackTracePtr++; + } + } + sendType(ESCARGOT_MESSAGE_BACKTRACE_END); } @@ -826,6 +867,67 @@ void Debugger::waitForResolvingPendingBreakpoints() } } +Debugger::SavedStackTraceDataVector* Debugger::saveStackTrace(ExecutionState& state) +{ + SavedStackTraceDataVector* savedStackTrace = new SavedStackTraceDataVector(); + SandBox::StackTraceDataVector stackTraceData; + ByteCodeLOCDataMap locMap; + uint32_t counter = 0; + + bool hasSavedStackTrace = SandBox::createStackTraceData(stackTraceData, state, true); + uint32_t total = (uint32_t)stackTraceData.size(); + + for (uint32_t i = 0; i < total && counter < ESCARGOT_DEBUGGER_MAX_STACK_TRACE_LENGTH; i++) { + if ((size_t)stackTraceData[i].second.loc.actualCodeBlock != SIZE_MAX) { + ByteCodeBlock* byteCodeBlock = stackTraceData[i].second.loc.actualCodeBlock; + uint32_t line, column; + + counter++; + + if ((size_t)stackTraceData[i].second.loc.index == SIZE_MAX) { + size_t byteCodePosition = stackTraceData[i].second.loc.byteCodePosition; + + ByteCodeLOCData* locData; + auto iterMap = locMap.find(byteCodeBlock); + if (iterMap == locMap.end()) { + locData = new ByteCodeLOCData(); + locMap.insert(std::make_pair(byteCodeBlock, locData)); + } else { + locData = iterMap->second; + } + + ExtendedNodeLOC loc = byteCodeBlock->computeNodeLOCFromByteCode(state.context(), byteCodePosition, byteCodeBlock->m_codeBlock, locData); + + line = (uint32_t)loc.line; + column = (uint32_t)loc.column; + } else { + line = (uint32_t)stackTraceData[i].second.loc.line; + column = (uint32_t)stackTraceData[i].second.loc.column; + } + + savedStackTrace->push_back(SavedStackTraceData(byteCodeBlock, line, column)); + } + } + + for (auto iter = locMap.begin(); iter != locMap.end(); iter++) { + delete iter->second; + } + + if (hasSavedStackTrace) { + Debugger* debugger = state.context()->debugger(); + SavedStackTraceData* savedStackTracePtr = debugger->activeSavedStackTrace()->begin(); + SavedStackTraceData* savedStackTraceEnd = debugger->activeSavedStackTrace()->end(); + + while (counter < ESCARGOT_DEBUGGER_MAX_STACK_TRACE_LENGTH && savedStackTracePtr < savedStackTraceEnd) { + savedStackTrace->push_back(SavedStackTraceData(savedStackTracePtr->byteCodeBlock, savedStackTracePtr->line, savedStackTracePtr->column)); + savedStackTracePtr++; + counter++; + } + } + + return savedStackTrace; +} + Debugger* createDebugger(const char* options, bool* debuggerEnabled) { Debugger* debugger = new DebuggerTcp(); diff --git a/lwnode/code/escargotshim/deps/escargot/src/debugger/Debugger.h b/lwnode/code/escargotshim/deps/escargot/src/debugger/Debugger.h index 7618ff6..be824cb 100644 --- a/lwnode/code/escargotshim/deps/escargot/src/debugger/Debugger.h +++ b/lwnode/code/escargotshim/deps/escargot/src/debugger/Debugger.h @@ -25,13 +25,16 @@ #ifdef ESCARGOT_DEBUGGER namespace Escargot { +#define ESCARGOT_DEBUGGER_MAX_STACK_TRACE_LENGTH 8 + /* WebSocket max length encoded in one byte. */ #define ESCARGOT_DEBUGGER_MAX_MESSAGE_LENGTH 125 #define ESCARGOT_DEBUGGER_VERSION 1 #define ESCARGOT_DEBUGGER_MESSAGE_PROCESS_DELAY 10 #define ESCARGOT_DEBUGGER_IN_WAIT_MODE (nullptr) -#define ESCARGOT_DEBUGGER_IN_EVAL_MODE ((ExecutionState*)0x1) -#define ESCARGOT_DEBUGGER_ALWAYS_STOP ((ExecutionState*)0x2) +#define ESCARGOT_DEBUGGER_IN_EVAL_MODE (reinterpret_cast(0x1)) +#define ESCARGOT_DEBUGGER_ALWAYS_STOP (reinterpret_cast(0x2)) +#define ESCARGOT_DEBUGGER_NO_STACK_TRACE_RESTORE (reinterpret_cast(0x1)) #define ESCARGOT_DEBUGGER_MAX_VARIABLE_LENGTH 128 class Object; @@ -168,11 +171,36 @@ public: uint32_t offset; }; + struct SavedStackTraceData : public gc { + ByteCodeBlock* byteCodeBlock; + uint32_t line; + uint32_t column; + + SavedStackTraceData(ByteCodeBlock* byteCodeBlock, uint32_t line, uint32_t column) + : byteCodeBlock(byteCodeBlock) + , line(line) + , column(column) + { + } + }; + + typedef Vector> SavedStackTraceDataVector; + bool enabled() { return m_enabled; } + bool parsingEnabled() + { + return m_parsingEnabled; + } + + void setParsingEnabled(bool value) + { + m_parsingEnabled = value; + } + bool pendingWait(void) { return m_pendingWait; @@ -192,6 +220,22 @@ public: } } + void setActiveSavedStackTrace(ExecutionState* state, SavedStackTraceDataVector* trace) + { + m_activeSavedStackTraceExecutionState = state; + m_activeSavedStackTrace = trace; + } + + ExecutionState* activeSavedStackTraceExecutionState() + { + return m_activeSavedStackTraceExecutionState; + } + + SavedStackTraceDataVector* activeSavedStackTrace() + { + return m_activeSavedStackTrace; + } + static inline void updateStopState(Debugger* debugger, ExecutionState* state, ExecutionState* newState) { if (debugger != nullptr && debugger->m_stopState == state) { @@ -212,10 +256,12 @@ public: void releaseFunction(const void* ptr); String* getClientSource(String** sourceName); void waitForResolvingPendingBreakpoints(); + static SavedStackTraceDataVector* saveStackTrace(ExecutionState& state); protected: Debugger() : m_enabled(false) + , m_parsingEnabled(false) , m_debuggerEnabled(nullptr) , m_delay(ESCARGOT_DEBUGGER_MESSAGE_PROCESS_DELAY) , m_pendingWait(false) @@ -223,6 +269,8 @@ protected: , m_stopState(ESCARGOT_DEBUGGER_ALWAYS_STOP) , m_clientSourceData(nullptr) , m_clientSourceName(nullptr) + , m_activeSavedStackTraceExecutionState(nullptr) + , m_activeSavedStackTrace(nullptr) { } @@ -232,6 +280,7 @@ protected: virtual void close(void) = 0; bool m_enabled; + bool m_parsingEnabled; bool* m_debuggerEnabled; private: @@ -285,6 +334,8 @@ private: String* m_clientSourceName; Vector> m_releasedFunctions; Vector> m_activeObjects; + ExecutionState* m_activeSavedStackTraceExecutionState; + SavedStackTraceDataVector* m_activeSavedStackTrace; }; Debugger* createDebugger(const char* options, bool* debuggerEnabled); diff --git a/lwnode/code/escargotshim/deps/escargot/src/debugger/DebuggerTcp.cpp b/lwnode/code/escargotshim/deps/escargot/src/debugger/DebuggerTcp.cpp index 1a498b4..39de349 100644 --- a/lwnode/code/escargotshim/deps/escargot/src/debugger/DebuggerTcp.cpp +++ b/lwnode/code/escargotshim/deps/escargot/src/debugger/DebuggerTcp.cpp @@ -372,6 +372,7 @@ bool DebuggerTcp::init(const char*) } m_enabled = true; + m_parsingEnabled = true; m_receiveBufferFill = 0; m_messageLength = 0; return true; diff --git a/lwnode/code/escargotshim/deps/escargot/src/interpreter/ByteCodeGenerator.cpp b/lwnode/code/escargotshim/deps/escargot/src/interpreter/ByteCodeGenerator.cpp index 27ee6be..f82d1b6 100644 --- a/lwnode/code/escargotshim/deps/escargot/src/interpreter/ByteCodeGenerator.cpp +++ b/lwnode/code/escargotshim/deps/escargot/src/interpreter/ByteCodeGenerator.cpp @@ -101,7 +101,12 @@ size_t ByteCodeGenerateContext::calculateBreakpointLineOffset(size_t index, Exte size_t lastLineOffset = m_breakpointContext->m_lastBreakpointLineOffset; index -= sourceElementStart.index; - ASSERT(index >= m_breakpointContext->m_lastBreakpointIndexOffset); + // if cache is invalid, we should recalulate {index, lineOffset} from begin + if (UNLIKELY(index < m_breakpointContext->m_lastBreakpointIndexOffset)) { + m_breakpointContext->m_lastBreakpointLineOffset = m_breakpointContext->m_lastBreakpointIndexOffset = 0; + lastLineOffset = 0; + } + for (size_t i = m_breakpointContext->m_lastBreakpointIndexOffset; i < index; i++) { char16_t c = src.charAt(i); if (EscargotLexer::isLineTerminator(c)) { @@ -135,8 +140,10 @@ void ByteCodeGenerateContext::insertBreakpoint(size_t index, Node* node) void ByteCodeGenerateContext::insertBreakpointAt(size_t line, Node* node) { - m_breakpointContext->m_breakpointLocations.push_back(Debugger::BreakpointLocation(line, (uint32_t)m_byteCodeBlock->currentCodeSize())); - m_byteCodeBlock->pushCode(BreakpointDisabled(ByteCodeLOC(node->loc().index)), this, node); + if (m_breakpointContext->m_parsingEnabled) { + m_breakpointContext->m_breakpointLocations.push_back(Debugger::BreakpointLocation(line, (uint32_t)m_byteCodeBlock->currentCodeSize())); + m_byteCodeBlock->pushCode(BreakpointDisabled(ByteCodeLOC(node->loc().index)), this, node); + } } #endif /* ESCARGOT_DEBUGGER */ @@ -183,38 +190,18 @@ ByteCodeBlock* ByteCodeGenerator::generateByteCode(Context* context, Interpreted ByteCodeGenerateContext ctx(codeBlock, block, codeBlock->isGlobalScope(), codeBlock->isEvalCode(), inWithFromRuntime || codeBlock->inWith(), nData); #ifdef ESCARGOT_DEBUGGER - ByteCodeBreakpointContext breakpointContext; + ByteCodeBreakpointContext breakpointContext(context->debugger() && context->debugger()->parsingEnabled()); ctx.m_breakpointContext = &breakpointContext; #endif /* ESCARGOT_DEBUGGER */ - // generate common codes - { - AtomicString name = codeBlock->functionName(); - if (name.string()->length()) { - if (UNLIKELY(codeBlock->isFunctionNameExplicitlyDeclared())) { - if (codeBlock->canUseIndexedVariableStorage()) { - if (!codeBlock->isFunctionNameSaveOnHeap()) { - auto r = ctx.getRegister(); - block->pushCode(LoadLiteral(ByteCodeLOC(0), r, Value()), &ctx, nullptr); - block->pushCode(Move(ByteCodeLOC(0), r, REGULAR_REGISTER_LIMIT + 1), &ctx, nullptr); - ctx.giveUpRegister(); - } - } - } else if (UNLIKELY(codeBlock->isFunctionNameSaveOnHeap() && !name.string()->equals("arguments"))) { - ctx.m_isVarDeclaredBindingInitialization = true; - IdentifierNode* id = new (alloca(sizeof(IdentifierNode))) IdentifierNode(codeBlock->functionName()); - id->generateStoreByteCode(block, &ctx, REGULAR_REGISTER_LIMIT + 1, true); - } - } - - ast->generateStatementByteCode(block, &ctx); + // generate bytecode + ast->generateStatementByteCode(block, &ctx); #ifdef ESCARGOT_DEBUGGER - if (context->debugger() && context->debugger()->enabled()) { - context->debugger()->sendBreakpointLocations(breakpointContext.m_breakpointLocations); - } -#endif /* ESCARGOT_DEBUGGER */ + if (context->debugger() && context->debugger()->enabled() && breakpointContext.m_parsingEnabled) { + context->debugger()->sendBreakpointLocations(breakpointContext.m_breakpointLocations); } +#endif /* ESCARGOT_DEBUGGER */ if (ctx.m_keepNumberalLiteralsInRegisterFile) { block->m_numeralLiteralData.resizeWithUninitializedValues(nData->size()); @@ -279,7 +266,7 @@ void ByteCodeGenerator::collectByteCodeLOCData(Context* context, InterpretedCode ctx.m_locData = locData; #ifdef ESCARGOT_DEBUGGER - ByteCodeBreakpointContext breakpointContext; + ByteCodeBreakpointContext breakpointContext(context->debugger() && context->debugger()->parsingEnabled()); ctx.m_breakpointContext = &breakpointContext; #endif /* ESCARGOT_DEBUGGER */ diff --git a/lwnode/code/escargotshim/deps/escargot/src/interpreter/ByteCodeGenerator.h b/lwnode/code/escargotshim/deps/escargot/src/interpreter/ByteCodeGenerator.h index bfbea0a..ab3a412 100644 --- a/lwnode/code/escargotshim/deps/escargot/src/interpreter/ByteCodeGenerator.h +++ b/lwnode/code/escargotshim/deps/escargot/src/interpreter/ByteCodeGenerator.h @@ -54,12 +54,14 @@ struct ClassContextInformation { #ifdef ESCARGOT_DEBUGGER struct ByteCodeBreakpointContext { + bool m_parsingEnabled; size_t m_lastBreakpointLineOffset; size_t m_lastBreakpointIndexOffset; std::vector m_breakpointLocations; - ByteCodeBreakpointContext() - : m_lastBreakpointLineOffset(0) + ByteCodeBreakpointContext(bool parsingEnabled) + : m_parsingEnabled(parsingEnabled) + , m_lastBreakpointLineOffset(0) , m_lastBreakpointIndexOffset(0) { } diff --git a/lwnode/code/escargotshim/deps/escargot/src/interpreter/ByteCodeInterpreter.cpp b/lwnode/code/escargotshim/deps/escargot/src/interpreter/ByteCodeInterpreter.cpp index 38feaa9..8677775 100644 --- a/lwnode/code/escargotshim/deps/escargot/src/interpreter/ByteCodeInterpreter.cpp +++ b/lwnode/code/escargotshim/deps/escargot/src/interpreter/ByteCodeInterpreter.cpp @@ -83,6 +83,25 @@ private: size_t* m_oldAddress; }; +template +class ExecutionStateVariableChanger { +public: + ExecutionStateVariableChanger(ExecutionState& state, T changer) + : m_state(state) + , m_changer(changer) + { + m_changer(m_state, true); + } + ~ExecutionStateVariableChanger() + { + m_changer(m_state, false); + } + +private: + ExecutionState& m_state; + T m_changer; +}; + Value ByteCodeInterpreter::interpret(ExecutionState* state, ByteCodeBlock* byteCodeBlock, size_t programCounter, Value* registerFile) { #if defined(COMPILER_GCC) || defined(COMPILER_CLANG) @@ -2585,6 +2604,10 @@ NEVER_INLINE Value ByteCodeInterpreter::tryOperation(ExecutionState*& state, siz if (LIKELY(!code->m_isCatchResumeProcess && !code->m_isFinallyResumeProcess)) { try { + ExecutionStateVariableChanger changer(*state, [](ExecutionState& state, bool in) { + state.m_onTry = in; + }); + size_t newPc = programCounter + sizeof(TryOperation); interpret(newState, byteCodeBlock, resolveProgramCounter(codeBuffer, newPc), registerFile); if (newState->inExecutionStopState()) { @@ -2633,6 +2656,9 @@ NEVER_INLINE Value ByteCodeInterpreter::tryOperation(ExecutionState*& state, siz stackTraceData.clear(); registerFile[code->m_catchedValueRegisterIndex] = val; try { + ExecutionStateVariableChanger changer(*state, [](ExecutionState& state, bool in) { + state.m_onCatch = in; + }); interpret(newState, byteCodeBlock, code->m_catchPosition, registerFile); if (newState->inExecutionStopState()) { return Value(); @@ -2645,6 +2671,9 @@ NEVER_INLINE Value ByteCodeInterpreter::tryOperation(ExecutionState*& state, siz } } else if (code->m_isCatchResumeProcess) { try { + ExecutionStateVariableChanger changer(*state, [](ExecutionState& state, bool in) { + state.m_onCatch = in; + }); interpret(newState, byteCodeBlock, resolveProgramCounter(codeBuffer, programCounter + sizeof(TryOperation)), registerFile); if (UNLIKELY(newState->inExecutionStopState() || newState->parent()->inExecutionStopState())) { return Value(); @@ -2659,6 +2688,9 @@ NEVER_INLINE Value ByteCodeInterpreter::tryOperation(ExecutionState*& state, siz } if (code->m_isFinallyResumeProcess) { + ExecutionStateVariableChanger changer(*state, [](ExecutionState& state, bool in) { + state.m_onFinally = in; + }); interpret(newState, byteCodeBlock, resolveProgramCounter(codeBuffer, programCounter + sizeof(TryOperation)), registerFile); if (newState->inExecutionStopState() || newState->parent()->inExecutionStopState()) { return Value(); @@ -2675,7 +2707,9 @@ NEVER_INLINE Value ByteCodeInterpreter::tryOperation(ExecutionState*& state, siz newState = new ExecutionState(state, state->lexicalEnvironment(), state->inStrictMode()); newState->ensureRareData()->m_controlFlowRecord = state->rareData()->m_controlFlowRecord; } - + ExecutionStateVariableChanger changer(*state, [](ExecutionState& state, bool in) { + state.m_onFinally = in; + }); interpret(newState, byteCodeBlock, code->m_tryCatchEndPosition, registerFile); if (newState->inExecutionStopState()) { return Value(); @@ -2787,7 +2821,7 @@ NEVER_INLINE void ByteCodeInterpreter::initializeClassOperation(ExecutionState& } else { if (!heritagePresent) { Value argv[] = { String::emptyString, String::emptyString }; - auto functionSource = FunctionObject::createFunctionSourceFromScriptSource(state, state.context()->staticStrings().constructor, 1, &argv[0], argv[1], true, false, false, false); + auto functionSource = FunctionObject::createFunctionSourceFromScriptSource(state, state.context()->staticStrings().constructor, 1, &argv[0], argv[1], true, false, false, false, false); functionSource.codeBlock->setAsClassConstructor(); constructor = new ScriptClassConstructorFunctionObject(state, constructorParent.asObject(), functionSource.codeBlock, functionSource.outerEnvironment, proto, @@ -2795,7 +2829,7 @@ NEVER_INLINE void ByteCodeInterpreter::initializeClassOperation(ExecutionState& } else { Value argv[] = { state.context()->staticStrings().lazyDotDotDotArgs().string(), state.context()->staticStrings().lazySuperDotDotDotArgs().string() }; - auto functionSource = FunctionObject::createFunctionSourceFromScriptSource(state, state.context()->staticStrings().constructor, 1, &argv[0], argv[1], true, false, false, true); + auto functionSource = FunctionObject::createFunctionSourceFromScriptSource(state, state.context()->staticStrings().constructor, 1, &argv[0], argv[1], true, false, false, true, false); functionSource.codeBlock->setAsClassConstructor(); functionSource.codeBlock->setAsDerivedClassConstructor(); constructor = new ScriptClassConstructorFunctionObject(state, constructorParent.asObject(), diff --git a/lwnode/code/escargotshim/deps/escargot/src/intl/Intl.cpp b/lwnode/code/escargotshim/deps/escargot/src/intl/Intl.cpp index fda957f..f48f1eb 100644 --- a/lwnode/code/escargotshim/deps/escargot/src/intl/Intl.cpp +++ b/lwnode/code/escargotshim/deps/escargot/src/intl/Intl.cpp @@ -1317,6 +1317,32 @@ String* Intl::icuLocaleToBCP47Tag(String* string) return sb.finalize(); } +std::string Intl::convertICUCalendarKeywordToBCP47KeywordIfNeeds(const std::string& icuCalendar) +{ + if (icuCalendar == std::string("gregorian")) { + return "gregory"; + } else if (icuCalendar == std::string("islamic-civil")) { + return "islamicc"; + } else if (icuCalendar == std::string("ethiopic-amete-alem")) { + return "ethioaa"; + } + return icuCalendar; +} + +std::string Intl::convertICUCollationKeywordToBCP47KeywordIfNeeds(const std::string& icuCollation) +{ + if (icuCollation == std::string("dictionary")) { + return "dict"; + } else if (icuCollation == std::string("gb2312han")) { + return "gb2312"; + } else if (icuCollation == std::string("phonebook")) { + return "phonebk"; + } else if (icuCollation == std::string("traditional")) { + return "trad"; + } + return icuCollation; +} + static String* defaultLocale(ExecutionState& state) { String* localeString = String::fromUTF8(state.context()->vmInstance()->locale().data(), state.context()->vmInstance()->locale().length()); @@ -1988,13 +2014,19 @@ static bool is38Alphanum(const std::string& str) return false; } -static bool is38AlphanumList(const std::string& str) +static bool is38AlphanumList(const std::string& str, bool allowUnderScore = false) { std::size_t found = str.find("-"); if (found == std::string::npos) { + if (allowUnderScore) { + found = str.find("_"); + if (found != std::string::npos) { + return is38Alphanum(str.substr(0, found)) && is38AlphanumList(str.substr(found + 1), allowUnderScore); + } + } return is38Alphanum(str); } - return is38Alphanum(str.substr(0, found)) && is38AlphanumList(str.substr(found + 1)); + return is38Alphanum(str.substr(0, found)) && is38AlphanumList(str.substr(found + 1), allowUnderScore); } bool Intl::isValidUnicodeLocaleIdentifierTypeNonterminalOrTypeSequence(String* value) @@ -2002,6 +2034,11 @@ bool Intl::isValidUnicodeLocaleIdentifierTypeNonterminalOrTypeSequence(String* v return is38AlphanumList(value->toNonGCUTF8StringData()); } +bool Intl::isValidUnicodeLocaleIdentifier(String* value) +{ + return is38AlphanumList(value->toNonGCUTF8StringData(), true); +} + void Intl::convertICUNumberFieldToEcmaNumberField(std::vector& fields, double x, const UTF16StringDataNonGCStd& resultString) { // we need to divide integer field diff --git a/lwnode/code/escargotshim/deps/escargot/src/intl/Intl.h b/lwnode/code/escargotshim/deps/escargot/src/intl/Intl.h index 020d2e1..5841bb3 100644 --- a/lwnode/code/escargotshim/deps/escargot/src/intl/Intl.h +++ b/lwnode/code/escargotshim/deps/escargot/src/intl/Intl.h @@ -51,6 +51,8 @@ public: static T getNumberOption(ExecutionState& state, Object* options, String* property, double minimum, double maximum, const T& fallback); static std::string preferredLanguage(const std::string& language); static String* icuLocaleToBCP47Tag(String* string); + static std::string convertICUCalendarKeywordToBCP47KeywordIfNeeds(const std::string& icuCalendar); + static std::string convertICUCollationKeywordToBCP47KeywordIfNeeds(const std::string& icuCollation); static std::vector calendarsForLocale(String* locale); static std::vector numberingSystemsForLocale(String* locale); struct CanonicalizedLangunageTag { @@ -72,6 +74,7 @@ public: static CanonicalizedLangunageTag isStructurallyValidLanguageTagAndCanonicalizeLanguageTag(const std::string& locale); static String* getLocaleForStringLocaleConvertCase(ExecutionState& state, Value locales); + static bool isValidUnicodeLocaleIdentifier(String* value); // test string is `(3*8alphanum) *("-" (3*8alphanum))` sequence static bool isValidUnicodeLocaleIdentifierTypeNonterminalOrTypeSequence(String* value); @@ -82,6 +85,42 @@ public: }; static void convertICUNumberFieldToEcmaNumberField(std::vector& fields, double x, const UTF16StringDataNonGCStd& resultString); static String* icuNumberFieldToString(ExecutionState& state, int32_t fieldName, double d); + +#define INTL_ICU_STRING_BUFFER_OPERATION(icuFnName, ...) \ + ([&]() -> std::pair { \ + UTF16StringDataNonGCStd output; \ + UErrorCode status = U_ZERO_ERROR; \ + const size_t defaultStringBufferSize = 32; \ + output.resize(defaultStringBufferSize); \ + status = U_ZERO_ERROR; \ + auto resultLength = icuFnName(__VA_ARGS__, (UChar*)output.data(), defaultStringBufferSize, &status); \ + if (U_SUCCESS(status)) { \ + output.resize(resultLength); \ + } else if (status == U_BUFFER_OVERFLOW_ERROR) { \ + status = U_ZERO_ERROR; \ + output.resize(resultLength); \ + icuFnName(__VA_ARGS__, (UChar*)output.data(), resultLength, &status); \ + } \ + return std::make_pair(status, output); \ + })() + +#define INTL_ICU_STRING_BUFFER_OPERATION_COMPLEX(icuFnName, extra, ...) \ + ([&]() -> std::pair { \ + UTF16StringDataNonGCStd output; \ + UErrorCode status = U_ZERO_ERROR; \ + const size_t defaultStringBufferSize = 32; \ + output.resize(defaultStringBufferSize); \ + status = U_ZERO_ERROR; \ + auto resultLength = icuFnName(__VA_ARGS__, (UChar*)output.data(), defaultStringBufferSize, extra, &status); \ + if (U_SUCCESS(status)) { \ + output.resize(resultLength); \ + } else if (status == U_BUFFER_OVERFLOW_ERROR) { \ + status = U_ZERO_ERROR; \ + output.resize(resultLength); \ + icuFnName(__VA_ARGS__, (UChar*)output.data(), resultLength, extra, &status); \ + } \ + return std::make_pair(status, output); \ + })() }; } // namespace Escargot diff --git a/lwnode/code/escargotshim/deps/escargot/src/intl/IntlCollator.cpp b/lwnode/code/escargotshim/deps/escargot/src/intl/IntlCollator.cpp index 2cf2a9a..3e31750 100644 --- a/lwnode/code/escargotshim/deps/escargot/src/intl/IntlCollator.cpp +++ b/lwnode/code/escargotshim/deps/escargot/src/intl/IntlCollator.cpp @@ -80,16 +80,7 @@ static std::vector sortLocaleData(String* locale, size_t keyIndex) continue; // Map keyword values to BCP 47 equivalents. - if (!strcmp(collation, "dictionary")) - collation = "dict"; - else if (!strcmp(collation, "gb2312han")) - collation = "gb2312"; - else if (!strcmp(collation, "phonebook")) - collation = "phonebk"; - else if (!strcmp(collation, "traditional")) - collation = "trad"; - - keyLocaleData.push_back(std::string(collation)); + keyLocaleData.push_back(Intl::convertICUCollationKeywordToBCP47KeywordIfNeeds(collation)); } uenum_close(enumeration); } diff --git a/lwnode/code/escargotshim/deps/escargot/src/intl/IntlDateTimeFormat.cpp b/lwnode/code/escargotshim/deps/escargot/src/intl/IntlDateTimeFormat.cpp index 0551119..0c6af5d 100644 --- a/lwnode/code/escargotshim/deps/escargot/src/intl/IntlDateTimeFormat.cpp +++ b/lwnode/code/escargotshim/deps/escargot/src/intl/IntlDateTimeFormat.cpp @@ -61,7 +61,6 @@ static const size_t indexOfExtensionKeyCa = 0; static const size_t indexOfExtensionKeyNu = 1; static const size_t indexOfExtensionKeyHc = 2; static const double minECMAScriptTime = -8.64E15; -static const size_t defaultStringBufferSize = 32; std::vector Intl::calendarsForLocale(String* locale) { @@ -76,16 +75,7 @@ std::vector Intl::calendarsForLocale(String* locale) ASSERT(U_SUCCESS(status)); status = U_ZERO_ERROR; std::string calendar = std::string(availableName, nameLength); - // Ensure aliases used in language tag are allowed. - if (calendar == std::string("gregorian")) { - keyLocaleData.push_back(std::string("gregory")); - } else if (calendar == std::string("islamic-civil")) { - keyLocaleData.push_back(std::string("islamicc")); - } else if (calendar == std::string("ethiopic-amete-alem")) { - keyLocaleData.push_back(std::string("ethioaa")); - } else { - keyLocaleData.push_back(calendar); - } + keyLocaleData.push_back(Intl::convertICUCalendarKeywordToBCP47KeywordIfNeeds(calendar)); } uenum_close(calendars); @@ -197,7 +187,7 @@ static String* defaultTimeZone(ExecutionState& state) return String::fromUTF8(state.context()->vmInstance()->timezoneID().data(), state.context()->vmInstance()->timezoneID().length()); } -static std::string readHourCycleFromPattern(const UTF16StringDataNonGCStd& patternString) +std::string IntlDateTimeFormatObject::readHourCycleFromPattern(const UTF16StringDataNonGCStd& patternString) { bool inQuote = false; for (size_t i = 0; i < patternString.length(); i++) { @@ -671,16 +661,9 @@ IntlDateTimeFormatObject::IntlDateTimeFormatObject(ExecutionState& state, Object return; } - patternBuffer.resize(defaultStringBufferSize); - status = U_ZERO_ERROR; - auto patternLength = udat_toPattern(dateFormatFromStyle.get(), false, (UChar*)patternBuffer.data(), patternBuffer.size(), &status); - patternBuffer.resize(patternLength); - if (status == U_BUFFER_OVERFLOW_ERROR) { - status = U_ZERO_ERROR; - patternBuffer.resize(patternLength); - udat_toPattern(dateFormatFromStyle.get(), false, (UChar*)patternBuffer.data(), patternBuffer.size(), &status); - } - if (U_FAILURE(status)) { + auto toPatternResult = INTL_ICU_STRING_BUFFER_OPERATION(udat_toPattern, dateFormatFromStyle.get(), false); + patternBuffer = std::move(toPatternResult.second); + if (U_FAILURE(toPatternResult.first)) { ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "failed to initialize DateTimeFormat"); return; } @@ -706,21 +689,13 @@ IntlDateTimeFormatObject::IntlDateTimeFormatObject(ExecutionState& state, Object } std::string extractedHourCycle = readHourCycleFromPattern(patternBuffer); if (extractedHourCycle.size() && (extractedHourCycle == "h11" || extractedHourCycle == "h12") != specifiedHour12) { - UTF16StringDataNonGCStd skeleton; - skeleton.resize(defaultStringBufferSize); - status = U_ZERO_ERROR; - auto resultLength = udatpg_getSkeleton(nullptr, (UChar*)patternBuffer.data(), patternBuffer.size(), (UChar*)skeleton.data(), skeleton.size(), &status); - skeleton.resize(resultLength); - if (status == U_BUFFER_OVERFLOW_ERROR) { - status = U_ZERO_ERROR; - skeleton.resize(resultLength); - udatpg_getSkeleton(nullptr, (UChar*)patternBuffer.data(), patternBuffer.size(), (UChar*)skeleton.data(), skeleton.size(), &status); - } - if (U_FAILURE(status)) { + auto getSkeletonResult = INTL_ICU_STRING_BUFFER_OPERATION(udatpg_getSkeleton, nullptr, (UChar*)patternBuffer.data(), patternBuffer.size()); + if (U_FAILURE(getSkeletonResult.first)) { ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "failed to initialize DateTimeFormat"); return; } + UTF16StringDataNonGCStd skeleton = std::move(getSkeletonResult.second); for (size_t i = 0; i < skeleton.size(); i++) { auto ch = skeleton[i]; if (ch == 'h' || ch == 'H' || ch == 'j') { @@ -732,19 +707,12 @@ IntlDateTimeFormatObject::IntlDateTimeFormatObject(ExecutionState& state, Object } } - patternBuffer.resize(defaultStringBufferSize); - status = U_ZERO_ERROR; - auto patternLength = udatpg_getBestPatternWithOptions(generator.get(), (UChar*)skeleton.data(), skeleton.length(), UDATPG_MATCH_HOUR_FIELD_LENGTH, (UChar*)patternBuffer.data(), patternBuffer.size(), &status); - patternBuffer.resize(patternLength); - if (status == U_BUFFER_OVERFLOW_ERROR) { - status = U_ZERO_ERROR; - patternBuffer.resize(patternLength); - udatpg_getBestPatternWithOptions(generator.get(), (UChar*)skeleton.data(), skeleton.length(), UDATPG_MATCH_HOUR_FIELD_LENGTH, (UChar*)patternBuffer.data(), patternBuffer.size(), &status); - } - if (U_FAILURE(status)) { + auto getBestPatternWithOptionsResult = INTL_ICU_STRING_BUFFER_OPERATION(udatpg_getBestPatternWithOptions, generator.get(), (UChar*)skeleton.data(), skeleton.length(), UDATPG_MATCH_HOUR_FIELD_LENGTH); + if (U_FAILURE(getBestPatternWithOptionsResult.first)) { ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "failed to initialize DateTimeFormat"); return; } + patternBuffer = std::move(getBestPatternWithOptionsResult.second); } } @@ -756,19 +724,12 @@ IntlDateTimeFormatObject::IntlDateTimeFormatObject(ExecutionState& state, Object // Else, // Let bestFormat be BestFitFormatMatcher(opt, formats). skeleton = skeletonBuilder.finalize()->toUTF16StringData(); - patternBuffer.resize(defaultStringBufferSize); - status = U_ZERO_ERROR; - auto patternLength = udatpg_getBestPatternWithOptions(generator.get(), (UChar*)skeleton.data(), skeleton.length(), UDATPG_MATCH_HOUR_FIELD_LENGTH, (UChar*)patternBuffer.data(), patternBuffer.size(), &status); - patternBuffer.resize(patternLength); - if (status == U_BUFFER_OVERFLOW_ERROR) { - status = U_ZERO_ERROR; - patternBuffer.resize(patternLength); - udatpg_getBestPatternWithOptions(generator.get(), (UChar*)skeleton.data(), skeleton.length(), UDATPG_MATCH_HOUR_FIELD_LENGTH, (UChar*)patternBuffer.data(), patternBuffer.size(), &status); - } - if (U_FAILURE(status)) { + auto getBestPatternWithOptionsResult = INTL_ICU_STRING_BUFFER_OPERATION(udatpg_getBestPatternWithOptions, generator.get(), (UChar*)skeleton.data(), skeleton.length(), UDATPG_MATCH_HOUR_FIELD_LENGTH); + if (U_FAILURE(getBestPatternWithOptionsResult.first)) { ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "failed to initialize DateTimeFormat"); return; } + patternBuffer = std::move(getBestPatternWithOptionsResult.second); } // If dateTimeFormat.[[Hour]] is not undefined, then @@ -776,16 +737,9 @@ IntlDateTimeFormatObject::IntlDateTimeFormatObject(ExecutionState& state, Object if (hasHourOption) { // Let hcDefault be dataLocaleData.[[hourCycle]]. UTF16StringDataNonGCStd patternBuffer; - patternBuffer.resize(defaultStringBufferSize); - status = U_ZERO_ERROR; - auto patternLength = udatpg_getBestPattern(generator.get(), u"jjmm", 4, (UChar*)patternBuffer.data(), patternBuffer.length(), &status); - patternBuffer.resize(patternLength); - if (status == U_BUFFER_OVERFLOW_ERROR) { - status = U_ZERO_ERROR; - patternBuffer.resize(patternLength); - udatpg_getBestPattern(generator.get(), u"jjmm", 4, (UChar*)patternBuffer.data(), patternLength, &status); - } - ASSERT(U_SUCCESS(status)); + auto getBestPatternResult = INTL_ICU_STRING_BUFFER_OPERATION(udatpg_getBestPattern, generator.get(), u"jjmm", 4); + ASSERT(U_SUCCESS(getBestPatternResult.first)); + patternBuffer = std::move(getBestPatternResult.second); auto hcDefault = readHourCycleFromPattern(patternBuffer); // Let hc be dateTimeFormat.[[HourCycle]]. auto hc = m_hourCycle; @@ -1007,24 +961,13 @@ UTF16StringDataNonGCStd IntlDateTimeFormatObject::format(ExecutionState& state, x = Value(x).toInteger(state); - UDateFormat* udat = (UDateFormat*)m_icuDateFormat; - // Delegate remaining steps to ICU. - UErrorCode status = U_ZERO_ERROR; - UTF16StringDataNonGCStd result; - result.resize(defaultStringBufferSize); - auto resultLength = udat_format(udat, x, (UChar*)result.data(), result.size(), nullptr, &status); - result.resize(resultLength); - - if (status == U_BUFFER_OVERFLOW_ERROR) { - status = U_ZERO_ERROR; - udat_format(udat, x, (UChar*)result.data(), resultLength, nullptr, &status); - } - if (U_FAILURE(status)) { + auto formatResult = INTL_ICU_STRING_BUFFER_OPERATION_COMPLEX(udat_format, nullptr, m_icuDateFormat, x); + if (U_FAILURE(formatResult.first)) { ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "failed to format date value"); } - return result; + return formatResult.second; } ArrayObject* IntlDateTimeFormatObject::formatToParts(ExecutionState& state, double x) @@ -1040,23 +983,14 @@ ArrayObject* IntlDateTimeFormatObject::formatToParts(ExecutionState& state, doub ArrayObject* result = new ArrayObject(state); - UDateFormat* udat = (UDateFormat*)m_icuDateFormat; - UErrorCode status = U_ZERO_ERROR; UFieldPositionIterator* fpositer; fpositer = ufieldpositer_open(&status); ASSERT(U_SUCCESS(status)); - UTF16StringDataNonGCStd resultString; - resultString.resize(defaultStringBufferSize); - auto resultLength = udat_formatForFields(udat, x, (UChar*)resultString.data(), resultString.size(), fpositer, &status); - resultString.resize(resultLength); - - if (status == U_BUFFER_OVERFLOW_ERROR) { - status = U_ZERO_ERROR; - udat_formatForFields(udat, x, (UChar*)resultString.data(), resultLength, fpositer, &status); - } + auto formatResult = INTL_ICU_STRING_BUFFER_OPERATION_COMPLEX(udat_formatForFields, fpositer, m_icuDateFormat, x); + UTF16StringDataNonGCStd resultString = std::move(formatResult.second); struct FieldItem { int32_t start; diff --git a/lwnode/code/escargotshim/deps/escargot/src/intl/IntlDateTimeFormat.h b/lwnode/code/escargotshim/deps/escargot/src/intl/IntlDateTimeFormat.h index 940a2f4..bee40fa 100644 --- a/lwnode/code/escargotshim/deps/escargot/src/intl/IntlDateTimeFormat.h +++ b/lwnode/code/escargotshim/deps/escargot/src/intl/IntlDateTimeFormat.h @@ -39,7 +39,7 @@ public: UTF16StringDataNonGCStd format(ExecutionState& state, double x); ArrayObject* formatToParts(ExecutionState& state, double x); static Value toDateTimeOptions(ExecutionState& state, Value options, Value required, Value defaults); - + static std::string readHourCycleFromPattern(const UTF16StringDataNonGCStd& patternString); String* locale() const { return m_locale; diff --git a/lwnode/code/escargotshim/deps/escargot/src/intl/IntlDisplayNames.cpp b/lwnode/code/escargotshim/deps/escargot/src/intl/IntlDisplayNames.cpp new file mode 100644 index 0000000..0b1b322 --- /dev/null +++ b/lwnode/code/escargotshim/deps/escargot/src/intl/IntlDisplayNames.cpp @@ -0,0 +1,369 @@ +#if defined(ENABLE_ICU) && defined(ENABLE_INTL) +/* + * Copyright (c) 2021-present Samsung Electronics Co., Ltd + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#include "Escargot.h" +#include "runtime/Context.h" +#include "runtime/ExecutionState.h" +#include "runtime/Value.h" +#include "runtime/VMInstance.h" +#include "Intl.h" +#include "IntlDisplayNames.h" + +namespace Escargot { + +IntlDisplayNamesObject::IntlDisplayNamesObject(ExecutionState& state, Object* proto, Value locales, Value options) + : Object(state, proto) +{ +#if defined(ENABLE_RUNTIME_ICU_BINDER) + UVersionInfo versionArray; + u_getVersion(versionArray); + if (versionArray[0] < 62) { + ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "Intl.DisplayNames needs 61+ version of ICU"); + } +#endif + // https://402.ecma-international.org/8.0/#sec-Intl.DisplayNames + // + https://tc39.es/intl-displaynames-v2/ + auto& staticStrings = state.context()->staticStrings(); + + // Let displayNames be ? OrdinaryCreateFromConstructor(NewTarget, "%DisplayNames.prototype%", « [[InitializedDisplayNames]], [[Locale]], [[Style]], [[Type]], [[Fallback]], [[Fields]] »). + // Let requestedLocales be ? CanonicalizeLocaleList(locales). + ValueVector requestedLocales = Intl::canonicalizeLocaleList(state, locales); + // If options is undefined, throw a TypeError exception. + // Let options be ? GetOptionsObject(options). + if (!options.isObject()) { + ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "options must be object"); + } + Object* optionsObject = options.asObject(); + // Let opt be a new Record. + StringMap opt; + // Let localeData be %DisplayNames%.[[LocaleData]]. + // Let matcher be ? GetOption(options, "localeMatcher", "string", « "lookup", "best fit" », "best fit"). + Value matcherValues[2] = { staticStrings.lazyLookup().string(), staticStrings.lazyBestFit().string() }; + Value matcher = Intl::getOption(state, optionsObject, staticStrings.lazyLocaleMatcher().string(), Intl::StringValue, matcherValues, 2, matcherValues[1]); + // Set opt.[[localeMatcher]] to matcher. + opt.insert(std::make_pair("localeMatcher", matcher.asString())); + // Let r be ResolveLocale(%DisplayNames%.[[AvailableLocales]], requestedLocales, opt, %DisplayNames%.[[RelevantExtensionKeys]]). + const auto& availableLocales = state.context()->vmInstance()->intlDisplayNamesAvailableLocales(); + StringMap r = Intl::resolveLocale(state, availableLocales, requestedLocales, opt, nullptr, 0, nullptr); + + // Let style be ? GetOption(options, "style", "string", « "narrow", "short", "long" », "long"). + Value styleValues[] = { staticStrings.lazyNarrow().string(), staticStrings.lazyShort().string(), staticStrings.lazyLong().string() }; + Value style = Intl::getOption(state, optionsObject, staticStrings.lazyStyle().string(), Intl::StringValue, styleValues, 3, styleValues[2]); + // Set displayNames.[[Style]] to style. + m_style = style.asString(); + // Let type be ? GetOption(options, "type", "string", « "language", "region", "script", "currency", "calendar", "dateTimeField" », undefined). + Value typeValues[] = { staticStrings.language.string(), staticStrings.region.string(), + staticStrings.script.string(), staticStrings.lazyCurrency().string(), staticStrings.calendar.string(), staticStrings.lazyDateTimeField().string() }; + Value type = Intl::getOption(state, optionsObject, staticStrings.lazyType().string(), Intl::StringValue, typeValues, 6, Value()); + // If type is undefined, throw a TypeError exception. + if (type.isUndefined()) { + ErrorObject::throwBuiltinError(state, ErrorObject::TypeError, "type of options is required"); + } + // Set displayNames.[[Type]] to type. + m_type = type.asString(); + // Let fallback be ? GetOption(options, "fallback", "string", « "code", "none" », "code"). + Value fallbackValues[2] = { staticStrings.lazyCode().string(), staticStrings.lazyNone().string() }; + Value fallback = Intl::getOption(state, optionsObject, staticStrings.lazyFallback().string(), Intl::StringValue, fallbackValues, 2, fallbackValues[0]); + // Set displayNames.[[Fallback]] to fallback. + m_fallback = fallback.asString(); + // Set displayNames.[[Locale]] to the value of r.[[Locale]]. + m_locale = r.at("locale"); + // Let dataLocale be r.[[dataLocale]]. + // Let dataLocaleData be localeData.[[]]. + // Let types be dataLocaleData.[[types]]. + // Assert: types is a Record (see 12.3.3). + // Let typeFields be types.[[]]. + // Assert: typeFields is a Record (see 12.3.3). + // Let languageDisplay be ? GetOption(options, "languageDisplay", "string", « "dialect", "standard" », "dialect"). + Value languageDisplayValues[] = { staticStrings.lazyDialect().string(), staticStrings.lazyStandard().string() }; + Value languageDisplay = Intl::getOption(state, optionsObject, staticStrings.lazyLanguageDisplay().string(), Intl::StringValue, + languageDisplayValues, 2, languageDisplayValues[0]); + // If type is "language", then + // Set displayNames.[[LanguageDisplay]] to languageDisplay. + m_languageDisplay = languageDisplay.asString(); + // Let typeFields be typeFields.[[]]. + // Assert: typeFields is a Record (see 1.4.3). + + // Let styleFields be typeFields.[[