From 593a896ad2f532e28d26d856bebcf3171da2ff39 Mon Sep 17 00:00:00 2001 From: qiuyu Date: Thu, 3 Mar 2022 11:34:33 +0800 Subject: [PATCH] add ecma bytecode optimizer test Signed-off-by: qiuyu --- .../test_bytecode_optimizer_for_js.js | 3 ++ .../test_bytecode_optimizer_for_js.txt | 35 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100755 test_ecma_bcopt/test_bytecode_optimizer_for_js.js create mode 100755 test_ecma_bcopt/test_bytecode_optimizer_for_js.txt diff --git a/test_ecma_bcopt/test_bytecode_optimizer_for_js.js b/test_ecma_bcopt/test_bytecode_optimizer_for_js.js new file mode 100755 index 0000000000..b09c563761 --- /dev/null +++ b/test_ecma_bcopt/test_bytecode_optimizer_for_js.js @@ -0,0 +1,3 @@ +let a = [1]; +a[0] = 2; + diff --git a/test_ecma_bcopt/test_bytecode_optimizer_for_js.txt b/test_ecma_bcopt/test_bytecode_optimizer_for_js.txt new file mode 100755 index 0000000000..68a79ec1e8 --- /dev/null +++ b/test_ecma_bcopt/test_bytecode_optimizer_for_js.txt @@ -0,0 +1,35 @@ +# +# source binary: test_bytecode_optimizer_for_js.abc +# + +.language ECMAScript + +# ==================== +# LITERALS + + +# ==================== +# RECORDS + +.record _ESTypeAnnotation + +.record _ESModuleMode { + u8 isModule +} + +.record _ESCallTypeAnnotation + +# ==================== +# METHODS + +.function any func_main_0_any_any_any_any_(any a0, any a1, any a2) { + ecma.ldlexenvdyn + ecma.createarraywithbuffer 0x0 + ecma.stlettoglobalrecord "a" + ecma.tryldglobalbyname "a" + sta.dyn v0 + ldai.dyn 0x2 + ecma.stobjbyindex v0, 0x0 + ecma.returnundefined +} + -- Gitee