mirror of https://github.com/svaarala/duktape.git
Tree:
7b3c5593e6
add-comment-stripped-dist-source
add-config-profiles
add-function-source-property
add-getownpropertydescriptor-proxy-trap
add-memory-commit-test
add-nonbmp-helpers
api-create-heap-reorder
api-fileline-blame-control
api-get-refcount
api-multi-get
api-new-list-inits
api-push-bufobj-accept-bufobj
api-recheck-builtins
api-set-prototype-accept-null
buffer-index-no-inherit
builtin-construct-only
cpp-exception-improvements
cyclic-jx-gh331
debugger-rework-resume-command
document-snprintf-portability
duk-push-boolean-retval-1
external-bytecode-buffer-initial
footprint-equals-helper
global-object-hash-index
hack-outofmemory-envrec-close
hack-refzero-finalizer-postpone
hide-internal-properties
improve-summarization
lose-const-via-union
master
mingw-setjmp-longjmp-improvement
operator-overloading-minimal
osx-dist-improve-docs
perf-func-self-ref
profile-optimization-training-set
property-caching
proxy-chain-support
remove-extended-utf8-support
remove-unused-object-layout
revert-841-fix-node-loader
runtest-improvements
string-intern-copy-remove
switch-x86-x64-align-default
user-stack-check-macro
v1-maintenance
v1.0-maintenance
v1.1-maintenance
v1.2-maintenance
v1.3-maintenance
v1.4-maintenance
v1.5-maintenance
v1.6-maintenance
v1.7-maintenance
v1.8-maintenance
v2-maintenance
v2.0-maintenance
v2.1-maintenance
v2.2-maintenance
v2.3-maintenance
v2.4-maintenance
v2.5-maintenance
v2.6-maintenance
virtual-prototype-property
weak-references
website-benchmarks-page
add-rom-builtin-support-20160125i
convert-makedist-to-python-20160113
debugger-heap-walking-support-20160303a
fix-debugger-reattach-reentry-20160219a
hstring-size-optimization-20160302b
rom-user-builtins-20160203b
v0.1.0
v0.10.0
v0.11.0
v0.12.0
v0.2.0
v0.3.0
v0.4.0
v0.5.0
v0.6.0
v0.7.0
v0.8.0
v0.9.0
v1.0.0
v1.0.1
v1.0.2
v1.1.0
v1.1.1
v1.1.2
v1.1.3
v1.2.0
v1.2.1
v1.2.2
v1.2.3
v1.2.4
v1.2.5
v1.2.6
v1.3.0
v1.3.1
v1.3.2
v1.3.3
v1.4.0
v1.4.1
v1.4.2
v1.5.0
v1.5.1
v1.5.2
v1.6.0
v1.6.1
v1.7.0
v1.8.0
v2.0.0
v2.0.1
v2.0.2
v2.0.3
v2.1.0
v2.1.1
v2.1.2
v2.2.0
v2.2.1
v2.3.0
v2.4.0
v2.5.0
v2.6.0
v2.7.0
${ noResults }
4 Commits (7b3c5593e6b0f061505289aa4bf8837c2dad253e)
Author | SHA1 | Message | Date |
---|---|---|---|
Sami Vaarala | fef0870107 |
First round of lightfunc changes
A lot of changes to add preliminary lightfunc support: * Add LIGHTFUNC tagged type to duk_tval.h and API. * Internal changes for preliminary to support lightfuncs in call handling and other operations (FIXMEs left in obvious places where support is still missing after this commit) * Preliminary Ecmascript and API testcases for lightfuncs Detailed notes: * Because magic is signed, reading it back involves sign extension which is quite verbose to do in C. Use macros for reading the magic value and other bit fields encoded in the flags. * Function.prototype.bind(): the 'length' property of a bound function now comes out wrong. We could simply look up the virtual 'length' property even if h_target is NULL: no extra code and binding is relatively rare in hot paths. Rewrite more cleanly in any case. * The use flag DUK_USE_LIGHTFUNC_BUILTINS controls the forced lightfunc conversion of built-ins. This results in non-compliant built-ins but significant memory savings in very memory poor environments. * Reject eval(), Thread.yield/resume as lightfuncs. These functions have current assertions that they must be called as fully fledged functions. * Lightfuncs are serialized like ordinary functions for JSON, JX, and JC by this diff. * Add 'magic' to activation for lightfuncs. It will be needed for lightweight functions: we don't have the duk_tval related to the lightfunc, so we must copy the magic value to the activation when a call is made. * When lightfuncs are used as property lookup base values, continue property lookup from the Function.prototype object. This is necessary to allow e.g. ``func.call()`` and ``func.apply()`` to be used. * Call handling had to be reworked for lightfuncs, especially how bound function chains are handled. This is a relatively large change but is necessary to support lightweight functions properly in bound function resolution. The current solution is not ideal. The bytecode executor will first try an ecma-to-ecma call setup which resolves the bound function chain first. If the final, unbound function is not viable (a native function) the call setup returns with an error code. The caller will then perform a normal call. Although bound function resolution has already been done, the normal call handling code will re-do it (and detect there is nothing to do). This situation could be avoided by decoupling bound function handling and effective this binding computation from the actual call setup. The caller could then to do this prestep first, and only then decide whether to use an ecma-to-ecma call or an ordinary heavyweight call. Remove duk__find_nonbound_function as unused. * Use indirect magic to allow LIGHTFUNCs for Date. Most of the built-in functions not directly eligible as lightfuncs are the Date built-in methods, whose magic values contain too much information to fit into the 8-bit magic of a LIGHTFUNC value. To work around this, add an array (duk__date_magics[]) containing the actual control flags needed by the built-ins, and make the Date built-in magic value an index into this table. With this change Date built-ins are successfully converted to lightfuncs. Testcase fixes: - Whitespace fixes - Print error for indirect eval error to make diagnosis easier - Fix error string to match errmsg updated in this branch |
11 years ago |
Sami Vaarala | 54e3c71227 |
Add a guide related magic test to API testcases
|
10 years ago |
Sami Vaarala | aedfa691a8 |
Add error cases to magic API testcase
|
10 years ago |
Sami Vaarala | 8c9ef37e33 |
API testcase for duk_{get,set}_magic()
|
10 years ago |