Browse Source

Merge pull request #1740 from svaarala/v2.2.0-release-prep

Release preparations for 2.2.0 release
pull/1753/head
Sami Vaarala 7 years ago
committed by GitHub
parent
commit
d6b620bf32
  1. 1
      .gitignore
  2. 67
      Makefile
  3. 36
      RELEASES.rst
  4. 6
      dist-files/README.rst
  5. 39
      doc/release-checklist.rst
  6. 66
      doc/release-notes-v2-2.rst
  7. 3
      doc/test262-known-issues.yaml
  8. 2
      dukweb/dukweb.html
  9. 2
      examples/cmdline/duk_cmdline_lowmem.c
  10. 119
      examples/hello/hello_ptrcomp.c
  11. 2
      misc/clang_aliasing.c
  12. 3
      src-input/builtins.yaml
  13. 2
      src-input/duktape.h.in
  14. 51
      testrunner/run_commit_test.py
  15. 2
      tests/api/test-all-public-symbols.c
  16. 3
      tests/ecmascript/test-bi-arraybuffer-constructor.js
  17. 3
      tests/ecmascript/test-regexp-charclass-canon-blksize.js
  18. 6
      tests/ecmascript/test-regexp-charclass-canon-blockedge.js
  19. 6
      tests/ecmascript/test-regexp-charclass-canon-cornercases.js
  20. 3
      tests/ecmascript/test-regexp-charclass-canon-individual.js
  21. 6
      tests/ecmascript/test-regexp-charclass-canon-random.js
  22. 6
      util/bench_microbenchmarks.py
  23. 19
      util/format_perftest.py
  24. 109
      util/index_page_sizes.sh
  25. 38
      website/benchmarks.html
  26. 2
      website/buildsite.py
  27. 3
      website/download/download.html
  28. 12
      website/guide/intro.html
  29. 15
      website/index/index.html

1
.gitignore

@ -57,6 +57,7 @@
/bluebird.js
/dukvm.js
/jquery-1.11.0.js
/jquery-1.11.2.js
/coffee-script
/LiveScript
/coco

67
Makefile

