From ad93268eef46ba96f1cacc016a78440bdafd12b6 Mon Sep 17 00:00:00 2001 From: Andre Date: Fri, 22 Jan 2021 21:40:24 -0600 Subject: [PATCH] Upgraded to V8 9.0.56 --- Dockerfile | 21 ++++++++++++--------- Makefile | 2 +- README.md | 34 +++++++++++++++++----------------- entrypoint.sh | 15 ++++++++------- 4 files changed, 38 insertions(+), 34 deletions(-) diff --git a/Dockerfile b/Dockerfile index fef3071..d600d26 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # First stage build (compile V8) # ============================================================================== -FROM debian:bullseye-slim as builder +FROM debian:stable-slim as builder ARG V8_VERSION=latest @@ -23,18 +23,21 @@ RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git ENV PATH="/depot_tools:${PATH}" -RUN fetch v8 && \ - cd /v8 && \ - git checkout ${V8_VERSION} && \ - ./tools/dev/v8gen.py x64.release -- v8_use_external_startup_data=false && \ - ninja -C out.gn/x64.release && \ - strip out.gn/x64.release/d8 +RUN fetch v8 + +WORKDIR /v8 + +RUN gn gen out/x64.release --args='v8_monolithic=true v8_use_external_startup_data=false is_component_build=false is_debug=false target_cpu="x64" use_goma=false goma_dir="None" v8_enable_backtrace=true v8_enable_disassembler=true v8_enable_object_print=true v8_enable_verify_heap=true' + +RUN ninja -C out/x64.release d8 + +RUN strip out/x64.release/d8 # ============================================================================== # Second stage build # ============================================================================== -FROM debian:bullseye-slim +FROM debian:stable-slim ARG V8_VERSION=latest ENV V8_VERSION=$V8_VERSION @@ -48,7 +51,7 @@ RUN apt-get update && apt-get upgrade -yqq && \ WORKDIR /v8 -COPY --from=builder /v8/out.gn/x64.release/d8 ./ +COPY --from=builder /v8/out/x64.release/d8 ./ COPY vimrc /root/.vimrc diff --git a/Makefile b/Makefile index 201d75a..8113868 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -TAG:=8.3.30 +TAG:=9.0.56 IMAGE:=andreburgaud/d8 default: help diff --git a/README.md b/README.md index 4dd7749..1051555 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,12 @@ $ docker pull andreburgaud/d8 ## V8 Enhanced Shell ``` -$ docker run --rm -it -v $PWD/examples:/examples/ andreburgaud/d8 shell -Options: --harmony --harmony-shipping --harmony-private-methods ---harmony-regexp-sequence --harmony-weak-refs --harmony-intl-segmenter ---harmony-namespace-exports --harmony-sharedarraybuffer --harmony-import-meta ---harmony-dynamic-import +$ docker run --rm -it andreburgaud/d8:9.0.56 shell +Options: --harmony --harmony-shipping --harmony-top-level-await --harmony-intl-dateformat-day-period + --harmony-sharedarraybuffer --harmony-atomics --harmony-weak-refs --harmony-string-replaceall + --harmony-logical-assignment --harmony-atomics-waitasync --harmony-relative-indexing-methods Use quit() or Ctrl-D (i.e. EOF) to exit the D8 Shell -V8 version 8.3.30 +V8 version 9.0.0 (candidate) d8> ``` @@ -71,21 +70,22 @@ d8> When ECMAScript 4 (ES4) was abandoned in 2008, some of its features were rolled into a project codenamed ECMAScript Harmony. ES6 later renamed ES2015 was the first "ECMAScript Harmony" specification and is also known as "ES6 Harmony". The V8 harmony options enable specific features that may not yet be part of the default engine features. -### Harmony Flags with Version 8.x +### Harmony Flags with Version 9.x The following flags are enabled when starting the D8 repl `docker run --rm -it andreburgaud/d8 shell`: ``` ---harmony (enable all completed harmony features) ---harmony-shipping (enable all shipped harmony features) ---harmony-private-methods (enable "harmony private methods in class literals" (in progress)) ---harmony-regexp-sequence (enable "RegExp Unicode sequence properties" (in progress)) ---harmony-weak-refs (enable "harmony weak references" (in progress)) ---harmony-intl-segmenter (enable "Intl.Segmenter") ---harmony-namespace-exports (enable "harmony namespace exports (export * as foo from 'bar')") ---harmony-sharedarraybuffer (enable "harmony sharedarraybuffer") ---harmony-import-meta (enable "harmony import.meta property") ---harmony-dynamic-import (enable "harmony dynamic import") +--harmony (enable all completed harmony features) +--harmony-shipping (enable all shipped harmony features) +--harmony-top-level-await (enable "harmony top level await") +--harmony-intl-dateformat-day-period (enable "Add dayPeriod option to DateTimeFormat") +--harmony-sharedarraybuffer (enable "harmony sharedarraybuffer") +--harmony-atomics (enable "harmony Atomics.waitAsync") +--harmony-weak-refs (enable "harmony weak references") +--harmony-string-replaceall (enable "harmony String.prototype.replaceAll") +--harmony-logical-assignment (enable "harmony logical assignment") +--harmony-atomics-waitasync (enable "harmony Atomics.waitAsync") +--harmony-relative-indexing-methods (enable "harmony relative indexing methods") ``` ## Help diff --git a/entrypoint.sh b/entrypoint.sh index 10464f9..3ac1a2f 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -8,14 +8,15 @@ start_d8() { start_d8_shell() { OPTIONS=(--harmony --harmony-shipping - --harmony-private-methods - --harmony-regexp-sequence - --harmony-weak-refs - --harmony-intl-segmenter - --harmony-namespace-exports + --harmony-top-level-await + --harmony-intl-dateformat-day-period --harmony-sharedarraybuffer - --harmony-import-meta - --harmony-dynamic-import) + --harmony-atomics + --harmony-weak-refs + --harmony-string-replaceall + --harmony-logical-assignment + --harmony-atomics-waitasync + --harmony-relative-indexing-methods) echo -e "\e[93mOptions\e[39m: ${OPTIONS[*]} $*" echo -e "\e[93mUse quit() or Ctrl-D (i.e. EOF) to exit the D8 Shell\e[39m"