Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 117 lines (91 sloc) 2.482 kb
feb91b4 Tons of stuff (too much probably)
Evan Phoenix authored
1 #ifndef RBX_ENVIRONMENT_HPP
2 #define RBX_ENVIRONMENT_HPP
3
4 #include <string>
5 #include <stdexcept>
6
43c1c3c One more cycle broken
Ryan Davis authored
7 #include "vm.hpp"
37dc489 Add real Configuration infrastructure
Evan Phoenix authored
8 #include "config_parser.hpp"
9 #include "configuration.hpp"
43c1c3c One more cycle broken
Ryan Davis authored
10
feb91b4 Tons of stuff (too much probably)
Evan Phoenix authored
11 namespace rubinius {
12
37dc489 Add real Configuration infrastructure
Evan Phoenix authored
13 class ConfigParser;
ff881b8 Started query agent, mainly just groundwork thus far
Evan Phoenix authored
14 class QueryAgent;
b388d90 @evanphx Handle signals during shutdown properly
evanphx authored
15 class SignalHandler;
37dc489 Add real Configuration infrastructure
Evan Phoenix authored
16
2749c19 @agardiner Add/update Doxygen class comments for several classes
agardiner authored
17 /**
7862130 @brixen Build Rubinius file system location independent.
brixen authored
18 * Thrown when unable to find Rubinius runtime directories.
19 */
20 class MissingRuntime : public std::runtime_error {
21 public:
22 MissingRuntime(const std::string& str)
23 : std::runtime_error(str)
24 {}
25 };
26
27 /**
2749c19 @agardiner Add/update Doxygen class comments for several classes
agardiner authored
28 * Thrown when there is a bad signature on a kernel .rbc file.
29 */
6fa3dc4 Add compiler signature/version checking
Evan Phoenix authored
30 class BadKernelFile : public std::runtime_error {
31 public:
32 BadKernelFile(const std::string& str)
33 : std::runtime_error(str)
34 {}
35 };
36
2749c19 @agardiner Add/update Doxygen class comments for several classes
agardiner authored
37
38 /**
39 * The environment context under which Rubinius virtual machines are executed.
40 *
41 * Environment and configuration data is processed and stored in an Environment
42 * instance, which uses this information to bootstrap the VM. It also stores
43 * all runtime shared state.
44 */
45
feb91b4 Tons of stuff (too much probably)
Evan Phoenix authored
46 class Environment {
db6659b Refactor Environment/cli.cpp around
Evan Phoenix authored
47 int argc_;
48 char** argv_;
49
3ce0d8a @brixen Fixed Rubinius loading stale runtime.
brixen authored
50 /**
51 * Digest of the runtime and configuration files to keep the runtime
52 * and VM in sync.
53 */
6fa3dc4 Add compiler signature/version checking
Evan Phoenix authored
54 uint64_t signature_;
55
b8b06c3 @brixen Added language version tagging to .rbc files.
brixen authored
56 // The Ruby library version with which the .rbc file is compatible.
57 int version_;
58
b388d90 @evanphx Handle signals during shutdown properly
evanphx authored
59 SignalHandler* sig_handler_;
60
7862130 @brixen Build Rubinius file system location independent.
brixen authored
61 std::string system_prefix_;
62
feb91b4 Tons of stuff (too much probably)
Evan Phoenix authored
63 public:
6cfae75 Add VMManager, fix exit to behave well
Evan Phoenix authored
64 SharedState* shared;
35a49f3 @evanphx Introduce State class as STATE
evanphx authored
65 VM* root_vm;
66 State* state;
feb91b4 Tons of stuff (too much probably)
Evan Phoenix authored
67
37dc489 Add real Configuration infrastructure
Evan Phoenix authored
68 ConfigParser config_parser;
69 Configuration config;
70
4ff7d5e Set std::terminate to provide better error message
Evan Phoenix authored
71 public:
db6659b Refactor Environment/cli.cpp around
Evan Phoenix authored
72 Environment(int argc, char** argv);
feb91b4 Tons of stuff (too much probably)
Evan Phoenix authored
73 ~Environment();
74
0051012 Allow loopback agent to bind to a TCP port
Evan Phoenix authored
75 int argc() {
76 return argc_;
77 }
78
79 char** argv() {
80 return argv_;
81 }
82
8d2093a @dbussink Update current state object with proper VM when forking
dbussink authored
83 void set_root_vm(VM* vm) {
84 root_vm = vm;
85 state->set_vm(vm);
86 }
87
4ff7d5e Set std::terminate to provide better error message
Evan Phoenix authored
88 void setup_cpp_terminate();
89
7862130 @brixen Build Rubinius file system location independent.
brixen authored
90 std::string executable_name();
91 std::string system_prefix();
3ce0d8a @brixen Fixed Rubinius loading stale runtime.
brixen authored
92 bool verify_paths(std::string prefix);
93 bool load_signature(std::string dir);
803e459 @brixen Parse VM options before booting the VM.
brixen authored
94 void load_vm_options(int argc, char** argv);
feb91b4 Tons of stuff (too much probably)
Evan Phoenix authored
95 void load_argv(int argc, char** argv);
db6659b Refactor Environment/cli.cpp around
Evan Phoenix authored
96 void load_kernel(std::string root);
41ff5e1 @brixen Reworked building multiple language versions of kernel.
brixen authored
97 void load_directory(std::string dir);
5d2da0c @drbrain Parse runtime/platform.conf
drbrain authored
98 void load_platform_conf(std::string dir);
878ca1b Add ability to load options from a file
Evan Phoenix authored
99 void load_conf(std::string path);
100 void load_string(std::string str);
feb91b4 Tons of stuff (too much probably)
Evan Phoenix authored
101 void run_file(std::string path);
73fb486 Introduce tooling API, convert profiler to it.
Evan Phoenix authored
102 void load_tool();
7862130 @brixen Build Rubinius file system location independent.
brixen authored
103 void run_from_filesystem();
6c31ab6 Add cli switch to enable jit
Evan Phoenix authored
104 void boot_vm();
db6659b Refactor Environment/cli.cpp around
Evan Phoenix authored
105
8dc44f0 @dbussink Allow for exiting from a different thread
dbussink authored
106 void halt(STATE);
107 void halt_and_exit(STATE);
108 int exit_code(STATE);
109
e6bb96a Fix a number of IO/Signal interaction issues
Evan Phoenix authored
110 void start_signals();
ff881b8 Started query agent, mainly just groundwork thus far
Evan Phoenix authored
111 void start_agent(int port);
feb91b4 Tons of stuff (too much probably)
Evan Phoenix authored
112 };
c11533d @drbrain Move Rubinius::Terminal constant to kernel, wire up IO#tty? to suppor…
drbrain authored
113
feb91b4 Tons of stuff (too much probably)
Evan Phoenix authored
114 }
115
116 #endif
Something went wrong with that request. Please try again.