@ -285,7 +285,7 @@ cleanall: clean
@rm -f lua-5.2.3.tar.gz
@rm -f luajs.zip
@rm -f bluebird.js
@rm -f jquery-1.11.0.js
@rm -f jquery-1.11.*.js
@rm -rf coffee-script
@rm -rf LiveScript
@rm -rf coco
@ -645,11 +645,11 @@ apitest: apiprep
# Dukweb.js test.
.PHONY: dukwebtest
dukwebtest: dukweb.js jquery-1.11.0.js
dukwebtest: dukweb.js jquery-1.11.2.js
@echo "### dukwebtest"
@rm -rf /tmp/dukweb-test/
mkdir /tmp/dukweb-test/
cp dukweb.js jquery-1.11.0.js dukweb/dukweb.html dukweb/dukweb.css /tmp/dukweb-test/
cp dukweb.js jquery-1.11.2.js dukweb/dukweb.html dukweb/dukweb.css /tmp/dukweb-test/
@echo "Now point your browser to: file:///tmp/dukweb-test/dukweb.html"
# Third party tests.
@ -854,8 +854,8 @@ emscripten:
# http://kripken.github.io/emscripten-site/docs/building_from_source/building_fastcomp_manually_from_source.html
$(GIT) clone --depth 1 https://github.com/kripken/emscripten.git
cd emscripten; ./emconfigure
jquery-1.11.0.js:
$(WGET) http://code.jquery.com/jquery-1.11.0.js -O $@
jquery-1.11.2.js:
$(WGET) http://code.jquery.com/jquery-1.11.2.js -O $@
lua-5.2.3.tar.gz:
$(WGET) http://www.lua.org/ftp/lua-5.2.3.tar.gz -O $@
lua-5.2.3: lua-5.2.3.tar.gz
@ -998,7 +998,7 @@ dist-iso: dist-src
.PHONY: tidy-site
tidy-site:
for i in website/*/*.html; do echo "*** Checking $$i"; tidy -q -e -xml $$i; done
site: duktape-releases dukweb.js jquery-1.11.0.js lz-string
site: duktape-releases dukweb.js jquery-1.11.2.js lz-string
rm -rf site
mkdir site
-cd duktape-releases/; git pull --rebase # get binaries up-to-date, but allow errors for offline use
@ -1151,58 +1151,3 @@ massif-%: tests/ecmascript/%.js duk
massif-helloworld: massif-test-dev-hello-world
massif-deepmerge: massif-test-dev-deepmerge
massif-arcfour: massif-test-dev-arcfour
# Simple performance test, minimum time for N runs
# - Duktape is interpreted and uses reference counting
# - Python and Perl are interpreted and also use reference counting
# - Ruby and Lua are interpreted but don't use reference counting
# - Mujs is interpreted but doesn't use reference counting
# - Rhino compiles to Java bytecode and is ultimately JITed
# - Node.js (V8) is JITed
# - Luajit is JITed
#TIME=$(PYTHON) util/time_multi.py --count 1 --sleep 0 --sleep-factor 2.0 --mode min # Take minimum time of N
#TIME=$(PYTHON) util/time_multi.py --count 3 --sleep 0 --sleep-factor 2.0 --mode min # Take minimum time of N
TIME=$(PYTHON) util/time_multi.py --count 5 --sleep 0 --sleep-factor 2.0 --mode min # Take minimum time of N
# Blocks: optimization variants, previous versions, other interpreting engines,
# other JIT engines.
perftest: duk duk.O2 duk.O3 duk.O4
for i in tests/perf/*.js; do \
printf '%-36s:' "`basename $$i`"; \
printf ' duk.Os %5s' "`$(TIME) ./duk $$i`"; \
printf ' duk.O2 %5s' "`$(TIME) ./duk.O2 $$i`"; \
printf ' duk.O3 %5s' "`$(TIME) ./duk.O3 $$i`"; \
printf ' duk.O4 %5s' "`$(TIME) ./duk.O4 $$i`"; \
printf ' |'; \
printf ' duk.O2.150 %5s' "`$(TIME) ./duk.O2.150 $$i`"; \
printf ' duk.O2.140 %5s' "`$(TIME) ./duk.O2.140 $$i`"; \
printf ' duk.O2.130 %5s' "`$(TIME) ./duk.O2.130 $$i`"; \
printf ' duk.O2.124 %5s' "`$(TIME) ./duk.O2.124 $$i`"; \
printf ' duk.O2.113 %5s' "`$(TIME) ./duk.O2.113 $$i`"; \
printf ' duk.O2.102 %5s' "`$(TIME) ./duk.O2.102 $$i`"; \
printf ' |'; \
printf ' mujs %5s' "`$(TIME) mujs $$i`"; \
printf ' jerry %5s' "`$(TIME) jerry $$i`"; \
printf ' lua %5s' "`$(TIME) lua $${i%%.js}.lua`"; \
printf ' python %5s' "`$(TIME) $(PYTHON) $${i%%.js}.py`"; \
printf ' perl %5s' "`$(TIME) perl $${i%%.js}.pl`"; \
printf ' ruby %5s' "`$(TIME) ruby $${i%%.js}.rb`"; \
printf ' |'; \
printf ' rhino %5s' "`$(TIME) rhino $$i`"; \
printf ' node %5s' "`$(TIME) node $$i`"; \
printf ' luajit %5s' "`$(TIME) luajit $${i%%.js}.lua`"; \
printf '\n'; \
done
perftestduk: duk.O2 duk-perf.O2
for i in tests/perf/*.js; do \
printf '%-36s:' "`basename $$i`"; \
printf ' duk-perf.O2 %5s' "`$(TIME) ./duk-perf.O2 $$i`"; \
printf ' duk.O2 %5s' "`$(TIME) ./duk.O2 $$i`"; \
printf ' |'; \
printf ' mujs %5s' "`$(TIME) mujs $$i`"; \
printf ' jerry %5s' "`$(TIME) jerry $$i`"; \
printf ' duk.O2.master %5s' "`$(TIME) ./duk.O2.master $$i`"; \
printf ' duk.O2.150 %5s' "`$(TIME) ./duk.O2.150 $$i`"; \
printf '\n'; \
done

36
RELEASES.rst

@ -2893,18 +2893,10 @@ Miscellaneous:
* Fix incorrect handling of register bound unary operation target for
unary minus, unary plus, and bitwise NOT (GH-1623, GH-1624)
Planned
=======
2.0.3 (XXXX-XX-XX)
------------------
* TBD
2.2.0 (XXXX-XX-XX)
2.2.0 (2017-09-23)
------------------
* Change Duktape/C function inheritance for user functions pushed using
* Change inheritance for Duktape/C user functions pushed using
duk_push_c_function() and duk_push_c_lightfunc(), they now inherit from an
intermediate prototype object (function -> %NativeFunctionPrototype% ->
Function.prototype) which provides .name and .length getters; the virtual
@ -2977,10 +2969,10 @@ Planned
* Add support for Proxy 'apply' and 'construct' traps (GH-1601)
* Add minimal new.target support, evaluates to undefined for non-constructor
calls and final non-bound constructor function in constructor calls;
explicit newTarget not yet supported and handling of new.target in eval()
code is not yet fully correct (GH-1544, GH-1572)
* Add minimal new.target support; new.target evaluates to undefined for
non-constructor calls and to the final non-bound constructor function in
constructor calls; explicit newTarget not yet supported and handling of
new.target in eval() code is not yet fully correct (GH-1544, GH-1572)
* Add proper string vs. symbol sorting to Reflect.ownKeys() and other
enumeration call sites (GH-1460, GH-1607)
@ -2998,7 +2990,7 @@ Planned
* Add a wrap check to duk_{check,require}_stack{_top}() (GH-1537)
* Improve case insensitive RegExp character class compilation performance
using a small (256 byte, footprint impact is about 300-400 bytes)
using a small (256 byte, total footprint impact is about 300-400 bytes)
canonicalization lookup bitmap (GH-1616)
* Improve error messages for source code, base-64, hex, UTF-8, and bytecode
@ -3102,7 +3094,7 @@ Planned
requested (GH-1536)
* Fix incorrect pausing by debugger StepOut, StepOver, and StepInto commands
when stepping over a tail call (GH-1684, GH-1685, GH-1726, GH-1734)
when stepping out/over/into a tail call (GH-1684, GH-1685, GH-1726, GH-1734)
* Fix duk_hbufobj assert in shared slice() handling (GH-1506)
@ -3161,8 +3153,8 @@ Planned
attached to a duk_hthread instead of being a separate, monolithic
thr->callstack (GH-1487)
* Internal change: duk_catcher structs are now in a single linked list attached
to a duk_activation instead of being a separate, monolithic
* Internal change: duk_catcher structs are now in a single linked list
attached to a duk_activation instead of being a separate, monolithic
thr->catchstack (GH-1449)
* Internal change: simple freelists for duk_activation and duk_catcher
@ -3192,6 +3184,14 @@ Planned
check entry part before array part in property lookup (GH-1634); optimize
duk_propdesc filling in property lookups (GH-1635)
Planned
=======
2.3.0 (XXXX-XX-XX)
------------------
* TBD
3.0.0 (XXXX-XX-XX)
------------------

6
dist-files/README.rst

@ -10,8 +10,8 @@ Duktape supports the full E5/E5.1 feature set (with some semantics updated
from ES2015+) including errors, Unicode strings, and regular expressions,
a subset of Ecmascript 2015 (E6) and Ecmascript 2016 (E7) features (e.g.
computed property names, Proxy objects, exponentiation operator, Reflect),
ES2015 ArrayBuffer/TypedView, Node.js Buffer, and WHATWG Encoding API
living standard.
ES2015 ArrayBuffer/TypedView, Node.js Buffer, performance.now(), and WHATWG
Encoding API living standard.
Duktape also provides a number of custom features such as error tracebacks,
additional data types for better C integration, combined reference counting
@ -118,7 +118,7 @@ You can find release notes at:
* https://github.com/svaarala/duktape/blob/master/RELEASES.rst
(summary of all versions)
* https://github.com/svaarala/duktape/blob/master/doc/release-notes-v2-1.rst
* https://github.com/svaarala/duktape/blob/master/doc/release-notes-v2-2.rst
(more detailed notes for this version)
This distributable contains Duktape version @DUK_VERSION_FORMATTED@, created from git

39
doc/release-checklist.rst

@ -40,8 +40,6 @@ Checklist for ordinary releases
- Check year range
- Also check ``util/create_spdx_license.py``
* Ensure RELEASES.rst is up-to-date
- New release is in place
@ -96,9 +94,9 @@ Checklist for ordinary releases
- Check ``make duk-clang``, covers ``-Wcast-align``
* Test genconfig manually using metadata from the distributable
* Test configure.py manually using metadata from the distributable
- Ensure that Duktape compiles with e.g. ``-DDUK_USE_FASTINT`` genconfig
- Ensure that Duktape compiles with e.g. ``-DDUK_USE_FASTINT`` configure
argument
* Ecmascript testcases
@ -141,11 +139,6 @@ Checklist for ordinary releases
- test-dev-refcount-leak-basic.js
* Performance testing
- Check for unexpected performance regressions by compiling previous release
and candidate release with ``-O2`` and running "make perftest" for them.
* API testcases
- On x86-64:
@ -155,12 +148,6 @@ Checklist for ordinary releases
- -Werror is no longer enabled so check apitest output for any test
case warnings (or enable -Werror manually in runtests.js)
* Regfuzz
- On x86-64, with DUK_USE_ASSERTIONS
- make regfuzztest
* test262
- on x86-64
@ -171,7 +158,7 @@ Checklist for ordinary releases
* Assorted release tests driven by Makefile
- on x86-65
- on x86-64
- make clean releasetest
@ -186,6 +173,20 @@ Checklist for ordinary releases
- Test JSON proxy
* Performance testing and Wiki performance results page
- Update and run ``util/bench_microbenchmarks.py`` to get raw microbenchmark
results. Then use ``util/format_perftest.py`` to format into HTML; the
different parts of the Wiki performance page need manual tweaking of the
format_perftest.py script.
- Run Octane results manually for now.
* Website index page footprint/RAM figures
- Run ``util/index_page_sizes.sh`` manually and update index page results
accordingly.
* Prepare an update pull for compat-table
- Fork and branch
@ -329,17 +330,13 @@ Checklist for maintenance releases
* Bump DUK_VERSION in maintenance branch.
* Check dist-files/Makefile.sharedlibrary; currently duplicates version
number and needs to be fixed manually.
* Review diff between previous release and new patch release.
* Tag release, description "maintenance release" should be good enough for
most patch releases.
* Build release. Compare release to previous release package by diffing the
unpacked directories. The SPDX license can be diffed by sorting the files
first and then using diff -u.
unpacked directories.
* Build website from master. Deploy only ``download.html``.

66
doc/release-notes-v2-2.rst

@ -7,16 +7,31 @@ Release overview
Main changes in this release (see RELEASES.rst for full details):
* TBD.
* Internal reworking of call handling for better performance and code sharing.
Coroutine yield and tail call restrictions removed when using new Foo(),
.call(), .apply(), Reflect.apply(), and Reflect.construct(). Maximum call
argument count increased to ~64k.
* C API additions: duk_seal(), duk_freeze(), duk_is_constructable(),
duk_require_object(), duk_push_proxy(), macros for creating symbol
literals in C code (DUK_HIDDEN_SYMBOL("myValue") etc), and more
duk_def_prop() convenience flags. The 0xFF byte prefix is now reserved
entirely for user hidden Symbols, so there are no longer restrictions in
what follows the prefix.
* More ES2015 features: Math.clz32(), Math.imul(), Math.sign(),
Object.prototype.{__defineGetter__,__defineSetter__},
Object.prototype.{__lookupGetter__,_lookupSetter__}, Proxy 'apply' and
'construct' traps, minimal new.target, and fixed string/symbol key sorting.
* Performance.now() binding and a monotonic time provider.
* Case insensitive RegExp character class canonicalization performance has
improved by ~50x using a small lookup table (256 bytes, total footprint
impact is ~300-400 bytes).
* The 0xFF string prefix byte is now reserved to application hidden Symbols,
so there are no longer restrictions in what follows the prefix. The new
DUK_HIDDEN_SYMBOL("myValue") macro is recommended and uses a single 0xFF
prefix byte.
* Performance, footprint, and portability improvements. Also improvements
to error messages, value summaries, and assertion coverage.
Upgrading from Duktape 2.1
==========================
@ -24,6 +39,10 @@ Upgrading from Duktape 2.1
No action (other than recompiling) should be needed for most users to upgrade
from Duktape v2.1.x. Note the following:
* There are public API macros to create different Symbol types as C literals.
For example, DUK_HIDDEN_SYMBOL("myPointer") can now be used instead of
manually creating the internal representation ("\xFF" "myPointer").
* Bytecode dump format has been changed slightly: initial byte is now 0xBF
(previously 0xFF) to avoid potential confusion with Symbol strings, and
serialization version byte (in practice unused) was removed from the format.
@ -36,16 +55,6 @@ from Duktape v2.1.x. Note the following:
(e.g. '(1U << 3)) to match their C type. These changes may cause some
sign conversion warnings in application call sites.
* There are public API macros to create different Symbol types as C literals.
For example, DUK_HIDDEN_SYMBOL("myPointer") can now be used instead of
manually creating the internal representation ("\xFF" "myPointer").
* Case insensitive RegExps are still much slower than case sensitive ones.
The small canonicalization lookup (256 bytes) is enabled by default. The
small lookup is still slower than DUK_USE_REGEXP_CANON_WORKAROUND but the
difference is now much smaller. You may be able to turn off the workaround
option whose main downside is a relatively large footprint impact (128kB).
* duk_safe_call() no longer automatically extends the value stack to ensure
there's space for 'nrets' return values. This was not guaranteed by the
API and the check is mostly unnecessary overhead. If a duk_safe_call()
@ -59,17 +68,12 @@ from Duktape v2.1.x. Note the following:
very low memory targets. If you're using a pool allocator, you may need to
measure and adjust pool sizes/counts.
* Function.prototype.call(), Function.prototype.apply(), and Reflect.apply()
are now handled inline in call handling. As a result, when functions are
called via .call()/.apply() the .call()/.apply() is not part of the call
stack and is absent in e.g. tracebacks. .call()/.apply() no longer prevents
a yield, doesn't consume native stack for Ecmascript-to-Ecmascript calls,
and can now be used in tailcall positions, e.g. in
'return func.call(null, 1, 2);'.
* Constructor calls, i.e. 'new Xyz()' or duk_new(), no longer prevent a yield,
don't consume native stack for Ecmascript-to-Ecmascript calls, and can now
be used in tailcalls.
* Function.prototype.call(), Function.prototype.apply(), Reflect.apply(),
new Xyz(), duk_new(), and Reflect.construct() are now handled inline in call
handling. As a result, they are not part of the call stack, are absent in
tracebacks, don't consume native stack for Ecmascript-to-Ecmascript calls,
no longer prevent a coroutine yield, and can be used in tail call positions
(e.g. 'return func.call(null, 1, 2);').
* Functions pushed using duk_push_c_function() and duk_push_c_lightfunc() now
inherit from an intermediate prototype (func -> %NativeFunctionPrototype%
@ -86,6 +90,10 @@ from Duktape v2.1.x. Note the following:
properties; the bound argument values are not visible in the debugger
protocol for now.
* The Proxy target and handler references are no longer internal properties
(but duk_hproxy struct members), and are not visible in the debugger
protocol for now.
* DUK_USE_DATE_GET_NOW() is now allowed to return fractions. The fractions
won't be available through the Date built-in (this is forbidden by the
Ecmascript specification) but are available through the duk_get_now() C
@ -98,7 +106,11 @@ from Duktape v2.1.x. Note the following:
step commands will still pause on function entry/exit as appropriate; for
example, StepInto will pause on function entry or exit (or an error throw).
Other minor differences:
* Case insensitive RegExps are still much slower than case sensitive ones.
The small canonicalization lookup (256 bytes) is enabled by default. The
small lookup is still slower than DUK_USE_REGEXP_CANON_WORKAROUND but the
difference is now much smaller. You may be able to turn off the workaround
option whose main downside is a relatively large footprint impact (128kB).
* When an Error instance is being constructed and Duktape.errCreate() is
called for the constructor return value, the call stack seen by errCreate()

3
doc/test262-known-issues.yaml

@ -57,9 +57,6 @@
test: "ch15/15.10/15.10.2/15.10.2.10/S15.10.2.10_A5.1_T1"
knownissue: "possible test case bug, compiles invalid RegExp '/\\undefined/'"
regexp_leniency: true
-
test: "ch15/15.10/15.10.2/15.10.2.13/S15.10.2.13_A1_T16"
knownissue: "uses invalid DecimalEscape inside a character class, '/[\\12-\\14]/'"
-
test: "ch15/15.10/15.10.2/15.10.2.9/S15.10.2.9_A1_T4"
knownissue: "invalid backreference '\\2', RegExp only has one capture; in E5.1 this is a SyntaxError"

2
dukweb/dukweb.html

@ -3,7 +3,7 @@
<head>
<title>Dukweb.js test</title>
<script type="text/javascript" src="dukweb.js"></script>
<script type="text/javascript" src="jquery-1.11.0.js"></script>
<script type="text/javascript" src="jquery-1.11.2.js"></script>
<link href="dukweb.css" rel="stylesheet" type="text/css"/>
</head>
<body>

2
examples/cmdline/duk_cmdline_lowmem.c

@ -1011,6 +1011,6 @@ duk_bool_t lowmem_exec_timeout_check(void *udata) {
#else /* DUK_CMDLINE_LOWMEM */
int ajs_dummy = 0; /* to avoid empty source file */
int duk_lowmem_dummy = 0; /* to avoid empty source file */
#endif /* DUK_CMDLINE_LOWMEM */

