Skip to content
Browse files

Remove LookupTableAssociation, add GlobalCacheEntry

  • Loading branch information...
1 parent c4ae396 commit 025b1328917901b0a820448ae6f74bd71208a16e Evan Phoenix committed
View
5 kernel/alpha.rb
@@ -26,10 +26,9 @@ def self.write_error(str)
raise PrimitiveFailure, "Rubinius::VM.write_error primitive failed"
end
- def self.show_backtrace(ctx)
+ def self.show_backtrace
+ Ruby.primitive :vm_show_backtrace
raise PrimitiveFailure, "Rubinius::VM.show_backtrace primitive failed"
-# Ruby.primitive :vm_show_backtrace
-# raise PrimitiveFailure, "Rubinius::VM.show_backtrace primitive failed"
end
def self.reset_method_cache(sym)
View
5 kernel/bootstrap/rubinius.rb
@@ -13,4 +13,9 @@ def self.object_class(obj)
Ruby.primitive :vm_object_class
raise PrimitiveFailure, "Rubinius.object_class failed"
end
+
+ def self.inc_global_serial
+ Ruby.primitive :vm_inc_global_serial
+ raise PrimitiveFailure, "Rubinius.vm_inc_global_serial failed"
+ end
end
View
98 kernel/common/module.rb
@@ -13,10 +13,6 @@
class Module
def constants_table() ; @constants ; end
-
- # I (Evan) don't like either of these. I think they could easily
- # break things. We should check on that.
- def constants_table=(c) ; @constants = c ; end
attr_writer :method_table
def self.nesting
@@ -464,7 +460,7 @@ def constants
# special case: Module.constants returns Object's constants
if self.equal? Module
- Object.constant_table.each do |name, val|
+ Object.constants_table.each do |name, val|
tbl[name] = true unless tbl.has_key? name
end
end
@@ -493,7 +489,7 @@ def const_path_defined?(name)
const = current
defined = pieces.all? do |piece|
if const.is_a?(Module) and const.constants_table.key?(piece)
- const = const.constants_table[piece].value
+ const = const.constants_table[piece]
true
end
end
@@ -508,13 +504,8 @@ def const_set(name, value)
end
name = normalize_const_name(name)
- assoc = constant_table[name]
-
- if assoc
- assoc.value = value
- else
- constants_table[name] = Rubinius::LookupTable::Association.new(name, value)
- end
+ @constants[name] = value
+ Rubinius.inc_global_serial
return value
end
@@ -523,55 +514,7 @@ def const_set(name, value)
# \_\_const_set__ is emitted by the compiler for const assignment in
# userland.
- def clear_associations(name)
- return if Thread.guarding? self
-
- Thread.recursion_guard self do
- if assoc = @constants[name]
- assoc.active = false
- @constants[name] = Rubinius::LookupTable::Association.new(name, assoc.value)
- end
-
- @constants.each do |key, assoc|
- if assoc.value.kind_of? Module
- assoc.value.clear_associations(name)
- end
- end
-
- if ds = direct_superclass() and ds != Object
- ds.clear_associations(name)
- end
- end
- end
-
def __const_set__(name, value)
- const_name = normalize_const_name(name)
-
- # check all subscopes and invalidate Associations found for +const_name+
- @constants.each_entry do |key, assoc|
- if assoc.value.kind_of? Module
- assoc.value.clear_associations(const_name)
- end
- end
-
- mod = self
- while mod
- assoc = mod.constants_table[const_name]
- break if assoc
- mod = mod.direct_superclass
- end
-
- if mod
- if mod == self
- warn "already initialized constant #{name}"
- else
- # We're masking an existing constant. Invalid it.
- assoc.active = false
- mod.constants_table[const_name] =
- Rubinius::LookupTable::Association.new(const_name, assoc.value)
- end
- end
-
return const_set(name, value)
end
@@ -669,8 +612,8 @@ def autoload(name, path)
name = normalize_const_name(name)
raise TypeError, "autoload filename must be a String" unless path.kind_of? String
raise ArgumentError, "empty file name" if path.empty?
- trigger = Autoload.new(name, self, path)
- constants_table[name] = Rubinius::LookupTable::Association.new(name, trigger)
+ constants_table[name] = Autoload.new(name, self, path)
+ Rubinius.inc_global_serial
return nil
end
@@ -678,7 +621,7 @@ def autoload(name, path)
def autoload?(name)
name = name.to_sym
return unless constants_table.key?(name)
- trigger = constants_table[name].value
+ trigger = constants_table[name]
return unless trigger.kind_of?(Autoload)
trigger.original_path
end
@@ -688,15 +631,14 @@ def remove_const(name)
name = StringValue name
illegal_const(name) unless name[0].isupper
end
-
+
sym = name.to_sym
unless constants_table.has_key?(sym)
return const_missing(name)
end
- assoc = constants_table.delete(sym)
-
- val = assoc.value
+ val = constants_table.delete(sym)
+ Rubinius.inc_global_serial
# Silly API compac. Shield Autoload instances
return nil if val.kind_of? Autoload
@@ -722,9 +664,8 @@ def recursive_const_get(name, missing=true)
current, constant = self, Undefined
while current
- assoc = current.constants_table.fetch name, Undefined
- unless assoc.equal?(Undefined)
- constant = assoc.value
+ constant = current.constants_table.fetch name, Undefined
+ unless constant.equal?(Undefined)
constant = constant.call if constant.kind_of?(Autoload)
return constant
end
@@ -733,9 +674,8 @@ def recursive_const_get(name, missing=true)
end
if instance_of?(Module)
- assoc = Object.constants_table.fetch name, Undefined
- unless assoc.equal?(Undefined)
- constant = assoc.value
+ constant = Object.constants_table.fetch name, Undefined
+ unless constant.equal?(Undefined)
constant = constant.call if constant.kind_of?(Autoload)
return constant
end
@@ -773,14 +713,12 @@ def initialize_copy(other)
@constants = Rubinius::LookupTable.new
- other.constants_table.each do |name, assoc|
- new_assoc = assoc.dup
- @constants[name] = new_assoc
-
- val = new_assoc.value
+ other.constants_table.each do |name, val|
if val.kind_of? Autoload
- new_assoc.value = Autoload.new(val.name, self, val.original_path)
+ val = Autoload.new(val.name, self, val.original_path)
end
+
+ @constants[name] = val
end
self
View
4 kernel/delta/rubinius.rb
@@ -15,7 +15,7 @@ def self.open_class_under(name, sup, mod)
obj.set_name_if_necessary name, mod
mod.const_set name, obj
else
- obj = tbl[name].value
+ obj = tbl[name]
if obj.kind_of? Autoload
obj = obj.call
end
@@ -53,7 +53,7 @@ def self.open_module_under(name, mod)
obj.set_name_if_necessary name, mod
mod.const_set name, obj
else
- obj = tbl[name].value
+ obj = tbl[name]
if obj.kind_of? Autoload
obj = obj.call
end
View
1 rakelib/vm.rake
@@ -137,6 +137,7 @@ field_extract_headers = %w[
vm/builtin/variable_scope.hpp
vm/builtin/location.hpp
vm/builtin/capi_handle.hpp
+ vm/builtin/global_cache_entry.hpp
]
BC = "vm/instructions.bc"
View
2 vm/assembler/jit.cpp
@@ -477,7 +477,7 @@ namespace rubinius {
ops.get_literal(eax, vmm->opcodes[i + 2]);
a.cmp(eax, reinterpret_cast<uintptr_t>(Qnil));
a.jump_if_equal(slow_path);
- a.mov(eax, a.address(eax, FIELD_OFFSET(rubinius::LookupTableAssociation, value_)));
+ a.mov(eax, a.address(eax, 0)); // FIELD_OFFSET(rubinius::LookupTableAssociation, value_)));
// TODO this doesn't support autoload!
s.push(eax);
View
27 vm/builtin/global_cache_entry.cpp
@@ -0,0 +1,27 @@
+#include "builtin/global_cache_entry.hpp"
+#include "builtin/class.hpp"
+
+namespace rubinius {
+ void GlobalCacheEntry::init(STATE) {
+ GO(global_cache_entry).set(
+ state->new_class("GlobalCacheEntry", G(object), G(rubinius)));
+ }
+
+ GlobalCacheEntry* GlobalCacheEntry::create(STATE, Object *value) {
+ GlobalCacheEntry *entry =
+ state->new_object<GlobalCacheEntry>(G(global_cache_entry));
+
+ entry->update(state, value);
+ return entry;
+ }
+
+ bool GlobalCacheEntry::valid_p(STATE) {
+ return serial_->to_native() == state->shared.global_serial();
+ }
+
+ void GlobalCacheEntry::update(STATE, Object* val) {
+ value(state, val);
+ serial(state, Fixnum::from(state->shared.global_serial()));
+ }
+}
+
View
33 vm/builtin/global_cache_entry.hpp
@@ -0,0 +1,33 @@
+#ifndef RBX_BULITIN_GLOBAL_CACHE_ENTRY_HPP
+#define RBX_BULITIN_GLOBAL_CACHE_ENTRY_HPP
+
+#include "builtin/object.hpp"
+#include "builtin/fixnum.hpp"
+
+namespace rubinius {
+ class GlobalCacheEntry : public Object {
+ public:
+ const static object_type type = GlobalCacheEntryType;
+
+ private:
+ Object* value_; // slot
+ Fixnum* serial_; // slot
+
+ public:
+ attr_accessor(value, Object);
+ attr_accessor(serial, Fixnum);
+
+ static void init(STATE);
+ static GlobalCacheEntry* create(STATE, Object* value);
+
+ void update(STATE, Object* value);
+ bool valid_p(STATE);
+
+ class Info : public TypeInfo {
+ public:
+ BASIC_TYPEINFO(TypeInfo)
+ };
+ };
+}
+
+#endif
View
10 vm/builtin/lookuptable.cpp
@@ -304,7 +304,6 @@ namespace rubinius {
close_body(level);
}
-
LookupTableBucket* LookupTableBucket::create(STATE, Object *key, Object *value) {
LookupTableBucket *entry =
state->new_object<LookupTableBucket>(G(lookuptablebucket));
@@ -327,13 +326,4 @@ namespace rubinius {
return nxt;
}
- LookupTableAssociation* LookupTableAssociation::create(STATE, Object *key, Object *value) {
- LookupTableAssociation *entry =
- state->new_object<LookupTableAssociation>(G(lookuptableassociation));
-
- entry->key(state, key);
- entry->value(state, value);
- entry->active(state, Qtrue);
- return entry;
- }
}
View
25 vm/builtin/lookuptable.hpp
@@ -33,31 +33,6 @@ namespace rubinius {
};
};
- class LookupTableAssociation : public Object {
- public:
- const static object_type type = LookupTableAssociationType;
-
- private:
- Object* key_; // slot
-
- public: // public because accessed directly via assembly
- Object* value_; // slot
- Object* active_; // slot
-
- public:
- attr_accessor(key, Object);
- attr_accessor(value, Object);
- attr_accessor(active, Object);
-
- // Ruby.primitive :lookuptableassociation_allocate
- static LookupTableAssociation* create(STATE, Object* key, Object* value);
-
- class Info : public TypeInfo {
- public:
- BASIC_TYPEINFO(TypeInfo)
- };
- };
-
#define LOOKUPTABLE_MIN_SIZE 16
class LookupTable : public Object {
public:
View
33 vm/builtin/module.cpp
@@ -62,43 +62,16 @@ namespace rubinius {
}
void Module::set_const(STATE, Object* sym, Object* val) {
- bool found;
- Object* obj = constants_->fetch(state, sym, &found);
-
- if(found) {
- LookupTableAssociation* assoc = as<LookupTableAssociation>(obj);
- if(assoc->active() != Qfalse) {
- assoc->value(state, val);
- return;
- }
- }
-
- LookupTableAssociation* assoc =
- LookupTableAssociation::create(state, sym, val);
-
- constants_->store(state, sym, assoc);
+ constants_->store(state, sym, val);
+ state->shared.inc_global_serial();
}
void Module::set_const(STATE, const char* name, Object* val) {
set_const(state, state->symbol(name), val);
}
- LookupTableAssociation* Module::get_const_association(STATE, Symbol* sym, bool* found) {
- Object* assoc = constants_->fetch(state, sym, found);
- if(*found) {
- return as<LookupTableAssociation>(assoc);
- } else {
- return reinterpret_cast<LookupTableAssociation*>(Qnil);
- }
- }
-
Object* Module::get_const(STATE, Symbol* sym, bool* found) {
- Object* assoc = constants_->fetch(state, sym, found);
- if(*found) {
- return as<LookupTableAssociation>(assoc)->value();
- } else {
- return assoc;
- }
+ return constants_->fetch(state, sym, found);
}
Object* Module::get_const(STATE, Symbol* sym) {
View
2 vm/builtin/module.hpp
@@ -7,7 +7,6 @@
namespace rubinius {
class LookupTable;
- class LookupTableAssociation;
class Module : public Object {
public:
@@ -41,7 +40,6 @@ namespace rubinius {
Object* get_const(STATE, Symbol* sym);
Object* get_const(STATE, Symbol* sym, bool* found);
Object* get_const(STATE, const char* sym);
- LookupTableAssociation* get_const_association(STATE, Symbol* sym, bool* found);
void set_name(STATE, Module* under, Symbol* name);
View
1 vm/builtin/object.cpp
@@ -64,6 +64,7 @@ namespace rubinius {
metaclass(state)->method_table(state, source_methods);
metaclass(state)->constants(state, source_constants);
+ // TODO inc the global serial here?
// This allows us to preserve included modules
metaclass(state)->superclass(state, mc->superclass());
View
11 vm/builtin/system.cpp
@@ -215,7 +215,7 @@ namespace rubinius {
/* @todo Could possibly capture the system backtrace at this
* point. --rue
*/
- Array* System::vm_backtrace(VM* state, Fixnum* skip, CallFrame* calling_environment) {
+ Array* System::vm_backtrace(STATE, Fixnum* skip, CallFrame* calling_environment) {
CallFrame* call_frame = calling_environment;
for(native_int i = skip->to_native(); call_frame && i > 0; --i) {
@@ -236,6 +236,11 @@ namespace rubinius {
return bt;
}
+ Object* System::vm_show_backtrace(STATE, CallFrame* calling_environment) {
+ calling_environment->print_backtrace(state);
+ return Qnil;
+ }
+
Object* System::vm_profiler_instrumenter_available_p(STATE) {
#ifdef RBX_PROFILER
return Qtrue;
@@ -459,4 +464,8 @@ namespace rubinius {
Class* System::vm_object_class(STATE, Object* obj) {
return obj->class_object(state);
}
+
+ Object* System::vm_inc_global_serial(STATE) {
+ return Fixnum::from(state->shared.inc_global_serial());
+ }
}
View
8 vm/builtin/system.hpp
@@ -187,6 +187,14 @@ namespace rubinius {
// Ruby.primitive :vm_object_class
static Class* vm_object_class(STATE, Object* obj);
+ // Increment the internal global serial number, used for caching
+ // Ruby.primitive :vm_inc_global_serial
+ static Object* vm_inc_global_serial(STATE);
+
+ // Print out the current backtrace of ruby code
+ // Ruby.primitive :vm_show_backtrace
+ static Object* vm_show_backtrace(STATE, CallFrame* calling_environment);
+
public: /* Type info */
class Info : public TypeInfo {
View
6 vm/globals.hpp
@@ -85,7 +85,6 @@ namespace rubinius {
TypedRoot<Class*> dir;
TypedRoot<Class*> compactlookuptable;
TypedRoot<Class*> lookuptablebucket;
- TypedRoot<Class*> lookuptableassociation;
TypedRoot<Class*> access_variable;
TypedRoot<Module*> rubinius;
TypedRoot<Class*> time_class;
@@ -106,6 +105,7 @@ namespace rubinius {
TypedRoot<Exception*> stack_error;
TypedRoot<Class*> jump_error;
TypedRoot<Class*> exc_vm_internal;
+ TypedRoot<Class*> global_cache_entry;
/* Add new globals above this line. */
@@ -197,7 +197,6 @@ namespace rubinius {
dir(&roots),
compactlookuptable(&roots),
lookuptablebucket(&roots),
- lookuptableassociation(&roots),
access_variable(&roots),
rubinius(&roots),
time_class(&roots),
@@ -215,7 +214,8 @@ namespace rubinius {
location(&roots),
stack_error(&roots),
jump_error(&roots),
- exc_vm_internal(&roots)
+ exc_vm_internal(&roots),
+ global_cache_entry(&roots)
/* Add initialize of globals above this line. */
{ }
View
21 vm/helpers.cpp
@@ -15,6 +15,7 @@
#include "builtin/system.hpp"
#include "builtin/thread.hpp"
#include "builtin/channel.hpp"
+#include "builtin/global_cache_entry.hpp"
#include "vm.hpp"
#include "object_utils.hpp"
@@ -73,18 +74,8 @@ namespace rubinius {
}
Object* const_get(STATE, CallFrame* call_frame, Symbol* name, bool* found) {
- LookupTableAssociation* assoc = const_get_association(state, call_frame, name, found);
- if(*found) {
- return assoc->value();
- } else {
- return Qnil;
- }
- }
-
- LookupTableAssociation* const_get_association(STATE, CallFrame* call_frame,
- Symbol* name, bool* found) {
StaticScope *cur;
- LookupTableAssociation* result;
+ Object* result;
*found = false;
@@ -123,7 +114,7 @@ namespace rubinius {
// Detect the toplevel scope (the default) and get outta dodge.
if(cur->top_level_p(state)) break;
- result = cur->module()->get_const_association(state, name, found);
+ result = cur->module()->get_const(state, name, found);
if(*found) return result;
cur = cur->parent();
@@ -132,17 +123,17 @@ namespace rubinius {
// Now look up the superclass chain.
Module* mod = call_frame->static_scope->module();
while(!mod->nil_p()) {
- result = mod->get_const_association(state, name, found);
+ result = mod->get_const(state, name, found);
if(*found) return result;
mod = mod->superclass();
}
// Lastly, check Object specificly
- result = G(object)->get_const_association(state, name, found);
+ result = G(object)->get_const(state, name, found);
if(*found) return result;
- return reinterpret_cast<LookupTableAssociation*>(Qnil);
+ return Qnil;
}
Object* const_missing(STATE, Module* under, Symbol* sym, CallFrame* call_frame) {
View
3 vm/helpers.hpp
@@ -9,7 +9,7 @@ namespace rubinius {
class CompiledMethod;
class VM;
class Object;
- class LookupTableAssociation;
+ class GlobalCacheEntry;
namespace Helpers {
void add_method(VM*, CallFrame* call_frame, Module* mod, Symbol* name, CompiledMethod* meth);
@@ -17,7 +17,6 @@ namespace rubinius {
Object* const_get(VM*, Module* under, Symbol* name, bool* found);
Object* const_get(VM*, CallFrame* call_frame, Symbol* name, bool* found);
- LookupTableAssociation* const_get_association(VM*, CallFrame* call_frame, Symbol* name, bool* found);
Object* const_missing(VM*, Module* under, Symbol* sym, CallFrame* call_frame);
void const_set(VM*, CallFrame* call_frame, Symbol* name, Object* val);
void const_set(VM*, Module* mod, Symbol* name, Object* val);
View
36 vm/instructions.rb
@@ -2206,21 +2206,26 @@ def push_const_fast(symbol_index, association_index)
bool found;
Object* res = 0;
- Object* assoc = call_frame->cm->literals()->at(state, association_index);
- // The association has been set, return the value from it directly.
- if(!assoc->nil_p()) {
- LookupTableAssociation* real_assoc = as<LookupTableAssociation>(assoc);
- if(real_assoc->active() != Qfalse) {
- res = real_assoc->value();
- }
- }
+ Object* val = call_frame->cm->literals()->at(state, association_index);
- if(!res) {
+ // See if the cache is present, if so, validate it and use the value
+ GlobalCacheEntry* cache;
+ if((cache = try_as<GlobalCacheEntry>(val)) != NULL) {
+ if(cache->valid_p(state)) {
+ res = cache->value();
+ } else {
+ Symbol* sym = as<Symbol>(call_frame->cm->literals()->at(state, symbol_index));
+ res = Helpers::const_get(state, call_frame, sym, &found);
+ if(found) {
+ cache->update(state, res);
+ }
+ }
+ } else {
Symbol* sym = as<Symbol>(call_frame->cm->literals()->at(state, symbol_index));
- LookupTableAssociation* assoc = Helpers::const_get_association(state, call_frame, sym, &found);
+ res = Helpers::const_get(state, call_frame, sym, &found);
if(found) {
- call_frame->cm->literals()->put(state, association_index, assoc);
- res = assoc->value();
+ cache = GlobalCacheEntry::create(state, res);
+ call_frame->cm->literals()->put(state, association_index, cache);
} else {
Module* under;
StaticScope* scope = call_frame->static_scope;
@@ -2237,6 +2242,9 @@ def push_const_fast(symbol_index, association_index)
if(Autoload* autoload = try_as<Autoload>(res)) {
res = autoload->resolve(state, call_frame);
+ if(cache && res) {
+ cache->update(state, res);
+ }
}
HANDLE_EXCEPTION(res);
@@ -2272,8 +2280,8 @@ def test_push_const_fast
TS_ASSERT_EQUALS(task->stack_top(), Fixnum::from(3));
Object* obj = call_frame->cm->literals()->at(state, 1);
TS_ASSERT(!obj->nil_p());
- TS_ASSERT(kind_of<LookupTableAssociation>(obj));
- LookupTableAssociation* assoc = as<LookupTableAssociation>(obj);
+ TS_ASSERT(kind_of<GlobalCacheEntry>(obj));
+ GlobalCacheEntry* assoc = as<GlobalCacheEntry>(obj);
TS_ASSERT_EQUALS(assoc->value(), Fixnum::from(3));
View
1 vm/llvm/instructions.cpp
@@ -20,6 +20,7 @@
#include "builtin/proc.hpp"
#include "builtin/thread.hpp"
#include "builtin/system.hpp"
+#include "builtin/global_cache_entry.hpp"
#include "call_frame.hpp"
View
13 vm/ontology.cpp
@@ -39,6 +39,7 @@
#include "builtin/proc.hpp"
#include "builtin/variable_scope.hpp"
#include "builtin/location.hpp"
+#include "builtin/global_cache_entry.hpp"
#include "config.h"
@@ -105,10 +106,6 @@ namespace rubinius {
GO(lookuptablebucket).set(new_basic_class(object));
G(lookuptablebucket)->set_object_type(state, LookupTableBucketType);
- /* Create LookupTableAssociation */
- GO(lookuptableassociation).set(new_basic_class(object));
- G(lookuptableassociation)->set_object_type(state, LookupTableAssociationType);
-
/* Create MethodTable */
GO(methtbl).set(new_basic_class(G(lookuptable)));
G(methtbl)->set_object_type(state, MethodTableType);
@@ -121,10 +118,9 @@ namespace rubinius {
* Tuple
* LookupTable
* LookupTableBucket
- * LookupTableAssociation
* MethodTable
*
- * With these 9 in place, we can now create fully initialized classes
+ * With these 8 in place, we can now create fully initialized classes
* and modules. */
/* Hook up the MetaClass protocols.
@@ -139,7 +135,6 @@ namespace rubinius {
MetaClass::attach(this, G(tuple), G(object)->metaclass(this));
MetaClass::attach(this, G(lookuptable), G(object)->metaclass(this));
MetaClass::attach(this, G(lookuptablebucket), G(object)->metaclass(this));
- MetaClass::attach(this, G(lookuptableassociation), G(object)->metaclass(this));
MetaClass::attach(this, G(methtbl), G(lookuptable)->metaclass(this));
// Now, finish initializing the basic Class/Module
@@ -160,8 +155,6 @@ namespace rubinius {
G(methtbl)->name(this, symbol("Rubinius::MethodTable"));
G(lookuptablebucket)->setup(this, "Bucket", G(lookuptable));
G(lookuptablebucket)->name(state, symbol("Rubinius::LookupTable::Bucket"));
- G(lookuptableassociation)->setup(this, "Association", G(lookuptable));
- G(lookuptableassociation)->name(state, symbol("Rubinius::LookupTable::Association"));
}
void VM::initialize_builtin_classes() {
@@ -236,6 +229,8 @@ namespace rubinius {
Channel::init(this);
NativeMethod::init(this);
+
+ GlobalCacheEntry::init(this);
}
// @todo document all the sections of bootstrap_ontology
View
1 vm/oop.hpp
@@ -83,6 +83,7 @@ const int cTrue = 0x12L;
const int cUndef = 0x22L;
#define Qundef ((Object*)0x22L)
+
// Indicates the mask to use to check if a value is ruby false.
// This mask matches both false and nil ONLY.
#define FALSE_MASK 0xf
View
1 vm/vm.cpp
@@ -48,6 +48,7 @@ namespace rubinius {
, global_handles_(new capi::Handles)
, profiling_(false)
, profiler_collection_(0)
+ , global_serial_(0)
, om(0)
, global_cache(0)
, user_config(0)
View
9 vm/vm.hpp
@@ -118,6 +118,7 @@ namespace rubinius {
capi::Handles* global_handles_;
bool profiling_;
profiler::ProfilerCollection* profiler_collection_;
+ int global_serial_;
public:
Globals globals;
@@ -176,6 +177,14 @@ namespace rubinius {
return profiling_;
}
+ int global_serial() {
+ return global_serial_;
+ }
+
+ int inc_global_serial() {
+ return ++global_serial_;
+ }
+
void enable_profiling(VM* vm);
LookupTable* disable_profiling(VM* vm);

0 comments on commit 025b132

Please sign in to comment.
Something went wrong with that request. Please try again.