Skip to content

Commit

Permalink
Follow VM-to-State transition in JIT
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun committed Mar 17, 2012
1 parent e820a69 commit f1cf8e8
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 112 deletions.
34 changes: 17 additions & 17 deletions vm/llvm/inline.cpp
Expand Up @@ -141,7 +141,7 @@ namespace rubinius {
ops_.setup_out_args(count_);

std::vector<Type*> ftypes;
ftypes.push_back(ops_.state()->ptr_type("VM"));
ftypes.push_back(ops_.state()->ptr_type("State"));
ftypes.push_back(ops_.state()->ptr_type("CallFrame"));
ftypes.push_back(ops_.state()->ptr_type("Executable"));
ftypes.push_back(ops_.state()->ptr_type("Module"));
Expand Down Expand Up @@ -431,7 +431,7 @@ namespace rubinius {
ops_.set_object_slot(self, offset, val);
} else {
Signature sig2(ops_.state(), "Object");
sig2 << "VM";
sig2 << "State";
sig2 << "CallFrame";
sig2 << "Object";
sig2 << "Object";
Expand Down Expand Up @@ -515,7 +515,7 @@ namespace rubinius {

if(!ivar) {
Signature sig2(ops_.state(), "Object");
sig2 << "VM";
sig2 << "State";
sig2 << "Object";
sig2 << "Object";

Expand Down Expand Up @@ -739,7 +739,7 @@ namespace rubinius {
case RBX_FFI_TYPE_LONG:
case RBX_FFI_TYPE_ULONG: {
Signature sig(ops_.state(), ops_.NativeIntTy);
sig << "VM";
sig << "State";
sig << "Object";
sig << llvm::PointerType::getUnqual(ops_.state()->Int1Ty);

Expand All @@ -766,7 +766,7 @@ namespace rubinius {

case RBX_FFI_TYPE_FLOAT: {
Signature sig(ops_.state(), ops_.state()->FloatTy);
sig << "VM";
sig << "State";
sig << "Object";
sig << llvm::PointerType::getUnqual(ops_.state()->Int1Ty);

Expand All @@ -787,7 +787,7 @@ namespace rubinius {

case RBX_FFI_TYPE_DOUBLE: {
Signature sig(ops_.state(), ops_.state()->DoubleTy);
sig << "VM";
sig << "State";
sig << "Object";
sig << llvm::PointerType::getUnqual(ops_.state()->Int1Ty);

Expand All @@ -809,7 +809,7 @@ namespace rubinius {
case RBX_FFI_TYPE_LONG_LONG:
case RBX_FFI_TYPE_ULONG_LONG: {
Signature sig(ops_.state(), ops_.state()->Int64Ty);
sig << "VM";
sig << "State";
sig << "Object";
sig << llvm::PointerType::getUnqual(ops_.state()->Int1Ty);

Expand Down Expand Up @@ -842,7 +842,7 @@ namespace rubinius {
Type* type = llvm::PointerType::getUnqual(ops_.state()->Int8Ty);

Signature sig(ops_.state(), type);
sig << "VM";
sig << "State";
sig << "Object";
sig << llvm::PointerType::getUnqual(ops_.state()->Int1Ty);

Expand All @@ -865,7 +865,7 @@ namespace rubinius {
Type* type = llvm::PointerType::getUnqual(ops_.state()->Int8Ty);

Signature sig(ops_.state(), type);
sig << "VM";
sig << "State";
sig << "Object";
sig << llvm::PointerType::getUnqual(ops_.state()->Int1Ty);

Expand All @@ -890,7 +890,7 @@ namespace rubinius {
}

Signature check(ops_.state(), ops_.NativeIntTy);
check << "VM";
check << "State";
check << "CallFrame";

Value* check_args[] = { ops_.vm(), ops_.call_frame() };
Expand Down Expand Up @@ -923,7 +923,7 @@ namespace rubinius {
#endif
{
Signature sig(ops_.state(), ops_.ObjType);
sig << "VM";
sig << "State";
sig << ops_.state()->Int32Ty;

res_args[1] = ops_.b().CreateSExtOrBitCast(res_args[1],
Expand All @@ -942,7 +942,7 @@ namespace rubinius {
#endif
{
Signature sig(ops_.state(), ops_.ObjType);
sig << "VM";
sig << "State";
sig << ops_.state()->Int64Ty;

result = sig.call("rbx_ffi_from_int64", res_args, 2, "to_obj",
Expand All @@ -952,7 +952,7 @@ namespace rubinius {

case RBX_FFI_TYPE_FLOAT: {
Signature sig(ops_.state(), ops_.ObjType);
sig << "VM";
sig << "State";
sig << ops_.state()->FloatTy;

result = sig.call("rbx_ffi_from_float", res_args, 2, "to_obj",
Expand All @@ -962,7 +962,7 @@ namespace rubinius {

case RBX_FFI_TYPE_DOUBLE: {
Signature sig(ops_.state(), ops_.ObjType);
sig << "VM";
sig << "State";
sig << ops_.state()->DoubleTy;

result = sig.call("rbx_ffi_from_double", res_args, 2, "to_obj",
Expand All @@ -972,7 +972,7 @@ namespace rubinius {

case RBX_FFI_TYPE_PTR: {
Signature sig(ops_.state(), ops_.ObjType);
sig << "VM";
sig << "State";
sig << llvm::PointerType::getUnqual(ops_.state()->Int8Ty);

result = sig.call("rbx_ffi_from_ptr", res_args, 2, "to_obj",
Expand All @@ -986,7 +986,7 @@ namespace rubinius {

case RBX_FFI_TYPE_STRING: {
Signature sig(ops_.state(), ops_.ObjType);
sig << "VM";
sig << "State";
sig << llvm::PointerType::getUnqual(ops_.state()->Int8Ty);

result = sig.call("rbx_ffi_from_string", res_args, 2, "to_obj",
Expand All @@ -996,7 +996,7 @@ namespace rubinius {

case RBX_FFI_TYPE_STRPTR: {
Signature sig(ops_.state(), ops_.ObjType);
sig << "VM";
sig << "State";
sig << llvm::PointerType::getUnqual(ops_.state()->Int8Ty);

result = sig.call("rbx_ffi_from_string_with_pointer", res_args, 2, "to_obj",
Expand Down
10 changes: 5 additions & 5 deletions vm/llvm/inline_primitive.cpp
Expand Up @@ -489,7 +489,7 @@ namespace rubinius {
}

Signature sig(ops.state(), ops.state()->ptr_type("Float"));
sig << "VM";
sig << "State";

Function* func = sig.function("rbx_float_allocate");
func->setDoesNotAlias(0, true); // return value
Expand Down Expand Up @@ -607,7 +607,7 @@ namespace rubinius {
Value* V = i.recv();

Signature sig(ops.state(), "Object");
sig << "VM";
sig << "State";
sig << "CallFrame";
sig << "Object";

Expand Down Expand Up @@ -636,7 +636,7 @@ namespace rubinius {
i.context().enter_inline();

Signature sig(ops.state(), ops.state()->ptr_type("Object"));
sig << "VM";
sig << "State";
sig << "Object";

Value* call_args[] = { ops.vm(), i.recv() };
Expand All @@ -655,7 +655,7 @@ namespace rubinius {
ops.check_class(self, klass, i.failure());
Signature sig(ops.state(), "Class");
sig << "VM";
sig << "State";
sig << "Object";
Value* call_args[] = { ops.vm(), self };
Expand Down Expand Up @@ -774,7 +774,7 @@ namespace rubinius {
std::vector<Value*> call_args;

Signature sig(ops_.state(), "Object");
sig << "VM";
sig << "State";
call_args.push_back(ops_.vm());

if(stub_res.pass_callframe()) {
Expand Down
8 changes: 4 additions & 4 deletions vm/llvm/jit_block.cpp
Expand Up @@ -18,7 +18,7 @@ namespace jit {

void BlockBuilder::setup() {
std::vector<Type*> ftypes;
ftypes.push_back(ls_->ptr_type("VM"));
ftypes.push_back(ls_->ptr_type("State"));
ftypes.push_back(ls_->ptr_type("CallFrame"));
ftypes.push_back(ls_->ptr_type("BlockEnvironment"));
ftypes.push_back(ls_->ptr_type("Arguments"));
Expand Down Expand Up @@ -76,7 +76,7 @@ namespace jit {
b().SetInsertPoint(setup_profiling);

Signature sig(ls_, ls_->VoidTy);
sig << "VM";
sig << "State";
sig << llvm::PointerType::getUnqual(ls_->Int8Ty);
sig << "BlockEnvironment";
sig << "Module";
Expand Down Expand Up @@ -224,7 +224,7 @@ namespace jit {
b().SetInsertPoint(destruct);

Signature sig(ls_, "Object");
sig << "VM";
sig << "State";
sig << "CallFrame";
sig << "Arguments";

Expand Down Expand Up @@ -447,7 +447,7 @@ namespace jit {
// Phase 4 - splat
if(vmm_->splat_position >= 0) {
Signature sig(ls_, "Object");
sig << "VM";
sig << "State";
sig << "Arguments";
sig << ls_->Int32Ty;
sig << ls_->Int32Ty;
Expand Down
4 changes: 2 additions & 2 deletions vm/llvm/jit_builder.cpp
Expand Up @@ -180,7 +180,7 @@ namespace jit {
Value* call_args[] = { info_.vm(), info_.previous(), exec, module, info_.args() };

Signature sig(ls_, "Object");
sig << "VM";
sig << "State";
sig << "CallFrame";
sig << "Executable";
sig << "Module";
Expand Down Expand Up @@ -548,7 +548,7 @@ namespace jit {

b().SetInsertPoint(import_args_);
Signature sig(ls_, obj_type);
sig << "VM";
sig << "State";
sig << "CallFrame";

Function* func_ci = sig.function("rbx_check_interrupts");
Expand Down
2 changes: 1 addition & 1 deletion vm/llvm/jit_inline_block.cpp
Expand Up @@ -96,7 +96,7 @@ namespace jit {

if(stack_args.size() == 1 && vmm_->total_args > 1) {
Signature sig(ls_, "Object");
sig << "VM";
sig << "State";
sig << "CallFrame";
sig << "Object";
sig << vars->getType();
Expand Down
10 changes: 5 additions & 5 deletions vm/llvm/jit_method.cpp
Expand Up @@ -20,7 +20,7 @@ namespace jit {

void MethodBuilder::setup() {
std::vector<Type*> ftypes;
ftypes.push_back(ls_->ptr_type("VM"));
ftypes.push_back(ls_->ptr_type("State"));
ftypes.push_back(ls_->ptr_type("CallFrame"));
ftypes.push_back(ls_->ptr_type("Executable"));
ftypes.push_back(ls_->ptr_type("Module"));
Expand Down Expand Up @@ -235,7 +235,7 @@ namespace jit {
// Phase 4 - splat
if(vmm_->splat_position >= 0) {
Signature sig(ls_, "Object");
sig << "VM";
sig << "State";
sig << "Arguments";
sig << ls_->Int32Ty;
sig << ls_->Int32Ty;
Expand Down Expand Up @@ -367,7 +367,7 @@ namespace jit {
// Setup the splat.
if(vmm_->splat_position >= 0) {
Signature sig(ls_, "Object");
sig << "VM";
sig << "State";
sig << "Arguments";
sig << ls_->Int32Ty;
sig << ls_->Int32Ty;
Expand Down Expand Up @@ -447,7 +447,7 @@ namespace jit {
// Call our arg_error helper
Signature sig(ls_, "Object");

sig << "VM";
sig << "State";
sig << "CallFrame";
sig << "Arguments";
sig << ls_->Int32Ty;
Expand Down Expand Up @@ -576,7 +576,7 @@ namespace jit {
b().SetInsertPoint(setup_profiling);

Signature sig(ls_, ls_->VoidTy);
sig << "VM";
sig << "State";
sig << llvm::PointerType::getUnqual(ls_->Int8Ty);
sig << "Executable";
sig << "Module";
Expand Down
8 changes: 4 additions & 4 deletions vm/llvm/jit_operations.hpp
Expand Up @@ -92,7 +92,7 @@ namespace rubinius {
llvm::Type* ObjArrayTy;

// Frequently used types
llvm::Type* VMTy;
llvm::Type* StateTy;
llvm::Type* CallFrameTy;

// Commonly used constants
Expand Down Expand Up @@ -130,7 +130,7 @@ namespace rubinius {
ObjType = ptr_type("Object");
ObjArrayTy = llvm::PointerType::getUnqual(ObjType);

VMTy = ptr_type("VM");
StateTy = ptr_type("State");
CallFrameTy = ptr_type("CallFrame");

Function::arg_iterator input = function_->arg_begin();
Expand Down Expand Up @@ -715,7 +715,7 @@ namespace rubinius {
set_block(do_flush);

Signature sig(ls_, "Object");
sig << "VM";
sig << "State";
sig << "StackVariables";

Value* call_args[] = { vm_, vars };
Expand Down Expand Up @@ -946,7 +946,7 @@ namespace rubinius {

void write_barrier(Value* obj, Value* val) {
Signature wb(ls_, ObjType);
wb << VMTy;
wb << StateTy;
wb << ObjType;
wb << ObjType;

Expand Down

0 comments on commit f1cf8e8

Please sign in to comment.