119
examples/hello/hello_ptrcomp.c

@ -0,0 +1,119 @@
/*
* Very simple example program, pointer compression and ROM builti-ins enabled
*/
#include "duktape.h"
#include "duk_alloc_pool.h"
#define POOL_BUFFER_SIZE (255 * 1024)
#define POOL_NUM_POOLS 28
static const duk_pool_config pool_config[POOL_NUM_POOLS] = {
{ 8, 10 * 8, 0 },
{ 12, 600 * 12, 0 },
{ 16, 300 * 16, 0 },
{ 20, 300 * 20, 0 },
{ 24, 300 * 24, 0 },
{ 28, 250 * 28, 0 },
{ 32, 150 * 32, 0 },
{ 40, 150 * 40, 0 },
{ 48, 50 * 48, 0 },
{ 52, 50 * 52, 0 },
{ 56, 50 * 56, 0 },
{ 60, 50 * 60, 0 },
{ 64, 50 * 64, 0 },
{ 96, 50 * 96, 0 },
{ 196, 0, 196 }, /* duk_heap, with heap ptr compression, ROM strings+objects */
{ 232, 0, 232 }, /* duk_hthread, with heap ptr compression, ROM strings+objects */
{ 256, 16 * 256, 0 },
{ 288, 1 * 288, 0 },
{ 320, 1 * 320, 0 },
{ 400, 0, 400 }, /* duk_hthread, with heap ptr compression, RAM strings+objects */
{ 520, 0, 520 }, /* duk_heap, with heap ptr compression, RAM strings+objects */
{ 512, 16 * 512, 0 },
{ 768, 0, 768 }, /* initial value stack for packed duk_tval */
{ 1024, 6 * 1024, 0 },
{ 2048, 5 * 2048, 0 },
{ 4096, 3 * 4096, 0 },
{ 8192, 3 * 8192, 0 },
{ 16384, 1 * 16384, 0 },
};
static duk_pool_state pool_state[POOL_NUM_POOLS];
static duk_pool_global pool_global;
static duk_ret_t native_print(duk_context *ctx) {
duk_push_string(ctx, " ");
duk_insert(ctx, 0);
duk_join(ctx, duk_get_top(ctx) - 1);
printf("%s\n", duk_safe_to_string(ctx, -1));
return 0;
}
static duk_ret_t native_adder(duk_context *ctx) {
int i;
int n = duk_get_top(ctx); /* #args */
double res = 0.0;
for (i = 0; i < n; i++) {
res += duk_to_number(ctx, i);
}
duk_push_number(ctx, res);
return 1; /* one return value */
}
static void dump_pool_stats(void) {
duk_pool_global_stats st;
duk_alloc_pool_get_global_stats(&pool_global, &st);
printf("POOL STATS: used=%ld free=%ld waste=%ld; hwm used=%ld, hwm waste=%ld (bytes)\n",
(long) st.used_bytes, (long) st.free_bytes, (long) st.waste_bytes,
(long) st.hwm_used_bytes, (long) st.hwm_waste_bytes);
}
int main(int argc, char *argv[]) {
duk_context *ctx;
void *heap_udata;
void *pool_buffer;
(void) argc; (void) argv; /* suppress warning */
pool_buffer = malloc(POOL_BUFFER_SIZE);
printf("pool_buffer: %p\n", pool_buffer);
heap_udata = duk_alloc_pool_init(pool_buffer,
POOL_BUFFER_SIZE,
pool_config,
pool_state,
POOL_NUM_POOLS,
&pool_global);
printf("heap_udata: %p\n", heap_udata);
ctx = duk_create_heap(duk_alloc_pool,
duk_realloc_pool,
duk_free_pool,
heap_udata,
NULL);
printf("ctx: %p\n", ctx);
dump_pool_stats();
duk_push_c_function(ctx, native_print, DUK_VARARGS);
duk_put_global_string(ctx, "print");
duk_push_c_function(ctx, native_adder, DUK_VARARGS);
duk_put_global_string(ctx, "adder");
duk_eval_string(ctx, "print('Hello world!');");
duk_eval_string(ctx, "print('2+3=' + adder(2, 3));");
duk_pop(ctx); /* pop eval result */
dump_pool_stats();
duk_destroy_heap(ctx);
free(pool_buffer);
return 0;
}

