From 28451a704f3081b8230753625c736c03ce0a2bfd Mon Sep 17 00:00:00 2001 From: HyukWoo Park Date: Thu, 4 Apr 2024 13:52:36 +0900 Subject: [PATCH] Update Walrus module * fix build error Signed-off-by: HyukWoo Park --- .github/workflows/es-actions.yml | 10 +++++----- CMakeLists.txt | 2 -- build/escargot.cmake | 1 + src/api/EscargotPublic.cpp | 9 +++++++++ src/api/EscargotPublic.h | 1 + third_party/walrus | 2 +- 6 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/es-actions.yml b/.github/workflows/es-actions.yml index fbd72ccac..b0627b50e 100644 --- a/.github/workflows/es-actions.yml +++ b/.github/workflows/es-actions.yml @@ -29,7 +29,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - submodules: true + submodules: recursive - name: Install Packages run: | brew update @@ -100,7 +100,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - submodules: true + submodules: recursive - name: Install Packages run: | sudo apt-get update @@ -157,7 +157,7 @@ jobs: sdk: "10.0.20348.0" - name: Build ${{ matrix.arch.cpu }} Release run: | - CMake -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION:STRING="10.0" -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch.cpu }} -Bout/ -DESCARGOT_OUTPUT=shell -DESCARGOT_LIBICU_SUPPORT=ON -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=NO -DESCARGOT_WASM=ON -DESCARGOT_THREADING=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -G Ninja -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_BUILD_TYPE=release -DCMAKE_C_FLAGS="${{ matrix.arch.flag }}" -DCMAKE_CXX_FLAGS="${{ matrix.arch.flag }}" + CMake -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION:STRING="10.0" -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch.cpu }} -Bout/ -DESCARGOT_OUTPUT=shell -DESCARGOT_LIBICU_SUPPORT=ON -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=NO -DESCARGOT_THREADING=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -G Ninja -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_BUILD_TYPE=release -DCMAKE_C_FLAGS="${{ matrix.arch.flag }}" -DCMAKE_CXX_FLAGS="${{ matrix.arch.flag }}" CMake --build out/ --config Release - name: Run octane run: | @@ -187,7 +187,7 @@ jobs: git config --global core.eol lf - uses: actions/checkout@v4 with: - submodules: true + submodules: recursive - uses: szenius/set-timezone@v1.2 with: timezoneWindows: "Pacific Standard Time" @@ -559,7 +559,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - submodules: true + submodules: recursive - name: Install Packages run: | sudo apt-get update diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a32327cc..12cca3899 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,8 +4,6 @@ PROJECT (ESCARGOT) # CONFIGURATION SET (CMAKE_VERBOSE_MAKEFILE true) -# so(dll)s are should placed on CMAKE_BINARY_DIR -SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) MESSAGE(STATUS "CMAKE_SYSTEM_NAME: " ${CMAKE_SYSTEM_NAME}) diff --git a/build/escargot.cmake b/build/escargot.cmake index 96fb4ac2d..2690679d1 100644 --- a/build/escargot.cmake +++ b/build/escargot.cmake @@ -142,6 +142,7 @@ IF (ESCARGOT_WASM) SET (WALRUS_ARCH ${ESCARGOT_ARCH}) SET (WALRUS_MODE ${ESCARGOT_MODE}) SET (WALRUS_OUTPUT "shared_lib") + SET (WALRUS_WASI OFF) # WASI should be OFF IF (${ESCARGOT_MODE} STREQUAL "release") SET (WALRUS_CXXFLAGS ${WALRUS_CXXFLAGS} ${ESCARGOT_CXXFLAGS_RELEASE}) diff --git a/src/api/EscargotPublic.cpp b/src/api/EscargotPublic.cpp index 394ef70b0..0e89c933d 100644 --- a/src/api/EscargotPublic.cpp +++ b/src/api/EscargotPublic.cpp @@ -2348,6 +2348,15 @@ bool ObjectRef::setPrototype(ExecutionStateRef* state, ValueRef* value) return toImpl(this)->setPrototype(*toImpl(state), toImpl(value)); } +bool ObjectRef::setObjectPrototype(ExecutionStateRef* state, ValueRef* value) +{ + // explicitly call Object::setPrototype + // could be used for initialization of __proto__to avoid ImmutablePrototypeObject::setPrototype + // should not be ProxyObject because ProxyObject has it's own setPrototype method + ASSERT(!toImpl(this)->isProxyObject()); + return toImpl(this)->Object::setPrototype(*toImpl(state), toImpl(value)); +} + StringRef* ObjectRef::constructorName(ExecutionStateRef* state) { return toRef(toImpl(this)->constructorName(*toImpl(state))); diff --git a/src/api/EscargotPublic.h b/src/api/EscargotPublic.h index 2b434ba4a..bcfa422c8 100644 --- a/src/api/EscargotPublic.h +++ b/src/api/EscargotPublic.h @@ -1399,6 +1399,7 @@ class ESCARGOT_EXPORT ObjectRef : public PointerValueRef { ValueRef* getPrototype(ExecutionStateRef* state); OptionalRef getPrototypeObject(ExecutionStateRef* state); // if __proto__ is not object(undefined or null), this function returns nullptr instead of orginal value. bool setPrototype(ExecutionStateRef* state, ValueRef* value); + bool setObjectPrototype(ExecutionStateRef* state, ValueRef* value); // explicitly call Object::setPrototype StringRef* constructorName(ExecutionStateRef* state); diff --git a/third_party/walrus b/third_party/walrus index af827e032..367de4eac 160000 --- a/third_party/walrus +++ b/third_party/walrus @@ -1 +1 @@ -Subproject commit af827e032d4bb6d7ff8e440fa56361b135803b2a +Subproject commit 367de4eace4655dc04d141391e5f3929b1081b08