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: f735a2db3067
Choose a base ref
...
head repository: rubinius/rubinius
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 772b336881f8
Choose a head ref
  • 2 commits
  • 6 files changed
  • 1 contributor

Commits on Mar 25, 2016

  1. Copy the full SHA
    3102a04 View commit details
  2. Copy the full SHA
    772b336 View commit details
Showing with 24 additions and 5 deletions.
  1. +1 −1 core/vm.rb
  2. +1 −1 machine/builtin/fiber.hpp
  3. +4 −0 machine/builtin/location.cpp
  4. +9 −2 machine/builtin/thread.cpp
  5. +1 −1 machine/internal_threads.cpp
  6. +8 −0 machine/vm.cpp
2 changes: 1 addition & 1 deletion core/vm.rb
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ def self.backtrace(frames_to_skip)
Rubinius.primitive :vm_backtrace

# Add the + 1 to skip this frame
backtrace(Integer(frames_to_skip) + 1, include_vars)
backtrace Integer(frames_to_skip) + 1
end

def self.stats
2 changes: 1 addition & 1 deletion machine/builtin/fiber.hpp
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ namespace rubinius {

state->vm()->set_current_fiber(this);
state->vm()->set_call_frame(data_->call_frame());
data_->set_call_frame(0);
data_->set_call_frame(NULL);
status_ = eRunning;
}

4 changes: 4 additions & 0 deletions machine/builtin/location.cpp
Original file line number Diff line number Diff line change
@@ -127,6 +127,8 @@ namespace rubinius {
}

Array* Location::from_call_stack(STATE, ssize_t up) {
if(up < 0) rubinius::bug("negative skip frame value provided");

CallFrame* base = state->vm()->call_frame();
CallFrame* start = base;
size_t count = 0;
@@ -156,6 +158,8 @@ namespace rubinius {
}

Array* Location::mri_backtrace(STATE, ssize_t up) {
if(up < 0) rubinius::bug("negative skip frame value provided");

CallFrame* base = state->vm()->call_frame();
CallFrame* start = base;
size_t count = 0;
11 changes: 9 additions & 2 deletions machine/builtin/thread.cpp
Original file line number Diff line number Diff line change
@@ -112,7 +112,9 @@ namespace rubinius {
}

Object* run_instance(STATE) {
// These are all referenced, so OnStack is not necessary.
/* These are all referenced, so OnStack is not necessary. Additionally,
* thread is pinned, so we do not need to worry about it moving.
*/
Thread* thread = state->vm()->thread.get();
Array* args = thread->args();
Object* block = thread->block();
@@ -123,6 +125,11 @@ namespace rubinius {

Object* value = block->send(state, G(sym_call), args, block);

/* We explicitly set the current CallFrame reference to NULL because we
* are at the top of the stack in terms of managed code.
*/
state->vm()->set_call_frame(NULL);

thread->exception(state, state->vm()->thread_state()->current_exception());

if(state->vm()->thread_state()->raise_reason() == cThreadKill) {
@@ -367,6 +374,7 @@ namespace rubinius {

vm->shared.tool_broker()->thread_start(state);
Object* value = vm->thread->function_(state);
vm->set_call_frame(NULL);
vm->shared.tool_broker()->thread_stop(state);

vm->thread->join_lock_.lock();
@@ -388,7 +396,6 @@ namespace rubinius {

logger::write("exit thread: %s", vm->name().c_str());

vm->set_call_frame(0);
vm->become_unmanaged();

if(vm->main_thread_p() || (!value && vm->thread_state()->raise_reason() == cExit)) {
2 changes: 1 addition & 1 deletion machine/internal_threads.cpp
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ namespace rubinius {
RUBINIUS_THREAD_STOP(
const_cast<RBX_DTRACE_CHAR_P>(vm->name().c_str()), vm->thread_id(), 1);

vm->set_call_frame(0);
vm->set_call_frame(NULL);
vm->become_unmanaged();

vm->set_zombie(state);
8 changes: 8 additions & 0 deletions machine/vm.cpp
Original file line number Diff line number Diff line change
@@ -123,6 +123,8 @@ namespace rubinius {
}

CallFrame* VM::get_call_frame(ssize_t up) {
if(up < 0) rubinius::bug("negative skip frame value provided");

CallFrame* frame = call_frame_;

while(frame && up-- > 0) {
@@ -133,6 +135,8 @@ namespace rubinius {
}

CallFrame* VM::get_ruby_frame(ssize_t up) {
if(up < 0) rubinius::bug("negative skip frame value provided");

CallFrame* frame = call_frame_;

while(frame && up-- > 0) {
@@ -148,6 +152,8 @@ namespace rubinius {
}

CallFrame* VM::get_variables_frame(ssize_t up) {
if(up < 0) rubinius::bug("negative skip frame value provided");

CallFrame* frame = call_frame_;

while(frame && up-- > 0) {
@@ -169,6 +175,8 @@ namespace rubinius {
}

CallFrame* VM::get_scope_frame(ssize_t up) {
if(up < 0) rubinius::bug("negative skip frame value provided");

CallFrame* frame = call_frame_;

while(frame && up-- > 0) {