2
misc/clang_aliasing.c

@ -15,7 +15,7 @@
* 11 22 33 44 00 00 f9 ff <==
* 11 22 33 44 00 00 f1 ff
*
* The value is corrupted even in the base care where 'a' is initialized
* The value is corrupted even in the base case where 'a' is initialized
* as bytes and then copied with a structural assignment; the double part
* of the union is not accessed at all. The corruption is always that the
* 7th byte gets OR'd with 0x08. This bit is the highest bit of the IEEE

3
src-input/builtins.yaml

@ -3413,6 +3413,7 @@ objects:
# https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Promise.jsm/Deferred.
# 'accept' is obsolete and not implemented:
#https://bugs.chromium.org/p/v8/issues/detail?id=3238
# 'try': https://github.com/tc39/proposal-promise-try
- id: bi_promise_prototype
class: Object
@ -3448,6 +3449,8 @@ objects:
# 'chain' is an obsolete variant of .then and not implemented:
# https://stackoverflow.com/questions/34713965/the-feature-of-method-promise-prototype-chain-in-chrome
# 'finally': https://github.com/tc39/proposal-promise-finally
#
# TypedArray
#

2
src-input/duktape.h.in

@ -38,7 +38,7 @@
* development snapshots have 99 for patch level (e.g. 0.10.99 would be a
* development version after 0.10.0 but before the next official release).
*/
#define DUK_VERSION 20199L
#define DUK_VERSION 20200L
/* Git commit, describe, and branch for Duktape build. Useful for
* non-official snapshot builds so that application code can easily log

51
testrunner/run_commit_test.py

@ -148,6 +148,9 @@ def format_size_diff(newsz, oldsz):
newsz['total'] - oldsz['total']
)
def format_size(sz):
return '%d %d %d' % (sz['text'], sz['data'], sz['bss'])
output_result_json = {}
def set_output_result(doc):
for k in doc.keys():
@ -342,12 +345,12 @@ def context_linux_x64_gcc_defsize_makeduk():
execute([ 'make', 'duk' ])
return context_helper_get_binary_size_diff(comp)
def context_linux_x64_gcc_defsize_fltoetc():
def context_helper_defsize_fltoetc(archopt):
cwd = os.getcwd()
def comp():
execute([ 'make', 'dist' ])
execute([
'gcc', '-oduk',
'gcc', '-oduk', archopt,
'-Os', '-fomit-frame-pointer',
'-fno-stack-protector',
'-flto', '-fno-asynchronous-unwind-tables',
@ -360,6 +363,17 @@ def context_linux_x64_gcc_defsize_fltoetc():
])
return context_helper_get_binary_size_diff(comp)
def context_linux_x64_gcc_defsize_fltoetc():
return context_helper_defsize_fltoetc('-m64')
def context_linux_x86_gcc_defsize_fltoetc():
return context_helper_defsize_fltoetc('-m32')
def context_linux_x32_gcc_defsize_fltoetc():
return context_helper_defsize_fltoetc('-mx32')
def context_linux_arm_gcc_defsize_fltoetc():
return context_helper_defsize_fltoetc('-marm')
def context_linux_thumb_gcc_defsize_fltoetc():
return context_helper_defsize_fltoetc('-mthumb')
def context_helper_minsize_fltoetc(archopt, strip):
cwd = os.getcwd()
def comp():
@ -400,21 +414,25 @@ def context_helper_minsize_fltoetc(archopt, strip):
def context_linux_x64_gcc_minsize_fltoetc():
return context_helper_minsize_fltoetc('-m64', False)
def context_linux_x86_gcc_minsize_fltoetc():
return context_helper_minsize_fltoetc('-m32', False)
def context_linux_x32_gcc_minsize_fltoetc():
return context_helper_minsize_fltoetc('-mx32', False)
def context_linux_arm_gcc_minsize_fltoetc():
return context_helper_minsize_fltoetc('-marm', False)
def context_linux_thumb_gcc_minsize_fltoetc():
return context_helper_minsize_fltoetc('-mthumb', False)
def context_linux_x64_gcc_stripsize_fltoetc():
return context_helper_minsize_fltoetc('-m64', True)
def context_linux_x86_gcc_stripsize_fltoetc():
return context_helper_minsize_fltoetc('-m32', True)
def context_linux_x32_gcc_stripsize_fltoetc():
return context_helper_minsize_fltoetc('-mx32', True)
def context_linux_arm_gcc_stripsize_fltoetc():
return context_helper_minsize_fltoetc('-marm', True)
def context_linux_thumb_gcc_stripsize_fltoetc():
return context_helper_minsize_fltoetc('-mthumb', True)
def context_linux_x64_cpp_exceptions():
# For now rather simple: compile, run, and grep for my_class
@ -800,10 +818,8 @@ def context_helper_hello_ram(archopt):
def context_linux_x64_hello_ram():
return context_helper_hello_ram('-m64')
def context_linux_x86_hello_ram():
return context_helper_hello_ram('-m32')
def context_linux_x32_hello_ram():
return context_helper_hello_ram('-mx32')
@ -956,8 +972,10 @@ def context_linux_graph_hello_size_helper(archopt):
os.path.join(cwd, 'examples', 'hello', 'hello.c'),
'-lm'
])
sz = get_binary_size(os.path.join(cwd, 'hello'))
set_output_result({
'newsz': get_binary_size(os.path.join(cwd, 'hello'))
'description': format_size(sz),
'newsz': sz
})
return True
@ -967,6 +985,10 @@ def context_linux_x86_graph_hello_size():
return context_linux_graph_hello_size_helper('-m32')
def context_linux_x32_graph_hello_size():
return context_linux_graph_hello_size_helper('-mx32')
def context_linux_arm_graph_hello_size():
return context_linux_graph_hello_size_helper('-marm')
def context_linux_thumb_graph_hello_size():
return context_linux_graph_hello_size_helper('-mthumb')
def context_codemetrics():
def scandir(path):
@ -1033,18 +1055,29 @@ context_handlers = {
'linux-x64-duk-gxx': context_linux_x64_duk_gxx,
'linux-x64-gcc-defsize-makeduk': context_linux_x64_gcc_defsize_makeduk,
'linux-x64-gcc-defsize-fltoetc': context_linux_x64_gcc_defsize_fltoetc,
'linux-x86-gcc-defsize-fltoetc': context_linux_x86_gcc_defsize_fltoetc,
'linux-x32-gcc-defsize-fltoetc': context_linux_x32_gcc_defsize_fltoetc,
'linux-arm-gcc-defsize-fltoetc': context_linux_arm_gcc_defsize_fltoetc,
'linux-thumb-gcc-defsize-fltoetc': context_linux_thumb_gcc_defsize_fltoetc,
'linux-x64-gcc-minsize-fltoetc': context_linux_x64_gcc_minsize_fltoetc,
'linux-x86-gcc-minsize-fltoetc': context_linux_x86_gcc_minsize_fltoetc,
'linux-x32-gcc-minsize-fltoetc': context_linux_x32_gcc_minsize_fltoetc,
'linux-arm-gcc-minsize-fltoetc': context_linux_arm_gcc_minsize_fltoetc,
'linux-thumb-gcc-minsize-fltoetc': context_linux_thumb_gcc_minsize_fltoetc,
'linux-x64-gcc-stripsize-fltoetc': context_linux_x64_gcc_stripsize_fltoetc,
'linux-x86-gcc-stripsize-fltoetc': context_linux_x86_gcc_stripsize_fltoetc,
'linux-x32-gcc-stripsize-fltoetc': context_linux_x32_gcc_stripsize_fltoetc,
'linux-arm-gcc-stripsize-fltoetc': context_linux_arm_gcc_stripsize_fltoetc,
'linux-thumb-gcc-stripsize-fltoetc': context_linux_thumb_gcc_stripsize_fltoetc,
# Jobs matching previous graphs.html data points.
'linux-x64-graph-hello-size': context_linux_x64_graph_hello_size,
'linux-x86-graph-hello-size': context_linux_x86_graph_hello_size,
'linux-x32-graph-hello-size': context_linux_x32_graph_hello_size,
'linux-arm-graph-hello-size': context_linux_arm_graph_hello_size,
'linux-thumb-graph-hello-size': context_linux_thumb_graph_hello_size,
'linux-x64-cpp-exceptions': context_linux_x64_cpp_exceptions,

2
tests/api/test-all-public-symbols.c

@ -83,6 +83,7 @@ static duk_ret_t test_func(duk_context *ctx, void *udata) {
(void) duk_fatal(ctx, "dummy");
(void) duk_free_raw(ctx, NULL);
(void) duk_free(ctx, NULL);
(void) duk_freeze(ctx, 0);
(void) duk_gc(ctx, 0);
duk_generic_error(ctx, "dummy");
duk_generic_error_va(ctx, "dummy", NULL);
@ -300,6 +301,7 @@ static duk_ret_t test_func(duk_context *ctx, void *udata) {
(void) duk_safe_to_lstring(ctx, 0, NULL);
(void) duk_safe_to_string(ctx, 0);
(void) duk_samevalue(ctx, 0, 0);
(void) duk_seal(ctx, 0);
(void) duk_set_finalizer(ctx, 0);
(void) duk_set_global_object(ctx);
(void) duk_set_length(ctx, 0, 0);

3
tests/ecmascript/test-bi-arraybuffer-constructor.js

@ -6,7 +6,8 @@
/*---
{
"custom": true
"custom": true,
"slow": true
}
---*/

