Skip to content

Instantly share code, notes, and snippets.

@rue
Created December 14, 2008 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rue/35750 to your computer and use it in GitHub Desktop.
Save rue/35750 to your computer and use it in GitHub Desktop.
From 583f976309cd930319adde681dbd45eb18773bf2 Mon Sep 17 00:00:00 2001
From: Eero Saynatkari <projects@kittensoft.org>
Date: Sun, 14 Dec 2008 20:35:12 +0200
Subject: [PATCH] Temp patc
---
vm/assembler/jit.cpp | 23 ++++++++++++-----------
1 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/vm/assembler/jit.cpp b/vm/assembler/jit.cpp
index c069206..4f015ca 100644
--- a/vm/assembler/jit.cpp
+++ b/vm/assembler/jit.cpp
@@ -22,6 +22,7 @@ extern "C" {
}
namespace rubinius {
+
JITCompiler::JITCompiler()
: stack_cached_(false)
, buffer_(new uint8_t[1024*1024])
@@ -72,7 +73,7 @@ namespace rubinius {
void JITCompiler::compile(VMMethod* vmm) {
// Used for fixups
- uint32_t* last_imm = NULL;
+ uintptr_t last_imm = NULL;
// A label pointing to the code for each virtual ip
std::vector<AssemblerX86::NearJumpLocation> labels(vmm->total);
@@ -120,7 +121,7 @@ namespace rubinius {
// stack caching.
uncache_stack();
- *last_imm = (uint32_t)a.pc();
+ *last_imm = reinterpret_cast<uintptr_t>(a.pc());
Relocation* rel = new Relocation(Relocation::LocalAbsolute,
last_imm, a.pc(), 0);
a.add_relocation(last_imm, rel);
@@ -154,7 +155,7 @@ namespace rubinius {
cache_stack();
s.load_nth(eax, 0);
s.pop();
- a.cmp(eax, (int)Qundef);
+ a.cmp(eax, reinterpret_cast<uintptr_t>(Qundef));
a.jump_if_not_equal(labels[vmm->opcodes[i + 1]]);
break;
case InstructionSequence::insn_pop:
@@ -183,35 +184,35 @@ namespace rubinius {
break;
case InstructionSequence::insn_push_true:
cache_stack();
- s.push((int)Qtrue);
+ s.push(reinterpret_cast<uintptr_t>(Qtrue));
break;
case InstructionSequence::insn_push_false:
cache_stack();
- s.push((int)Qfalse);
+ s.push(reinterpret_cast<uintptr_t>(Qfalse));
break;
case InstructionSequence::insn_push_nil:
cache_stack();
- s.push((int)Qnil);
+ s.push(reinterpret_cast<uintptr_t>(Qnil));
break;
case InstructionSequence::insn_meta_push_0:
cache_stack();
- s.push((int)Fixnum::from(0));
+ s.push(reinterpret_cast<uintptr_t>(Fixnum::from(0)));
break;
case InstructionSequence::insn_meta_push_1:
cache_stack();
- s.push((int)Fixnum::from(1));
+ s.push(reinterpret_cast<uintptr_t>(Fixnum::from(1)));
break;
case InstructionSequence::insn_meta_push_2:
cache_stack();
- s.push((int)Fixnum::from(2));
+ s.push(reinterpret_cast<uintptr_t>(Fixnum::from(2)));
break;
case InstructionSequence::insn_meta_push_neg_1:
cache_stack();
- s.push((int)Fixnum::from(-1));
+ s.push(reinterpret_cast<uintptr_t>(Fixnum::from(-1)));
break;
case InstructionSequence::insn_push_int:
cache_stack();
- s.push((int)Fixnum::from(vmm->opcodes[i + 1]));
+ s.push(reinterpret_cast<uintptr_t>(Fixnum::from(vmm->opcodes[i + 1])));
break;
case InstructionSequence::insn_push_self:
cache_stack();
--
1.6.0.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment