Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubinius/rubinius
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7d071f0cfe85
Choose a base ref
...
head repository: rubinius/rubinius
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 46bd531f1887
Choose a head ref
  • 2 commits
  • 60 files changed
  • 1 contributor

Commits on Mar 28, 2016

  1. Converted // slot annotation to attr_accessor.

    Instead of duplicating the slot definition with the attr_{accessor, reader,
    writer} annotation, we redefine the macros to define the slots. This works for
    all but two cases, which are exceptional, and we define attr_field to define
    the accessors without defining the slot.
    brixen committed Mar 28, 2016
    Copy the full SHA
    5d67b4a View commit details
  2. Revert "Finish running finalizers before halting the machine."

    This reverts commit 7d071f0.
    brixen committed Mar 28, 2016
    Copy the full SHA
    46bd531 View commit details
Showing with 235 additions and 686 deletions.
  1. +0 −9 machine/builtin/access_variable.hpp
  2. +0 −6 machine/builtin/alias.hpp
  3. +0 −10 machine/builtin/array.hpp
  4. +0 −5 machine/builtin/atomic.hpp
  5. +0 −9 machine/builtin/autoload.hpp
  6. +1 −7 machine/builtin/basic_object.hpp
  7. +0 −4 machine/builtin/block_as_method.hpp
  8. +12 −12 machine/builtin/block_environment.cpp
  9. +3 −12 machine/builtin/block_environment.hpp
  10. +6 −6 machine/builtin/call_custom_cache.cpp
  11. +2 −3 machine/builtin/call_custom_cache.hpp
  12. +9 −5 machine/builtin/call_site.hpp
  13. +7 −18 machine/builtin/call_unit.hpp
  14. +0 −4 machine/builtin/call_unit_adapter.hpp
  15. +2 −6 machine/builtin/channel.hpp
  16. +3 −15 machine/builtin/class.hpp
  17. +2 −3 machine/builtin/code_db.hpp
  18. +19 −36 machine/builtin/compiled_code.hpp
  19. +5 −11 machine/builtin/constant_cache.hpp
  20. +5 −5 machine/builtin/constant_scope.cpp
  21. +8 −18 machine/builtin/constant_scope.hpp
  22. +4 −16 machine/builtin/constant_table.hpp
  23. +0 −6 machine/builtin/diagnostics.hpp
  24. +0 −5 machine/builtin/dir.hpp
  25. +11 −23 machine/builtin/encoding.hpp
  26. +0 −12 machine/builtin/exception.hpp
  27. +2 −9 machine/builtin/executable.hpp
  28. +6 −14 machine/builtin/fiber.hpp
  29. +0 −7 machine/builtin/fsevent.hpp
  30. +0 −29 machine/builtin/io.hpp
  31. +0 −6 machine/builtin/iseq.hpp
  32. +5 −46 machine/builtin/jit.hpp
  33. +0 −15 machine/builtin/list.hpp
  34. +0 −9 machine/builtin/location.hpp
  35. +0 −8 machine/builtin/logger.hpp
  36. +0 −14 machine/builtin/lookup_table.hpp
  37. +4 −20 machine/builtin/method_table.hpp
  38. +0 −20 machine/builtin/module.hpp
  39. +3 −3 machine/builtin/mono_inline_cache.cpp
  40. +5 −7 machine/builtin/mono_inline_cache.hpp
  41. +1 −12 machine/builtin/native_function.hpp
  42. +7 −21 machine/builtin/native_method.hpp
  43. +31 −10 machine/builtin/object.hpp
  44. +4 −4 machine/builtin/poly_inline_cache.cpp
  45. +4 −9 machine/builtin/poly_inline_cache.hpp
  46. +0 −7 machine/builtin/proc.hpp
  47. +3 −6 machine/builtin/randomizer.hpp
  48. +3 −18 machine/builtin/regexp.hpp
  49. +1 −1 machine/builtin/respond_to_cache.cpp
  50. +5 −10 machine/builtin/respond_to_cache.hpp
  51. +2 −3 machine/builtin/stat.hpp
  52. +5 −19 machine/builtin/string.hpp
  53. +21 −37 machine/builtin/thread.hpp
  54. +0 −12 machine/builtin/thread_state.hpp
  55. +0 −4 machine/builtin/thunk.hpp
  56. +3 −9 machine/builtin/time.hpp
  57. +9 −27 machine/builtin/variable_scope.hpp
  58. +10 −0 machine/codegen/field_extract.rb
  59. +2 −2 machine/environment.cpp
  60. +0 −2 machine/memory/finalizer.cpp
