From e08076da01c66183b2ba2cd8bd5ceea7c0cf5756 Mon Sep 17 00:00:00 2001 From: Yusuke Suzuki Date: 2013年12月20日 03:46:53 +0900 Subject: [PATCH] Add vm.x64.S --- CMakeLists.txt | 2 ++ iv/lv5/CMakeLists.txt | 15 ++++++++++++++- iv/lv5/accelerator/accelerator.h | 16 ++++++++++++++++ iv/lv5/accelerator/fwd.h | 8 -------- iv/lv5/accelerator/vm.x64.S | 11 +++++++++++ 5 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 iv/lv5/accelerator/accelerator.h delete mode 100644 iv/lv5/accelerator/fwd.h create mode 100644 iv/lv5/accelerator/vm.x64.S diff --git a/CMakeLists.txt b/CMakeLists.txt index 98c2f794..4e1c4d66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,5 +102,7 @@ macro(setup_compiler_definitions) endif() endmacro() +OPTION(accelerator "enable accelerator low level interpreter." OFF) + add_subdirectory(iv/lv5) add_subdirectory(test) diff --git a/iv/lv5/CMakeLists.txt b/iv/lv5/CMakeLists.txt index ec60af99..37e4d9c4 100644 --- a/iv/lv5/CMakeLists.txt +++ b/iv/lv5/CMakeLists.txt @@ -1,5 +1,7 @@ # liblv5 & lv5 +enable_language(ASM) + # prelude set(CMAKE_OSX_ARCHITECTURES "x86_64") add_subdirectory(third_party/gc) @@ -27,7 +29,16 @@ endif() # liblv5 -add_library(liblv5 STATIC +set(ACCELERATOR_SOURCE) + +if (accelerator) + set(ACCELERATOR_SOURCE + accelerator/vm.x64.S + ) +endif() + +set(LIBLV5_SOURCE + ${ACCELERATOR_SOURCE} context.cc global_symbols.cc runtime/array.cc @@ -57,6 +68,8 @@ add_library(liblv5 STATIC radio/block_control.cc radio/core.cc ) + +add_library(liblv5 STATIC ${LIBLV5_SOURCE}) set_target_properties(liblv5 PROPERTIES PREFIX "") target_link_libraries(liblv5 netlib_dtoa v8_dtoa) diff --git a/iv/lv5/accelerator/accelerator.h b/iv/lv5/accelerator/accelerator.h new file mode 100644 index 00000000..6374f994 --- /dev/null +++ b/iv/lv5/accelerator/accelerator.h @@ -0,0 +1,16 @@ +#ifndef IV_LV5_ACCELERATOR_H_ +#define IV_LV5_ACCELERATOR_H_ + +// exported by vm.S +void IvLv5AcceleratorMain(); + +namespace iv { +namespace lv5 { +namespace accelerator { + +inline void Run() { + IvLv5AcceleratorMain(); +} + +} } } // namespace iv::lv5::accelerator +#endif // IV_LV5_ACCELERATOR_H_ diff --git a/iv/lv5/accelerator/fwd.h b/iv/lv5/accelerator/fwd.h deleted file mode 100644 index f8d30222..00000000 --- a/iv/lv5/accelerator/fwd.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef IV_LV5_ACCELERATOR_FWD_H_ -#define IV_LV5_ACCELERATOR_FWD_H_ -namespace iv { -namespace lv5 { -namespace accelerator { - -} } } // namespace iv::lv5::accelerator -#endif // IV_LV5_ACCELERATOR_FWD_H_ diff --git a/iv/lv5/accelerator/vm.x64.S b/iv/lv5/accelerator/vm.x64.S new file mode 100644 index 00000000..998f0c03 --- /dev/null +++ b/iv/lv5/accelerator/vm.x64.S @@ -0,0 +1,11 @@ +.text +.align 16 +main: + ret + +.align 16 +.global IvLv5AcceleratorMain +IvLv5AcceleratorMain: + ret + +/* vim: set ft=gas sw=2 ts=2 et tw=80 : */

AltStyle によって変換されたページ (->オリジナル) /