Repository navigation
Conversation
…and appends to fast arrays JS_DefinePropertyValue() adds a data property of an ordinary extensible object directly instead of going through JS_DefineProperty(). The Int64/Uint32 variants append at the end of a fast array without converting the index to an atom.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
four small fast paths, one commit each, so any of them can be taken alone.
& | ^ << >> >>>drop to js_binary_logic_slow / js_shr_slow as soon as an operand is not int32, for example after>>> 0, then run ToNumeric and ToInt32 twice. for int or float64 operands the conversion has no side effects, so it is done directly..lengthon a string primitive is returned directly, and other names walk String.prototype with the existing inline loop. method lookups on arrays (push,pop, ...) now go through the inline path instead of the slow one, which is the XXX next to it.callgrind on master 712e8c0, gcc, aarch64, each commit measured alone on small scripts that stress its path:
no slowdown on the rest i checked (plain calls, arguments, global writes, Map, JSON, typed arrays): every commit stays within 0.3% of master there.
make testpasses, also with CONFIG_ASAN=y. output is identical to master on 625 pairs of edge values (0, -0, ±1, ±0.5, 2^31, 2^32, ±2^53, ±1e300, NaN, ±Infinity, 5e-324, ...) for 12 operators, plus string and array cases, and on object literals, class fields, frozen/sealed/proxy targets, read-only array length and array-method species cases for commit 4.