9 changes: 0 additions & 9 deletions machine/builtin/access_variable.hpp
Original file line number Diff line number Diff line change
@@ -13,18 +13,9 @@ namespace rubinius {
public:
const static object_type type = AccessVariableType;

private:
Symbol* name_; // slot
Object* write_; // slot

public:
/* accessors */

attr_accessor(name, Symbol);
attr_accessor(write, Object);

/* interface */

static void bootstrap(STATE);
static void initialize(STATE, AccessVariable* av) {
Executable::initialize(state, av, AccessVariable::access_execute);
6 changes: 0 additions & 6 deletions machine/builtin/alias.hpp
Original file line number Diff line number Diff line change
@@ -10,12 +10,6 @@ namespace rubinius {
public:
const static object_type type = AliasType;

private:
Symbol* original_name_; // slot
Module* original_module_; // slot
Executable* original_exec_; // slot

public:
attr_accessor(original_name, Symbol);
attr_accessor(original_module, Module);
attr_accessor(original_exec, Executable);
10 changes: 0 additions & 10 deletions machine/builtin/array.hpp
Original file line number Diff line number Diff line change
@@ -15,20 +15,10 @@ namespace rubinius {
public:
const static object_type type = ArrayType;

private:
Fixnum* total_; // slot
Tuple* tuple_; // slot
Fixnum* start_; // slot

public:
/* accessors */

attr_accessor(total, Fixnum);
attr_accessor(tuple, Tuple);
attr_accessor(start, Fixnum);

/* interface */

native_int size();
native_int offset();
void set_size(native_int size);
5 changes: 0 additions & 5 deletions machine/builtin/atomic.hpp
Original file line number Diff line number Diff line change
@@ -13,13 +13,8 @@ namespace rubinius {
public:
const static object_type type = AtomicReferenceType;

private:
Object* value_; // slot

public:
attr_accessor(value, Object);

public:
static void bootstrap(STATE);
static void initialize(STATE, AtomicReference* ref) {
ref->value_ = nil<Object>();
9 changes: 0 additions & 9 deletions machine/builtin/autoload.hpp
Original file line number Diff line number Diff line change
@@ -16,15 +16,6 @@ namespace rubinius {
public:
const static object_type type = AutoloadType;

private:
Symbol* name_; // slot
Module* scope_; // slot
Object* path_; // slot
Object* constant_; // slot
Thread* thread_; // slot
Object* loaded_; // slot

public:
attr_accessor(name, Symbol);
attr_accessor(scope, Module);
attr_accessor(path, Object);
8 changes: 1 addition & 7 deletions machine/builtin/basic_object.hpp
Original file line number Diff line number Diff line change
@@ -5,17 +5,11 @@

namespace rubinius {
class BasicObject : public Object {
public: /* Slots and bookkeeping */

/** Class type identifier. */
public:
static const object_type type = BasicObjectType;

static void bootstrap(STATE);

public: /* accessors */

};

}

#endif
4 changes: 0 additions & 4 deletions machine/builtin/block_as_method.hpp
Original file line number Diff line number Diff line change
@@ -16,10 +16,6 @@ namespace rubinius {
public:
const static object_type type = BlockAsMethodType;

private:
BlockEnvironment* block_env_; // slot

public:
attr_accessor(block_env, BlockEnvironment);

static void initialize(STATE, BlockAsMethod* obj) {
24 changes: 12 additions & 12 deletions machine/builtin/block_environment.cpp
Original file line number Diff line number Diff line change
@@ -42,11 +42,11 @@ namespace rubinius {
}

void BlockEnvironment::lock_scope(STATE) {
if(scope_ && !scope_->nil_p()) {
scope_->set_locked(state);
if(scope() && !scope()->nil_p()) {
scope()->set_locked(state);
}
if(top_scope_ && !top_scope_->nil_p()) {
top_scope_->set_locked(state);
if(top_scope() && !top_scope()->nil_p()) {
top_scope()->set_locked(state);
}
}

@@ -55,14 +55,14 @@ namespace rubinius {
}

MachineCode* BlockEnvironment::machine_code(STATE) {
return compiled_code_->internalize(state);
return compiled_code()->internalize(state);
}

Object* BlockEnvironment::invoke(STATE,
BlockEnvironment* env, Arguments& args,
BlockInvocation& invocation)
{
MachineCode* mcode = env->compiled_code_->machine_code();
MachineCode* mcode = env->compiled_code()->machine_code();

if(!mcode) {
mcode = env->machine_code(state);
@@ -383,7 +383,7 @@ namespace rubinius {
{
// Don't use env->machine_code() because it might lock and the work should
// already be done.
MachineCode* const mcode = env->compiled_code_->machine_code();
MachineCode* const mcode = env->compiled_code()->machine_code();

if(!mcode) {
Exception::internal_error(state, "invalid bytecode method");
@@ -437,7 +437,7 @@ namespace rubinius {

call_frame->arguments = &args;
call_frame->dispatch_data = env;
call_frame->compiled_code = env->compiled_code_;
call_frame->compiled_code = env->compiled_code();
call_frame->scope = scope;
call_frame->optional_jit_data = NULL;
call_frame->top_scope_ = env->top_scope_;
@@ -488,7 +488,7 @@ namespace rubinius {
Object* BlockEnvironment::call(STATE,
Arguments& args, int flags)
{
BlockInvocation invocation(scope_->self(), constant_scope_, flags);
BlockInvocation invocation(scope()->self(), constant_scope(), flags);
return invoke(state, this, args, invocation);
}

@@ -505,7 +505,7 @@ namespace rubinius {
if(args.total() < 1) {
Exception* exc =
Exception::make_argument_error(state, 1, args.total(),
compiled_code_->name());
compiled_code()->name());
exc->locations(state, Location::from_call_stack(state));
state->raise_exception(exc);
return NULL;
@@ -524,7 +524,7 @@ namespace rubinius {
if(args.total() < 3) {
Exception* exc =
Exception::make_argument_error(state, 3, args.total(),
compiled_code_->name());
compiled_code()->name());
exc->locations(state, Location::from_call_stack(state));
state->raise_exception(exc);
return NULL;
@@ -574,7 +574,7 @@ namespace rubinius {

be->scope(state, scope_);
be->top_scope(state, top_scope_);
be->compiled_code(state, compiled_code_);
be->compiled_code(state, compiled_code());
be->constant_scope(state, constant_scope_);
be->module(state, nil<Module>());

15 changes: 3 additions & 12 deletions machine/builtin/block_environment.hpp
Original file line number Diff line number Diff line change
@@ -42,25 +42,16 @@ namespace rubinius {
public:
const static object_type type = BlockEnvironmentType;

private:
VariableScope* scope_; // slot
VariableScope* top_scope_; // slot
CompiledCode* compiled_code_; // slot
ConstantScope* constant_scope_; // slot
Module* module_; // slot

MachineCode* machine_code(STATE);

public:
/* accessors */
attr_accessor(scope, VariableScope);
attr_accessor(top_scope, VariableScope);
attr_accessor(compiled_code, CompiledCode);
attr_accessor(constant_scope, ConstantScope);
attr_accessor(module, Module);

/* interface */
private:
MachineCode* machine_code(STATE);

public:
static void bootstrap(STATE);
static void bootstrap_methods(STATE);

12 changes: 6 additions & 6 deletions machine/builtin/call_custom_cache.cpp
Original file line number Diff line number Diff line change
@@ -15,14 +15,14 @@ namespace rubinius {
CallCustomCache* cache =
state->memory()->new_object<CallCustomCache>(state, G(call_custom_cache));

cache->name_ = call_site->name();
cache->name(state, call_site->name());
cache->executable(state, call_site->executable());
cache->ip_ = call_site->ip();
cache->executor_ = check_cache;
cache->fallback_ = call_site->fallback_;
cache->updater_ = NULL;
cache->ip(call_site->ip());
cache->executor_ = check_cache;
cache->fallback_ = call_site->fallback_;
cache->updater_ = NULL;
cache->call_unit(state, call_unit);
cache->hits_ = 0;
cache->hits_ = 0;

return cache;
}
5 changes: 2 additions & 3 deletions machine/builtin/call_custom_cache.hpp
Original file line number Diff line number Diff line change
@@ -12,13 +12,12 @@ namespace rubinius {
public:
const static object_type type = CallCustomCacheType;

attr_accessor(call_unit, CallUnit);

private:
CallUnit* call_unit_; // slot
int hits_;

public:
attr_accessor(call_unit, CallUnit);

static void bootstrap(STATE);
static void initialize(STATE, CallCustomCache* obj) {
CallSite::initialize(state, obj);
14 changes: 9 additions & 5 deletions machine/builtin/call_site.hpp
Original file line number Diff line number Diff line change
@@ -34,18 +34,18 @@ namespace rubinius {
public:
const static object_type type = CallSiteType;

Symbol* name_; // slot
attr_accessor(name, Symbol);

CacheExecutor executor_;
FallbackExecutor fallback_;
CacheUpdater updater_;

Executable* executable_; // slot
attr_accessor(executable, Executable);

private:
int ip_;

public:
attr_accessor(name, Symbol);
attr_accessor(executable, Executable);

static void bootstrap(STATE);
static void initialize(STATE, CallSite* obj) {
obj->name_ = nil<Symbol>();
@@ -60,6 +60,10 @@ namespace rubinius {
return ip_;
}

void ip(int new_ip) {
ip_ = new_ip;
}

// Rubinius.primitive+ :call_site_ip
Integer* ip_prim(STATE);

25 changes: 7 additions & 18 deletions machine/builtin/call_unit.hpp
Original file line number Diff line number Diff line change
@@ -24,24 +24,6 @@ namespace rubinius {
typedef Object* (*Execute)(State*, CallUnit* unit,
Executable* exec, Module* mod, Arguments& args);

private:
Kind kind_;

Object* value_; // slot
Module* module_; // slot
Executable* executable_; // slot
Symbol* name_; // slot

CallUnit* test_condition_; // slot
CallUnit* test_then_; // slot
CallUnit* test_else_; // slot

int which_;

public:
Execute execute;

public:
attr_accessor(value, Object);
attr_accessor(module, Module);
attr_accessor(executable, Executable);
@@ -51,6 +33,13 @@ namespace rubinius {
attr_accessor(test_then, CallUnit);
attr_accessor(test_else, CallUnit);

private:
Kind kind_;
int which_;

public:
Execute execute;

static void initialize(STATE, CallUnit* obj) {
obj-> kind_ = eUnset;
obj->value_ = nil<Object>();
4 changes: 0 additions & 4 deletions machine/builtin/call_unit_adapter.hpp
Original file line number Diff line number Diff line change
@@ -14,10 +14,6 @@ namespace rubinius {
public:
const static object_type type = CallUnitAdapterType;

private:
CallUnit* unit_; // slot

public:
attr_accessor(unit, CallUnit);

static void initialize(STATE, CallUnitAdapter* obj) {
8 changes: 2 additions & 6 deletions machine/builtin/channel.hpp
Original file line number Diff line number Diff line change
@@ -21,19 +21,15 @@ namespace rubinius {

const static object_type type = ChannelType;

private:
List* value_; // slot
attr_accessor(value, List);

private:
utilities::thread::Condition condition_;
utilities::thread::Mutex mutex_;
int waiters_;
int semaphore_count_;

public:
/* accessors */

attr_accessor(value, List);

/* interface */
static void initialize(STATE, Channel* obj) {
obj->value_ = nil<List>();
Loading