Change function .arguments and .caller behavior to be in line with the
latest specification:
* No own .arguments or .caller property for Function instances. V8 provides
non-strict functions with null .caller and .arguments properties (but they
are not required by the specification).
* Inherit .arguments and .caller thrower from Function.prototype.
Also change %ThrowTypeError%.name to the empty string to match V8.
* Add DUK_F_DJGPP.h.in to detect and provide DJGPP convenience defines.
* Add a separate platform for MSDOS, now supporting DJGPP only.
* Add DJGPP identification to compiler_gcc.h.in.
Fix a realloc() memory leak which would happen when:
- a previous allocation exists ('ptr' is non-NULL); and
- the new 'size' is zero; and
- a voluntary GC (or GC torture) causes the initial realloc() attempt
to be bypassed
In this case the slow path would incorrectly assume that it was entered
after realloc() had returned a NULL, which for a zero new 'size' would
mean that 'ptr' was successfully freed and no further action was necessary.
But because the realloc() had actually been bypassed, this would cause the
old 'ptr' to leak.
Restructure string intern check:
- Compute string hash and perform strtable lookup; if found, it
must already be a valid Symbol or valid WTF-8 data so no WTF-8
sanitization steps are needed. Return found string.
- Otherwise perform a "keepcheck" to see if the candidate string
can be used as is (i.e. it is valid Symbol or valid WTF-8).
If so, we know it's not in the strtable so intern the string.
- Otherwise the string needs WTF-8 sanitization. After sanitizing,
rehash the sanitized data, perform another strtable lookup and
return existing string or intern the sanitized string.
This speeds up string intern processing for (1) strings already in
the string table and (2) valid WTF-8 strings which should be the
vast majority of strings interned. Only strings that are invalid
WTF-8, i.e. contain uncombined surrogate pairs or outright data,
will need sanitization.
Other minor changes:
- Add some WTF-8 documentation to tentative 3.0 release notes.
- Add a 3.0 release entry.
* Remove lazy charlen support. Since we need to WTF-8 sanitize the entire
input string, charlen can be computed while validating (avoiding extra
book-keeping for ASCII eventually).
* Improve WTF-8 search forwards/backwards performance (no substring operations)
when the search string is valid UTF-8. Use reference implementation for
non-UTF-8 still, to be optimized later.
* Minor testcase improvements.