mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
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:
parent
1fbfbb3192
commit
8f52c0d773
73 changed files with 954 additions and 1299 deletions
26
third_party/quickjs/libbf.c
vendored
26
third_party/quickjs/libbf.c
vendored
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue