Skip to content

Commit

Permalink
Update jerryscript to master
Browse files Browse the repository at this point in the history
  • Loading branch information
mikee47 committed Nov 30, 2021
1 parent 90d025d commit 441da97
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ emscripten_snapshot_compiler_compile (const jerry_char_t *source_p, jerry_size_t
// No errors, let's create the snapshot:
uint32_t generate_snapshot_opts = 0;
(void)is_for_global;
jerry_value_t generate_result = jerry_generate_snapshot (source_p, source_size, NULL, generate_snapshot_opts,
jerry_value_t generate_result = jerry_generate_snapshot (rv, generate_snapshot_opts,
buffer_p, buffer_size);

size_t snapshot_size = (size_t) jerry_get_number_value (generate_result);
Expand Down
2 changes: 1 addition & 1 deletion jerryscript
Submodule jerryscript updated 695 files
63 changes: 59 additions & 4 deletions jerryscript.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,67 @@
diff --git a/jerry-core/parser/js/js-parser.c b/jerry-core/parser/js/js-parser.c
index 88347f8e..05629a10 100644
index b55baed5..bd6b41da 100644
--- a/jerry-core/parser/js/js-parser.c
+++ b/jerry-core/parser/js/js-parser.c
@@ -2900,7 +2900,6 @@ parser_parse_script (const uint8_t *arg_list_p, /**< function argument list */
@@ -3356,12 +3356,9 @@ parser_parse_script (void *source_p, /**< source code */

return bytecode_p;
#else /* !JERRY_PARSER */
- JERRY_UNUSED (arg_list_p);
- JERRY_UNUSED (arg_list_size);
JERRY_UNUSED (source_p);
JERRY_UNUSED (source_size);
- JERRY_UNUSED (source_size);
JERRY_UNUSED (parse_opts);
- JERRY_UNUSED (resource_name);
+ JERRY_UNUSED (options_p);

ecma_raise_syntax_error (ECMA_ERR_MSG ("Source code parsing is disabled"));
ecma_raise_syntax_error (ECMA_ERR_PARSER_NOT_SUPPORTED);
return NULL;
diff --git a/jerry-core/ecma/operations/ecma-eval.c b/jerry-core/ecma/operations/ecma-eval.c
index e4a2d734..cd544844 100644
--- a/jerry-core/ecma/operations/ecma-eval.c
+++ b/jerry-core/ecma/operations/ecma-eval.c
@@ -94,8 +94,7 @@ ecma_op_eval_chars_buffer (void *source_p, /**< source code */

return vm_run_eval (bytecode_p, parse_opts);
#else /* !JERRY_PARSER */
- JERRY_UNUSED (code_p);
- JERRY_UNUSED (code_buffer_size);
+ JERRY_UNUSED (source_p);
JERRY_UNUSED (parse_opts);

return ecma_raise_syntax_error (ECMA_ERR_PARSER_NOT_SUPPORTED);
diff --git a/jerry-core/ecma/base/ecma-helpers.c b/jerry-core/ecma/base/ecma-helpers.c
index bd25d9d3..cce169bb 100644
--- a/jerry-core/ecma/base/ecma-helpers.c
+++ b/jerry-core/ecma/base/ecma-helpers.c
@@ -1626,11 +1626,13 @@ ecma_script_get_from_value (ecma_value_t value) /**< compiled code */
{
ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;

+#if JERRY_PARSER
if (ext_object_p->u.cls.type == ECMA_OBJECT_CLASS_SCRIPT)
{
bytecode_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_compiled_code_t, ext_object_p->u.cls.u3.value);
break;
}
+#endif

#if JERRY_MODULE_SYSTEM
if (ext_object_p->u.cls.type == ECMA_OBJECT_CLASS_MODULE)
diff --git a/jerry-core/api/jerryscript.c b/jerry-core/api/jerryscript.c
index 13e3fd65..32444cd6 100644
--- a/jerry-core/api/jerryscript.c
+++ b/jerry-core/api/jerryscript.c
@@ -564,10 +564,12 @@ jerry_run (const jerry_value_t func_val) /**< function to run */

ecma_object_t *object_p = ecma_get_object_from_value (func_val);

+#if JERRY_PARSER
if (!ecma_object_class_is (object_p, ECMA_OBJECT_CLASS_SCRIPT))
{
return jerry_throw (ecma_raise_type_error (ECMA_ERR_WRONG_ARGS_MSG));
}
+#endif

ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;

22 changes: 11 additions & 11 deletions jsc/es.next/jsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1206,10 +1206,10 @@ var tempDouble;
var tempI64;

var ASM_CONSTS = {
53736: function() {
58568: function() {
throw new Error("Input must be valid UTF-8");
},
53787: function($0) {
58619: function($0) {
throw new Error(UTF8ToString($0));
}
};
Expand Down Expand Up @@ -1515,11 +1515,11 @@ var asmLibraryArg = {
"invoke_iii": invoke_iii,
"invoke_iiii": invoke_iiii,
"invoke_iiiii": invoke_iiiii,
"invoke_iiiiii": invoke_iiiiii,
"invoke_vi": invoke_vi,
"invoke_vii": invoke_vii,
"invoke_viii": invoke_viii,
"invoke_viiii": invoke_viiii,
"invoke_viiiii": invoke_viiiii,
"proc_exit": _proc_exit,
"segfault": segfault,
"setTempRet0": _setTempRet0
Expand Down Expand Up @@ -1595,32 +1595,32 @@ var _emscripten_get_sbrk_ptr = Module["_emscripten_get_sbrk_ptr"] = function() {
return (_emscripten_get_sbrk_ptr = Module["_emscripten_get_sbrk_ptr"] = Module["asm"]["emscripten_get_sbrk_ptr"]).apply(null, arguments);
};

function invoke_vi(index, a1) {
function invoke_ii(index, a1) {
var sp = stackSave();
try {
getWasmTableEntry(index)(a1);
return getWasmTableEntry(index)(a1);
} catch (e) {
stackRestore(sp);
if (e !== e + 0 && e !== "longjmp") throw e;
_setThrew(1, 0);
}
}

function invoke_ii(index, a1) {
function invoke_iiiiii(index, a1, a2, a3, a4, a5) {
var sp = stackSave();
try {
return getWasmTableEntry(index)(a1);
return getWasmTableEntry(index)(a1, a2, a3, a4, a5);
} catch (e) {
stackRestore(sp);
if (e !== e + 0 && e !== "longjmp") throw e;
_setThrew(1, 0);
}
}

function invoke_iii(index, a1, a2) {
function invoke_vi(index, a1) {
var sp = stackSave();
try {
return getWasmTableEntry(index)(a1, a2);
getWasmTableEntry(index)(a1);
} catch (e) {
stackRestore(sp);
if (e !== e + 0 && e !== "longjmp") throw e;
Expand All @@ -1639,10 +1639,10 @@ function invoke_viii(index, a1, a2, a3) {
}
}

function invoke_viiiii(index, a1, a2, a3, a4, a5) {
function invoke_iii(index, a1, a2) {
var sp = stackSave();
try {
getWasmTableEntry(index)(a1, a2, a3, a4, a5);
return getWasmTableEntry(index)(a1, a2);
} catch (e) {
stackRestore(sp);
if (e !== e + 0 && e !== "longjmp") throw e;
Expand Down
Binary file modified jsc/es.next/jsc.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion jsc/es.next/jsc.wasm.map

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions jsc/minimal/jsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1206,10 +1206,10 @@ var tempDouble;
var tempI64;

var ASM_CONSTS = {
11372: function() {
12292: function() {
throw new Error("Input must be valid UTF-8");
},
11423: function($0) {
12343: function($0) {
throw new Error(UTF8ToString($0));
}
};
Expand Down Expand Up @@ -1394,10 +1394,10 @@ var asmLibraryArg = {
"invoke_iii": invoke_iii,
"invoke_iiii": invoke_iiii,
"invoke_iiiii": invoke_iiiii,
"invoke_iiiiii": invoke_iiiiii,
"invoke_vi": invoke_vi,
"invoke_vii": invoke_vii,
"invoke_viii": invoke_viii,
"invoke_viiiii": invoke_viiiii,
"proc_exit": _proc_exit,
"segfault": segfault,
"setTempRet0": _setTempRet0
Expand Down Expand Up @@ -1473,32 +1473,32 @@ var _emscripten_get_sbrk_ptr = Module["_emscripten_get_sbrk_ptr"] = function() {
return (_emscripten_get_sbrk_ptr = Module["_emscripten_get_sbrk_ptr"] = Module["asm"]["emscripten_get_sbrk_ptr"]).apply(null, arguments);
};

function invoke_vi(index, a1) {
function invoke_ii(index, a1) {
var sp = stackSave();
try {
getWasmTableEntry(index)(a1);
return getWasmTableEntry(index)(a1);
} catch (e) {
stackRestore(sp);
if (e !== e + 0 && e !== "longjmp") throw e;
_setThrew(1, 0);
}
}

function invoke_ii(index, a1) {
function invoke_iiiiii(index, a1, a2, a3, a4, a5) {
var sp = stackSave();
try {
return getWasmTableEntry(index)(a1);
return getWasmTableEntry(index)(a1, a2, a3, a4, a5);
} catch (e) {
stackRestore(sp);
if (e !== e + 0 && e !== "longjmp") throw e;
_setThrew(1, 0);
}
}

function invoke_iii(index, a1, a2) {
function invoke_vi(index, a1) {
var sp = stackSave();
try {
return getWasmTableEntry(index)(a1, a2);
getWasmTableEntry(index)(a1);
} catch (e) {
stackRestore(sp);
if (e !== e + 0 && e !== "longjmp") throw e;
Expand All @@ -1517,10 +1517,10 @@ function invoke_viii(index, a1, a2, a3) {
}
}

function invoke_viiiii(index, a1, a2, a3, a4, a5) {
function invoke_iii(index, a1, a2) {
var sp = stackSave();
try {
getWasmTableEntry(index)(a1, a2, a3, a4, a5);
return getWasmTableEntry(index)(a1, a2);
} catch (e) {
stackRestore(sp);
if (e !== e + 0 && e !== "longjmp") throw e;
Expand Down
Binary file modified jsc/minimal/jsc.wasm
Binary file not shown.
Loading

0 comments on commit 441da97

Please sign in to comment.