@@ -193,10 +193,9 @@ ES5 extensions:
193193### Engine initialization
194194
195195MQuickJS has almost no dependency on the C library. In particular it
196- does not use ` malloc() ` , ` free() ` nor ` printf() ` and relies on its own
197- mathematical library. When creating a MQuickJS context, a memory
198- buffer must be provided. The engine only allocates memory in this
199- buffer:
196+ does not use ` malloc() ` , ` free() ` nor ` printf() ` . When creating a
197+ MQuickJS context, a memory buffer must be provided. The engine only
198+ allocates memory in this buffer:
200199
201200 JSContext *ctx;
202201 uint8_t mem_buf[8192];
@@ -274,6 +273,13 @@ As with QuickJS, no backward compatibility is garanteed at the
274273bytecode level. Moreover, the bytecode is not verified before being
275274executed. Only run Javascript bytecode from trusted sources.
276275
276+ ### Mathematical library and floating point emulation
277+
278+ MQuickJS contains its own tiny mathematical library (in
279+ ` libm.c ` ). Moreover, in case the CPU has no floating point support, it
280+ contains its own floating point emulator which may be smaller than the
281+ one provided with the GCC toolchain.
282+
277283## Internals and comparison with QuickJS
278284
279285### Garbage collection
@@ -295,15 +301,16 @@ CPU). A value may contain:
295301
296302 - a single unicode codepoint (hence a string of one or two 16 bit code units)
297303
298- - a 64 bit floating point numbers with a small exponent with 64 bit CPU words
304+ - a 64 bit floating point number with a small exponent with 64 bit CPU words
299305
300306 - a pointer to a memory block. Memory blocks have a tag stored in
301307 memory.
302308
303309Javascript objects requires at least 3 CPU words (hence 12 bytes on a
30431032 bit CPU). Additional data may be allocated depending on the object
305- class. The properties are stored in a hash table. Properties may
306- reside in ROM for standard library objects.
311+ class. The properties are stored in a hash table. Each property
312+ requires at least 3 CPU words. Properties may reside in ROM for
313+ standard library objects.
307314
308315Property keys are JSValues unlike QuickJS where they have a specific
309316type. They are either a string or a positive 31 bit integer. String
@@ -354,7 +361,7 @@ make microbench
354361
355362Addtional tests and a patched version of the Octane benchmark running
356363in stricter mode can be downloaded
357- [ Here ] ( https://bellard.org/mquickjs/mquickjs-extras.tar.xz ) :
364+ [ here ] ( https://bellard.org/mquickjs/mquickjs-extras.tar.xz ) :
358365
359366Running the V8 octane benchmark:
360367``
0 commit comments