File tree 6 files changed +19
-6
lines changed
6 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 1
- cmake_minimum_required (VERSION 3.28.1 )
1
+ cmake_minimum_required (VERSION 3.13 )
2
2
3
3
project (jvm)
4
4
@@ -7,6 +7,12 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
7
7
8
8
if (MSVC )
9
9
add_compile_options (/utf-8)
10
+ if (VCPKG_TARGET_TRIPLET STREQUAL "x64-windows-static" )
11
+ set (CMAKE_CXX_FLAGS_DEBUG /MTd)
12
+ set (CMAKE_CXX_FLAGS_MINSIZEREL /MT)
13
+ set (CMAKE_CXX_FLAGS_RELEASE /MT)
14
+ set (CMAKE_CXX_FLAGS_RELWITHDEBUGINFO /MT)
15
+ endif ()
10
16
endif ()
11
17
12
18
include_directories (src)
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ namespace jvm {
61
61
tag = float_info;
62
62
}
63
63
64
- float_t bytes{};
64
+ float bytes{};
65
65
};
66
66
67
67
struct ConstantInfo_Long final : ConstantInfo {
@@ -77,7 +77,7 @@ namespace jvm {
77
77
tag = double_info;
78
78
}
79
79
80
- double_t bytes{};
80
+ double bytes{};
81
81
};
82
82
83
83
struct ConstantInfo_Class final : ConstantInfo {
Original file line number Diff line number Diff line change 5
5
#include < sese/util/Endian.h>
6
6
#include < sese/util/Exception.h>
7
7
8
+ #include < cmath>
9
+
8
10
void jvm::Runtime::regClass (const std::shared_ptr<Class> &class_) {
9
11
classes[class_->getThisName ()] = class_;
10
12
if (main.class_ == nullptr ) {
Original file line number Diff line number Diff line change @@ -30,10 +30,12 @@ namespace jvm {
30
30
31
31
void run (Info &prev, Info ¤t);
32
32
33
- static struct MethodRefResult {
33
+
34
+ struct MethodRefResult {
34
35
std::string class_name;
35
36
std::string method_id;
36
- } getMethodRefResult(const std::shared_ptr<Class> &class_, uint16_t index);
37
+ };
38
+ static MethodRefResult getMethodRefResult (const std::shared_ptr<Class> &class_, uint16_t index);
37
39
38
40
39
41
std::unordered_map<std::string, std::shared_ptr<Class> > classes;
Original file line number Diff line number Diff line change 4
4
#include < sese/text/StringBuilder.h>
5
5
6
6
#include < cassert>
7
+ #include < algorithm>
7
8
8
9
void jvm::TypeInfo::parse (std::string raw_name) {
9
10
assert (!raw_name.empty ());
10
11
// 计算 raw_name 中 [ 的个数
11
- is_array = std::count (raw_name.begin (), raw_name.end (), ' [' );
12
+ is_array = static_cast < uint8_t >( std::count (raw_name.begin (), raw_name.end (), ' [' ) );
12
13
if (is_array) {
13
14
raw_name = raw_name.substr (is_array, raw_name.length () - is_array);
14
15
}
Original file line number Diff line number Diff line change 1
1
#pragma once
2
2
3
3
#include < string>
4
+ #include < cstdint>
5
+
4
6
5
7
namespace jvm {
6
8
enum Type : char {
You can’t perform that action at this time.
0 commit comments