Get Fabrice Bellard's JavaScript engine to build

$ m=tiny
$ make -j12 MODE=$m o/$m/third_party/quickjs/qjs.com
$ o/$m/third_party/quickjs/qjs.com -e 'console.log(2 + 2)'
4
$ ls -hal o/$m/third_party/quickjs/qjs.com
631.5K

See #97
This commit is contained in:
Justine Tunney 2021-04-09 01:06:57 -07:00
parent 1fbfbb3192
commit 8f52c0d773
73 changed files with 954 additions and 1299 deletions

View file

@ -1,6 +1,6 @@
/*
* Tiny arbitrary precision floating point library
*
*
* Copyright (c) 2017-2021 Fabrice Bellard
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
@ -21,19 +21,25 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include <math.h>
#include <string.h>
#include <assert.h>
#include "libc/assert.h"
#include "libc/inttypes.h"
#include "libc/stdio/stdio.h"
#include "libc/str/str.h"
#include "third_party/quickjs/cutils.h"
#include "third_party/quickjs/libbf.h"
asm(".ident\t\"\\n\\n\
QuickJS (MIT License)\\n\
Copyright (c) 2017-2021 Fabrice Bellard\\n\
Copyright (c) 2017-2021 Charlie Gordon\"");
asm(".include \"libc/disclaimer.inc\"");
/* TODO(jart): let's use asm() instead of intel's strange and unusual veneer */
#ifdef __AVX2__
#include <immintrin.h>
#undef __AVX2__
#endif
#include "cutils.h"
#include "libbf.h"
/* clang-format off */
/* enable it to check the multiplication result */
//#define USE_MUL_CHECK