Fabcoin Core
0.16.2
P2P Digital Currency
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
src
cpp-ethereum
libevm
VMFactory.cpp
Go to the documentation of this file.
1
/*
2
This file is part of cpp-ethereum.
3
4
cpp-ethereum is free software: you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation, either version 3 of the License, or
7
(at your option) any later version.
8
9
cpp-ethereum is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
13
14
You should have received a copy of the GNU General Public License
15
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#include "
VMFactory.h
"
19
#include <
libdevcore/Assertions.h
>
20
#include "
VM.h
"
21
22
#if ETH_EVMJIT
23
#include "
JitVM.h
"
24
#include "
SmartVM.h
"
25
#endif
26
27
namespace
dev
28
{
29
namespace
eth
30
{
31
namespace
32
{
33
auto
g_kind =
VMKind::Interpreter
;
34
}
35
36
void
VMFactory::setKind
(
VMKind
_kind)
37
{
38
g_kind = _kind;
39
}
40
41
std::unique_ptr<VMFace>
VMFactory::create
()
42
{
43
return
create
(g_kind);
44
}
45
46
std::unique_ptr<VMFace>
VMFactory::create
(
VMKind
_kind)
47
{
48
#if ETH_EVMJIT
49
switch
(_kind)
50
{
51
default
:
52
case
VMKind::Interpreter
:
53
return
std::unique_ptr<VMFace>(
new
VM
);
54
case
VMKind::JIT
:
55
return
std::unique_ptr<VMFace>(
new
JitVM
);
56
case
VMKind::Smart
:
57
return
std::unique_ptr<VMFace>(
new
SmartVM
);
58
}
59
#else
60
asserts
(_kind ==
VMKind::Interpreter
&&
"JIT disabled in build configuration"
);
61
return
std::unique_ptr<VMFace>(
new
VM
);
62
#endif
63
}
64
65
}
66
}
dev
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
Definition:
Arith256.cpp:15
dev::eth::VMKind::Smart
dev::eth::VMKind::JIT
dev::eth::JitVM
Definition:
JitVM.h:11
asserts
#define asserts(A)
Definition:
Assertions.h:41
dev::eth::VMKind::Interpreter
dev::eth::VMFactory::setKind
static void setKind(VMKind _kind)
Set global VM kind.
Definition:
VMFactory.cpp:36
dev::eth::VMFactory::create
static std::unique_ptr< VMFace > create()
Creates a VM instance of global kind (controlled by setKind() function).
Definition:
VMFactory.cpp:41
JitVM.h
dev::eth::SmartVM
Smart VM proxy.
Definition:
SmartVM.h:31
VM.h
VMFactory.h
dev::eth::VMKind
VMKind
Definition:
VMFactory.h:26
SmartVM.h
Assertions.h
dev::eth::VM
Definition:
VM.h:60
Generated on Mon Oct 22 2018 15:15:28 for Fabcoin Core by
1.8.11