3
tests/ecmascript/test-regexp-charclass-canon-blksize.js

@ -10,7 +10,8 @@
/*---
{
"skip": true
"skip": true,
"slow": true
}
---*/

6
tests/ecmascript/test-regexp-charclass-canon-blockedge.js

@ -5,6 +5,12 @@
/*@include util-regexp.js@*/
/*---
{
"slow": true
}
---*/
/*===
1023 [\u03ff-\u03ff] F893 T1 F129 T1 F64512
1024 [\u03ff-\u0400] F893 T1 F129 T2 F79 T1 F64431

6
tests/ecmascript/test-regexp-charclass-canon-cornercases.js

@ -4,6 +4,12 @@
/*@include util-regexp.js@*/
/*---
{
"slow": true
}
---*/
/*===
256 [\u0000-\u0100] T258 F118 T1 F547 T1 F31 T1 F64579
257 [\u0001-\u0101] F1 T257 F118 T1 F547 T1 F31 T1 F64579

3
tests/ecmascript/test-regexp-charclass-canon-individual.js

@ -10,7 +10,8 @@
/*---
{
"skip": true
"skip": true,
"slow": true
}
---*/

6
tests/ecmascript/test-regexp-charclass-canon-random.js

@ -5,6 +5,12 @@
/*@include util-regexp.js@*/
/*---
{
"slow": true
}
---*/
// Verified against Firefox.
/*===
[\u325e-\uceff] F604 T1 F4 T1 F3 T2 F3 T1 F1 T1 F26 T1 F21 T2 F4353 T80 F2200 T1 F240 T1 F5348 T40098 F12544

6
util/bench_microbenchmarks.py

@ -105,11 +105,13 @@ def run_one(testfile):
return doc
def format_one(doc):
res = '%-36s:' % os.path.basename(doc['test'])
res = '%-40s:' % os.path.basename(doc['test'])
for eng in engines:
engname = eng['name']
t = doc['engines'][engname]
if t.get('sigsegv', False):
if t.get('killed', False):
res += ' %s %5s' % (engname, 'kill')
elif t.get('sigsegv', False):
res += ' %s %5s' % (engname, 'segv')
elif t.get('failed', False):
res += ' %s %5s' % (engname, 'n/a')

19
util/format_perftest.py

@ -20,8 +20,8 @@ def main():
results = []
baseline = []
# Column index (positive or negative) for baseline engine.
baseline_column = 1 # Second engine is baseline by default, e.g. duk.O2 vs duk.O2.master
# Column index (positive or negative) for baseline engine (after filtering).
baseline_column = 4
with open(sys.argv[1], 'rb') as f_in, open(sys.argv[2], 'wb') as f_out:
for line in f_in:
@ -45,9 +45,20 @@ def main():
result.append(float(parts[idx]))
except ValueError:
result.append(None)
baseline.append(result[baseline_column])
results.append(result)
filter_columns = [ 3, 4, 5, 6, 7, 8, 9, 10 ]
def do_filter(val):
res = []
for i in filter_columns:
res.append(val[i])
return res
#headings = do_filter(headings)
#results = [ do_filter(x) for x in results ]
baseline = [ x[baseline_column] for x in results ]
#print(repr(headings))
#print(repr(results))
@ -110,6 +121,8 @@ tr:nth-child(odd) { background: #eeeeee; }
if column == baseline_column:
style = 'background-color: #eeeeee'
#if column not in [ 3, 4 ]:
# style = 'background-color: #eeeeee'
if t is None:
text = '-'

109
util/index_page_sizes.sh

@ -0,0 +1,109 @@
#!/bin/sh
#
# Manual script to get index page footprint/RAM figures.
#
set -e
#set -x
ARCHOPT=-m32
#ARCHOPT=-mthumb
echo ""
echo "***"
echo "*** default"
echo "***"
echo ""
rm -rf /tmp/duk-index-tmp
rm -f /tmp/hello
python2 tools/configure.py \
--source-directory src-input \
--output-directory /tmp/duk-index-tmp \
--config-metadata config
gcc -o/tmp/hello $ARCHOPT -std=c99 -Wall -Os \
-fomit-frame-pointer -flto \
-fno-asynchronous-unwind-tables \
-ffunction-sections -Wl,--gc-sections \
-fno-stack-protector \
-I/tmp/duk-index-tmp \
/tmp/duk-index-tmp/duktape.c examples/hello/hello.c -lm
size /tmp/hello
valgrind --tool=massif --massif-out-file=/tmp/duk-massif.out /tmp/hello
ms_print /tmp/duk-massif.out | head -20
echo ""
echo "***"
echo "*** lowmem"
echo "***"
echo ""
rm -rf /tmp/duk-index-tmp
rm -f /tmp/hello
python2 tools/configure.py \
--source-directory src-input \
--output-directory /tmp/duk-index-tmp \
--config-metadata config \
--option-file config/examples/low_memory.yaml
gcc -o/tmp/hello $ARCHOPT -std=c99 -Wall -Os \
-fomit-frame-pointer -flto \
-fno-asynchronous-unwind-tables \
-ffunction-sections -Wl,--gc-sections \
-fno-stack-protector \
-I/tmp/duk-index-tmp \
/tmp/duk-index-tmp/duktape.c examples/hello/hello.c -lm
size /tmp/hello
valgrind --tool=massif --massif-out-file=/tmp/duk-massif.out /tmp/hello
ms_print /tmp/duk-massif.out | head -20
echo ""
echo "***"
echo "*** full lowmem"
echo "***"
echo ""
cat >/tmp/duk-lowmem.yaml <<EOF
DUK_USE_ROM_OBJECTS: true
DUK_USE_ROM_STRINGS: true
DUK_USE_ROM_GLOBAL_INHERIT: true
DUK_USE_REFCOUNT16: true
DUK_USE_REFCOUNT32: false
DUK_USE_STRHASH16: true
DUK_USE_STRLEN16: true
DUK_USE_BUFLEN16: true
DUK_USE_OBJSIZES16: true
DUK_USE_HSTRING_CLEN: false
DUK_USE_HSTRING_LAZY_CLEN: true # must be lazy when clen field dropped
DUK_USE_HOBJECT_HASH_PART: false
DUK_USE_HEAPPTR16: true
DUK_USE_HEAPPTR_ENC16:
verbatim: "#define DUK_USE_HEAPPTR_ENC16(ud,p) duk_alloc_pool_enc16((p))"
DUK_USE_HEAPPTR_DEC16:
verbatim: "#define DUK_USE_HEAPPTR_DEC16(ud,x) duk_alloc_pool_dec16((x))"
DUK_USE_STRTAB_PTRCOMP: true
EOF
rm -rf /tmp/duk-index-tmp
rm -f /tmp/hello
python2 tools/configure.py \
--rom-support --rom-auto-lightfunc \
--source-directory src-input \
--output-directory /tmp/duk-index-tmp \
--config-metadata config \
--option-file config/examples/low_memory.yaml \
--option-file /tmp/duk-lowmem.yaml \
--fixup-line '#include "duk_alloc_pool.h"'
gcc -o/tmp/hello $ARCHOPT -std=c99 -Wall -Os \
-fomit-frame-pointer -flto \
-fno-asynchronous-unwind-tables \
-ffunction-sections -Wl,--gc-sections \
-fno-stack-protector \
-I/tmp/duk-index-tmp -Iextras/alloc-pool \
-DDUK_ALLOC_POOL_TRACK_HIGHWATER -DDUK_ALLOC_POOL_TRACK_WASTE \
/tmp/duk-index-tmp/duktape.c examples/hello/hello_ptrcomp.c extras/alloc-pool/duk_alloc_pool.c -lm
size /tmp/hello
valgrind --tool=massif --massif-out-file=/tmp/duk-massif.out /tmp/hello
ms_print /tmp/duk-massif.out | head -20

38
website/benchmarks.html

@ -4,6 +4,7 @@
<meta charset="UTF-8">
<title>Duktape benchmarks</title>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="lz-string.js"></script>
<style type="text/css">
html, body {
@ -176,14 +177,24 @@ the right. Graphs implemented using
<div class="duk-graph" id="linux-x64-graph-hello-size"></div>
<div class="duk-graph" id="linux-x86-graph-hello-size"></div>
<div class="duk-graph" id="linux-x32-graph-hello-size"></div>
<div class="duk-graph" id="linux-arm-graph-hello-size"></div>
<div class="duk-graph" id="linux-thumb-graph-hello-size"></div>
<div class="duk-graph" id="linux-x64-gcc-minsize-fltoetc"></div>
<div class="duk-graph" id="linux-x86-gcc-minsize-fltoetc"></div>
<div class="duk-graph" id="linux-x32-gcc-minsize-fltoetc"></div>
<div class="duk-graph" id="linux-arm-gcc-minsize-fltoetc"></div>
<div class="duk-graph" id="linux-thumb-gcc-minsize-fltoetc"></div>
<div class="duk-graph" id="linux-x64-gcc-stripsize-fltoetc"></div>
<div class="duk-graph" id="linux-x86-gcc-stripsize-fltoetc"></div>
<div class="duk-graph" id="linux-x32-gcc-stripsize-fltoetc"></div>
<div class="duk-graph" id="linux-x64-gcc-defsize-makeduk"></div>
<div class="duk-graph" id="linux-arm-gcc-stripsize-fltoetc"></div>
<div class="duk-graph" id="linux-thumb-gcc-stripsize-fltoetc"></div>
<div class="duk-graph" id="linux-x64-gcc-defsize-fltoetc"></div>
<div class="duk-graph" id="linux-x86-gcc-defsize-fltoetc"></div>
<div class="duk-graph" id="linux-x32-gcc-defsize-fltoetc"></div>
<div class="duk-graph" id="linux-arm-gcc-defsize-fltoetc"></div>
<div class="duk-graph" id="linux-thumb-gcc-defsize-fltoetc"></div>
<div class="duk-graph" id="linux-x64-gcc-defsize-makeduk"></div>
<div class="duk-graph" id="codemetrics"></div>
<script>
@ -191,14 +202,24 @@ the right. Graphs implemented using
'linux-x64-graph-hello-size',
'linux-x86-graph-hello-size',
'linux-x32-graph-hello-size',
'linux-arm-graph-hello-size',
'linux-thumb-graph-hello-size',
'linux-x64-gcc-minsize-fltoetc',
'linux-x86-gcc-minsize-fltoetc',
'linux-x32-gcc-minsize-fltoetc',
'linux-arm-gcc-minsize-fltoetc',
'linux-thumb-gcc-minsize-fltoetc',
'linux-x64-gcc-stripsize-fltoetc',
'linux-x86-gcc-stripsize-fltoetc',
'linux-x32-gcc-stripsize-fltoetc',
'linux-x64-gcc-defsize-makeduk',
'linux-x64-gcc-defsize-fltoetc'
'linux-arm-gcc-stripsize-fltoetc',
'linux-thumb-gcc-stripsize-fltoetc',
'linux-x64-gcc-defsize-fltoetc',
'linux-x86-gcc-defsize-fltoetc',
'linux-x32-gcc-defsize-fltoetc',
'linux-arm-gcc-defsize-fltoetc',
'linux-thumb-gcc-defsize-fltoetc',
'linux-x64-gcc-defsize-makeduk'
].forEach(function (context) {
drawGraph({
context: context,
@ -284,6 +305,17 @@ drawGraph({
});
</script>
<script>
// https://www.itsupportguides.com/knowledge-base/tech-tips-tricks/jquery-how-to-automatically-create-heading-anchors-for-links/
$(document).ready(function() {
$("h1, h2, h3, h4, h5, h6").each(function(i) {
var heading = $(this);
var id = heading.text().toLowerCase().trim().replace(/[\.,-\/#!?$%\^&\*;:{}=\-_`~()]/g,"");
heading.attr('id', id);
});
});
</script>
<!--
FUTURE WORK

2
website/buildsite.py

@ -1167,7 +1167,7 @@ def main():
print 'Copying dukweb.js files'
for i in [ '../dukweb.js',
'../jquery-1.11.0.js',
'../jquery-1.11.2.js',
'../dukweb/dukweb.css',
'../dukweb/dukweb.html' ]:
shutil.copyfile(os.path.join('./', i), os.path.join(outdir, os.path.basename(i)))

3
website/download/download.html

@ -49,7 +49,8 @@
<tr><td class="reldate">2017-03-20</td><td class="filename"><a href="duktape-2.0.2.tar.xz">duktape-2.0.2.tar.xz</a></td><td class="description">maintenance release</td><td class="hash">XXX</td></tr>
<tr><td class="reldate">2017-05-04</td><td class="filename"><a href="duktape-2.0.3.tar.xz">duktape-2.0.3.tar.xz</a></td><td class="description">maintenance release (no longer maintained)</td><td class="hash">XXX</td></tr>
<tr><td class="reldate">2017-04-15</td><td class="filename"><a href="duktape-2.1.0.tar.xz">duktape-2.1.0.tar.xz</a></td><td class="description">performance, side effect handling</td><td class="hash">XXX</td></tr>
<tr class="latest"><td class="reldate">2017-07-29</td><td class="filename"><a href="duktape-2.1.1.tar.xz">duktape-2.1.1.tar.xz</a></td><td class="description">maintenance release</td><td class="hash">XXX</td></tr>
<tr><td class="reldate">2017-07-29</td><td class="filename"><a href="duktape-2.1.1.tar.xz">duktape-2.1.1.tar.xz</a></td><td class="description">maintenance release</td><td class="hash">XXX</td></tr>
<tr class="latest"><td class="reldate">2017-09-23</td><td class="filename"><a href="duktape-2.2.0.tar.xz">duktape-2.2.0.tar.xz</a></td><td class="description">call handling, API improvements, performance</td><td class="hash">XXX</td></tr>
</tbody>
</table>

12
website/guide/intro.html

@ -68,7 +68,17 @@ was based on Khronos TypedArray specification:</p>
<p>Node.js Buffer support is based on:</p>
<ul>
<li> <a href="https://nodejs.org/docs/v6.9.1/api/buffer.html">Buffer Node.js v6.9.1</a></li>
<li><a href="https://nodejs.org/docs/v6.9.1/api/buffer.html">Buffer Node.js v6.9.1</a></li>
</ul>
<p>TextEncoder() and TextDecoder() bindings are based on:</p>
<ul>
<li><a href="https://encoding.spec.whatwg.org/#api">Encoding API</a>, WHATWG Encoding Living Standard</li>
</ul>
<p>Performance.now() binding is based on:</p>
<ul>
<li><a href="https://www.w3.org/TR/hr-time/#dom-performance-now">High Resolution Time Level 2</a></li>
</ul>
<h2>Features</h2>

15
website/index/index.html

@ -37,7 +37,7 @@ Duktape API to call Ecmascript functions from C code and vice versa.</p>
<h1>Main features</h1>
<ul>
<li>Embeddable, portable, compact:
can run on platforms with 192kB flash and 64kB system RAM</li>
can run on platforms with 160kB flash and 64kB system RAM</li>
<li><a href="http://www.ecma-international.org/ecma-262/5.1/">Ecmascript E5/E5.1</a>,
with some semantics updated from ES2015+</li>
<li>Partial support for
@ -49,6 +49,7 @@ Duktape API to call Ecmascript functions from C code and vice versa.</p>
<li>ES2015 <a href="https://www.khronos.org/registry/typedarray/specs/latest/">TypedArray</a>
and <a href="https://nodejs.org/docs/v6.9.1/api/buffer.html">Node.js Buffer</a> bindings</li>
<li><a href="https://encoding.spec.whatwg.org/#api">Encoding API</a> bindings based on the WHATWG Encoding Living Standard</li>
<li><a href="https://www.w3.org/TR/hr-time/#dom-performance-now">performance.now()</a></li>
<li>Built-in debugger</li>
<li>Built-in regular expression engine</li>
<li>Built-in Unicode support</li>
@ -64,10 +65,16 @@ Duktape API to call Ecmascript functions from C code and vice versa.</p>
</ul>
<h1>Code and RAM footprint</h1>
<p>For a "Hello world" <a href="https://github.com/svaarala/duktape/blob/master/util/index_page_sizes.sh">example</a>:</p>
<table>
<tr><td>&nbsp;</td><td>x86 default</td><td>x86 lowmem</td><td>x86 full lowmem</td></tr>
<tr><td>Code</td><td>170kB</td><td>150kB</td><td>200kB</td></tr>
<tr><td>Startup RAM</td><td>68kB</td><td>35kB</td><td>2.3kB</td></tr>
<tr><th>Config</th><th>Code footprint (kB)</th><th>Startup RAM (kB)</th></tr>
<tr><td>thumb default</td><td>146</td><td>73</td></tr>
<tr><td>thumb lowmem</td><td>96</td><td>26</td></tr>
<tr><td>thumb full lowmem</td><td>120</td><td>1.5</td></tr>
<tr><td>x86 default</td><td>176</td><td>74</td></tr>
<tr><td>x86 lowmem</td><td>121</td><td>27</td></tr>
<tr><td>x86 full lowmem</td><td>146</td><td>1.5</td></tr>
</table>
<p>See <a href="http://duktape.org/benchmarks.html">Benchmarks</a>.</p>

Loading…
Cancel
Save