Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changed all OBJECT, SYMBOL, FIXNUM, INTEGER to normal syntax.

* I.e., s/OBJECT/Object*/ &c.
  • Loading branch information...
commit 1fdd151d4b0c487df2512133159cf8f775ac05ff 1 parent 3a0e9a4
Eero Saynatkari rue authored
Showing with 1,744 additions and 1,691 deletions.
  1. +2 −2 vm/builtin/access_variable.hpp
  2. +11 −11 vm/builtin/array.cpp
  3. +12 −12 vm/builtin/array.hpp
  4. +61 −61 vm/builtin/bignum.cpp
  5. +54 −54 vm/builtin/bignum.hpp
  6. +3 −3 vm/builtin/block_environment.cpp
  7. +2 −2 vm/builtin/block_environment.hpp
  8. +9 −9 vm/builtin/bytearray.cpp
  9. +9 −9 vm/builtin/bytearray.hpp
  10. +13 −13 vm/builtin/channel.cpp
  11. +9 −9 vm/builtin/channel.hpp
  12. +4 −4 vm/builtin/class.cpp
  13. +6 −6 vm/builtin/class.hpp
  14. +8 −8 vm/builtin/compactlookuptable.cpp
  15. +4 −4 vm/builtin/compactlookuptable.hpp
  16. +3 −3 vm/builtin/compiledmethod.cpp
  17. +9 −9 vm/builtin/compiledmethod.hpp
  18. +10 −11 vm/builtin/contexts.cpp
  19. +19 −19 vm/builtin/contexts.hpp
  20. +5 −5 vm/builtin/dir.cpp
  21. +5 −5 vm/builtin/dir.hpp
  22. +7 −7 vm/builtin/exception.cpp
  23. +7 −7 vm/builtin/exception.hpp
  24. +2 −2 vm/builtin/executable.cpp
  25. +3 −3 vm/builtin/executable.hpp
  26. +45 −45 vm/builtin/fixnum.cpp
  27. +49 −50 vm/builtin/fixnum.hpp
  28. +29 −29 vm/builtin/float.cpp
  29. +30 −30 vm/builtin/float.hpp
  30. +7 −7 vm/builtin/immediates.cpp
  31. +7 −7 vm/builtin/immediates.hpp
  32. +14 −14 vm/builtin/integer.cpp
  33. +6 −6 vm/builtin/integer.hpp
  34. +12 −12 vm/builtin/io.cpp
  35. +19 −19 vm/builtin/io.hpp
  36. +1 −1  vm/builtin/iseq.hpp
  37. +3 −3 vm/builtin/list.cpp
  38. +6 −6 vm/builtin/list.hpp
  39. +18 −18 vm/builtin/lookuptable.cpp
  40. +16 −16 vm/builtin/lookuptable.hpp
  41. +13 −12 vm/builtin/memorypointer.cpp
  42. +8 −8 vm/builtin/memorypointer.hpp
  43. +1 −1  vm/builtin/methodvisibility.cpp
  44. +2 −2 vm/builtin/methodvisibility.hpp
  45. +12 −12 vm/builtin/module.cpp
  46. +12 −12 vm/builtin/module.hpp
  47. +12 −11 vm/builtin/nativefunction.cpp
  48. +7 −7 vm/builtin/nativefunction.hpp
  49. +30 −30 vm/builtin/object.cpp
  50. +28 −28 vm/builtin/object.hpp
  51. +11 −11 vm/builtin/regexp.cpp
  52. +5 −5 vm/builtin/regexp.hpp
  53. +5 −5 vm/builtin/selector.cpp
  54. +5 −5 vm/builtin/selector.hpp
  55. +9 −9 vm/builtin/sendsite.cpp
  56. +6 −6 vm/builtin/sendsite.hpp
  57. +29 −29 vm/builtin/string.cpp
  58. +19 −19 vm/builtin/string.hpp
  59. +5 −5 vm/builtin/symbol.cpp
  60. +4 −5 vm/builtin/symbol.hpp
  61. +10 −10 vm/builtin/system.cpp
  62. +10 −10 vm/builtin/system.hpp
  63. +31 −31 vm/builtin/task.cpp
  64. +24 −24 vm/builtin/task.hpp
  65. +6 −6 vm/builtin/taskprobe.cpp
  66. +5 −5 vm/builtin/taskprobe.hpp
  67. +2 −2 vm/builtin/thread.cpp
  68. +6 −6 vm/builtin/thread.hpp
  69. +14 −14 vm/builtin/time.cpp
  70. +3 −3 vm/builtin/time.hpp
  71. +15 −15 vm/builtin/tuple.cpp
  72. +14 −14 vm/builtin/tuple.hpp
  73. +11 −13 vm/codegen/field_extract.rb
  74. +4 −4 vm/compiled_file.cpp
  75. +7 −1 vm/compiled_file.hpp
  76. +1 −0  vm/environment.cpp
  77. +16 −2 vm/event.cpp
  78. +2 −2 vm/event.hpp
  79. +1 −1  vm/exception.cpp
  80. +3 −3 vm/exception.hpp
  81. +7 −7 vm/gc.cpp
  82. +6 −3 vm/gc.hpp
  83. +13 −13 vm/gc_baker.cpp
  84. +13 −13 vm/gc_baker.hpp
  85. +2 −2 vm/gc_debug.cpp
  86. +6 −3 vm/gc_debug.hpp
  87. +9 −9 vm/gc_marksweep.cpp
  88. +8 −8 vm/gc_marksweep.hpp
  89. +2 −2 vm/gc_root.cpp
  90. +10 −10 vm/gc_root.hpp
  91. +5 −5 vm/global_cache.hpp
  92. +13 −11 vm/globals.hpp
  93. +113 −113 vm/instructions.rb
  94. +5 −5 vm/llvm/instructions.cpp
  95. +15 −15 vm/marshal.cpp
  96. +7 −6 vm/marshal.hpp
  97. +5 −5 vm/message.cpp
  98. +11 −11 vm/message.hpp
  99. +17 −17 vm/objectmemory.cpp
  100. +13 −13 vm/objectmemory.hpp
  101. +1 −1  vm/ontology.cpp
  102. +11 −11 vm/oop.hpp
  103. +3 −1 vm/prelude.hpp
  104. +12 −5 vm/primitives.hpp
  105. +5 −5 vm/symboltable.cpp
  106. +7 −5 vm/symboltable.hpp
  107. +7 −7 vm/test/test_access_variable.hpp
  108. +1 −1  vm/test/test_array.hpp
  109. +18 −18 vm/test/test_bignum.hpp
  110. +24 −24 vm/test/test_bytearray.hpp
  111. +8 −8 vm/test/test_channel.hpp
  112. +3 −2 vm/test/test_compactlookuptable.hpp
  113. +1 −1  vm/test/test_contexts.hpp
  114. +3 −3 vm/test/test_dir.hpp
  115. +3 −3 vm/test/test_event.hpp
  116. +4 −4 vm/test/test_exception.hpp
  117. +54 −54 vm/test/test_fixnum.hpp
  118. +1 −1  vm/test/test_float.hpp
  119. +8 −8 vm/test/test_integer.hpp
  120. +4 −4 vm/test/test_io.hpp
  121. +2 −1  vm/test/test_list.hpp
  122. +25 −25 vm/test/test_lookuptable.hpp
  123. +44 −44 vm/test/test_memorypointer.hpp
  124. +3 −3 vm/test/test_message.hpp
  125. +41 −41 vm/test/test_nativefunction.hpp
  126. +31 −31 vm/test/test_object.hpp
  127. +19 −15 vm/test/test_objectmemory.hpp
  128. +12 −12 vm/test/test_profiler.hpp
  129. +13 −13 vm/test/test_regexp.hpp
  130. +1 −1  vm/test/test_selector.hpp
  131. +10 −10 vm/test/test_sendsite.hpp
  132. +13 −13 vm/test/test_string.hpp
  133. +9 −7 vm/test/test_symboltable.hpp
  134. +7 −7 vm/test/test_task.hpp
  135. +1 −1  vm/test/test_thread.hpp
  136. +17 −17 vm/test/test_time.hpp
  137. +1 −1  vm/test/test_tuple.hpp
  138. +17 −17 vm/test/test_unmarshal.hpp
  139. +11 −11 vm/test/test_vm.hpp
  140. +12 −12 vm/type_info.cpp
  141. +15 −16 vm/type_info.hpp
  142. +4 −1 vm/virtual.hpp
  143. +10 −10 vm/vm.cpp
  144. +10 −10 vm/vm.hpp
  145. +3 −3 vm/vmmethod.cpp
  146. +8 −3 vm/vmmethod.hpp
4 vm/builtin/access_variable.hpp
View
@@ -17,8 +17,8 @@ namespace rubinius {
const static object_type type = AccessVariableType;
private:
- SYMBOL name_; // slot
- OBJECT write_; // slot
+ Symbol* name_; // slot
+ Object* write_; // slot
public:
/* accessors */
22 vm/builtin/array.cpp
View
@@ -54,7 +54,7 @@ namespace rubinius {
// code makes sure we're only called when the arity and type are correct.
// Thus we know that this is a simple a[n] case only, which we can
// fully handle.
- OBJECT Array::aref(STATE, Fixnum* idx) {
+ Object* Array::aref(STATE, Fixnum* idx) {
native_int index = idx->to_native();
const native_int start = start_->to_native();
const native_int total = start + total_->to_native();
@@ -72,7 +72,7 @@ namespace rubinius {
return tuple_->at(state, index);
}
- OBJECT Array::aset(STATE, Fixnum* idx, OBJECT val) {
+ Object* Array::aset(STATE, Fixnum* idx, Object* val) {
native_int index = idx->to_native();
if(index < 0) {
@@ -82,7 +82,7 @@ namespace rubinius {
return this->set(state, index, val);
}
- OBJECT Array::get(STATE, size_t idx) {
+ Object* Array::get(STATE, size_t idx) {
if(idx >= (size_t)total_->to_native()) {
return Qnil;
}
@@ -92,7 +92,7 @@ namespace rubinius {
return tuple_->at(state, idx);
}
- OBJECT Array::set(STATE, size_t idx, OBJECT val) {
+ Object* Array::set(STATE, size_t idx, Object* val) {
size_t cur, oidx;
Tuple* tup = tuple_;
@@ -125,7 +125,7 @@ namespace rubinius {
return val;
}
- void Array::unshift(STATE, OBJECT val) {
+ void Array::unshift(STATE, Object* val) {
size_t new_size = total_->to_native() + 1;
Tuple* nt = Tuple::create(state, new_size);
for(size_t i = 0; i < (size_t)total_->to_native(); i++) {
@@ -139,19 +139,19 @@ namespace rubinius {
tuple(state, nt);
}
- OBJECT Array::shift(STATE) {
- OBJECT obj = get(state, 0);
+ Object* Array::shift(STATE) {
+ Object* obj = get(state, 0);
start(state, Fixnum::from(start_->to_native() + 1));
total(state, Fixnum::from(total_->to_native() - 1));
return obj;
}
- OBJECT Array::append(STATE, OBJECT val) {
+ Object* Array::append(STATE, Object* val) {
set(state, (size_t)total_->to_native(), val);
return val;
}
- bool Array::includes_p(STATE, OBJECT val) {
+ bool Array::includes_p(STATE, Object* val) {
size_t max = size();
for(size_t i = 0; i < max; i++) {
@@ -161,7 +161,7 @@ namespace rubinius {
return false;
}
- void Array::Info::show(STATE, OBJECT self, int level) {
+ void Array::Info::show(STATE, Object* self, int level) {
Array* ary = as<Array>(self);
size_t size = ary->size();
size_t stop = size < 5 ? size : 5;
@@ -176,7 +176,7 @@ namespace rubinius {
++level;
for(size_t i = 0; i < stop; i++) {
indent(level);
- OBJECT obj = ary->get(state, i);
+ Object* obj = ary->get(state, i);
if(obj == ary) {
class_info(state, obj, true);
} else {
24 vm/builtin/array.hpp
View
@@ -14,10 +14,10 @@ namespace rubinius {
const static object_type type = ArrayType;
private:
- INTEGER total_; // slot
+ Integer* total_; // slot
Tuple* tuple_; // slot
- INTEGER start_; // slot
- OBJECT shared_; // slot
+ Integer* start_; // slot
+ Object* shared_; // slot
public:
/* accessors */
@@ -36,22 +36,22 @@ namespace rubinius {
void setup(STATE, size_t size);
// Ruby.primitive :array_aref
- OBJECT aref(STATE, Fixnum* idx);
+ Object* aref(STATE, Fixnum* idx);
// Ruby.primitive :array_aset
- OBJECT aset(STATE, Fixnum* idx, OBJECT val);
+ Object* aset(STATE, Fixnum* idx, Object* val);
- OBJECT get(STATE, size_t idx);
- OBJECT set(STATE, size_t idx, OBJECT val);
- void unshift(STATE, OBJECT val);
- OBJECT shift(STATE);
- OBJECT append(STATE, OBJECT val);
- bool includes_p(STATE, OBJECT val);
+ Object* get(STATE, size_t idx);
+ Object* set(STATE, size_t idx, Object* val);
+ void unshift(STATE, Object* val);
+ Object* shift(STATE);
+ Object* append(STATE, Object* val);
+ bool includes_p(STATE, Object* val);
class Info : public TypeInfo {
public:
BASIC_TYPEINFO(TypeInfo)
- virtual void show(STATE, OBJECT self, int level);
+ virtual void show(STATE, Object* self, int level);
};
};
};
122 vm/builtin/bignum.cpp
View
@@ -189,20 +189,20 @@ namespace rubinius {
mp_clear(&b);
}
- void Bignum::Info::cleanup(OBJECT obj) {
+ void Bignum::Info::cleanup(Object* obj) {
Bignum* big = as<Bignum>(obj);
mp_int *n = big->mp_val();
mp_clear(n);
}
- void Bignum::Info::mark(OBJECT obj, ObjectMark& mark) { }
+ void Bignum::Info::mark(Object* obj, ObjectMark& mark) { }
- void Bignum::Info::show(STATE, OBJECT self, int level) {
+ void Bignum::Info::show(STATE, Object* self, int level) {
Bignum* b = as<Bignum>(self);
std::cout << b->to_s(state, Fixnum::from(10))->c_str() << std::endl;
}
- void Bignum::Info::show_simple(STATE, OBJECT self, int level) {
+ void Bignum::Info::show_simple(STATE, Object* self, int level) {
show(state, self, level);
}
@@ -298,7 +298,7 @@ namespace rubinius {
return ret;
}
- Bignum* Bignum::create(STATE, FIXNUM val) {
+ Bignum* Bignum::create(STATE, Fixnum* val) {
return Bignum::from(state, val->to_native());
}
@@ -345,7 +345,7 @@ namespace rubinius {
return out;
}
- INTEGER Bignum::normalize(STATE, Bignum* b) {
+ Integer* Bignum::normalize(STATE, Bignum* b) {
mp_clamp(b->mp_val());
if((size_t)mp_count_bits(b->mp_val()) <= FIXNUM_WIDTH) {
@@ -356,7 +356,7 @@ namespace rubinius {
return b;
}
- INTEGER Bignum::add(STATE, FIXNUM b) {
+ Integer* Bignum::add(STATE, Fixnum* b) {
NMP;
native_int bi = b->to_native();
if(bi > 0) {
@@ -367,7 +367,7 @@ namespace rubinius {
return Bignum::normalize(state, n_obj);
}
- INTEGER Bignum::add(STATE, Bignum* b) {
+ Integer* Bignum::add(STATE, Bignum* b) {
NMP;
mp_add(mp_val(), b->mp_val(), n);
return Bignum::normalize(state, n_obj);
@@ -377,7 +377,7 @@ namespace rubinius {
return b->add(state, this);
}
- INTEGER Bignum::sub(STATE, FIXNUM b) {
+ Integer* Bignum::sub(STATE, Fixnum* b) {
NMP;
native_int bi = b->to_native();
if(bi > 0) {
@@ -388,7 +388,7 @@ namespace rubinius {
return Bignum::normalize(state, n_obj);
}
- INTEGER Bignum::sub(STATE, Bignum* b) {
+ Integer* Bignum::sub(STATE, Bignum* b) {
NMP;
mp_sub(mp_val(), b->mp_val(), n);
return Bignum::normalize(state, n_obj);
@@ -398,7 +398,7 @@ namespace rubinius {
return Float::coerce(state, this)->sub(state, b);
}
- INTEGER Bignum::mul(STATE, FIXNUM b) {
+ Integer* Bignum::mul(STATE, Fixnum* b) {
NMP;
native_int bi = b->to_native();
@@ -415,7 +415,7 @@ namespace rubinius {
return Bignum::normalize(state, n_obj);
}
- INTEGER Bignum::mul(STATE, Bignum* b) {
+ Integer* Bignum::mul(STATE, Bignum* b) {
NMP;
mp_mul(mp_val(), b->mp_val(), n);
return Bignum::normalize(state, n_obj);
@@ -425,7 +425,7 @@ namespace rubinius {
return b->mul(state, this);
}
- INTEGER Bignum::divide(STATE, FIXNUM denominator, INTEGER* remainder) {
+ Integer* Bignum::divide(STATE, Fixnum* denominator, Integer** remainder) {
if(denominator->to_native() == 0) {
Exception::zero_division_error(state, "divided by 0");
}
@@ -458,7 +458,7 @@ namespace rubinius {
return Bignum::normalize(state, n_obj);
}
- INTEGER Bignum::divide(STATE, Bignum* b, INTEGER* remainder) {
+ Integer* Bignum::divide(STATE, Bignum* b, Integer** remainder) {
if(mp_cmp_d(b->mp_val(), 0) == MP_EQ) {
Exception::zero_division_error(state, "divided by 0");
}
@@ -477,11 +477,11 @@ namespace rubinius {
return Bignum::normalize(state, n_obj);
}
- INTEGER Bignum::div(STATE, FIXNUM denominator) {
+ Integer* Bignum::div(STATE, Fixnum* denominator) {
return divide(state, denominator, NULL);
}
- INTEGER Bignum::div(STATE, Bignum* denominator) {
+ Integer* Bignum::div(STATE, Bignum* denominator) {
return divide(state, denominator, NULL);
}
@@ -489,9 +489,9 @@ namespace rubinius {
return Float::coerce(state, this)->div(state, other);
}
- Array* Bignum::divmod(STATE, FIXNUM denominator) {
- INTEGER mod = Fixnum::from(0);
- INTEGER quotient = divide(state, denominator, &mod);
+ Array* Bignum::divmod(STATE, Fixnum* denominator) {
+ Integer* mod = Fixnum::from(0);
+ Integer* quotient = divide(state, denominator, &mod);
Array* ary = Array::create(state, 2);
ary->set(state, 0, quotient);
@@ -501,8 +501,8 @@ namespace rubinius {
}
Array* Bignum::divmod(STATE, Bignum* denominator) {
- INTEGER mod = Fixnum::from(0);
- INTEGER quotient = divide(state, denominator, &mod);
+ Integer* mod = Fixnum::from(0);
+ Integer* quotient = divide(state, denominator, &mod);
Array* ary = Array::create(state, 2);
ary->set(state, 0, quotient);
ary->set(state, 1, mod);
@@ -513,14 +513,14 @@ namespace rubinius {
return Float::coerce(state, this)->divmod(state, denominator);
}
- INTEGER Bignum::mod(STATE, FIXNUM denominator) {
- INTEGER mod = Fixnum::from(0);
+ Integer* Bignum::mod(STATE, Fixnum* denominator) {
+ Integer* mod = Fixnum::from(0);
divide(state, denominator, &mod);
return mod;
}
- INTEGER Bignum::mod(STATE, Bignum* denominator) {
- INTEGER mod = Fixnum::from(0);
+ Integer* Bignum::mod(STATE, Bignum* denominator) {
+ Integer* mod = Fixnum::from(0);
divide(state, denominator, &mod);
return mod;
}
@@ -529,7 +529,7 @@ namespace rubinius {
return Float::coerce(state, this)->mod(state, denominator);
}
- INTEGER Bignum::bit_and(STATE, INTEGER b) {
+ Integer* Bignum::bit_and(STATE, Integer* b) {
NMP;
if(kind_of<Fixnum>(b)) {
@@ -541,11 +541,11 @@ namespace rubinius {
return Bignum::normalize(state, n_obj);
}
- INTEGER Bignum::bit_and(STATE, Float* b) {
+ Integer* Bignum::bit_and(STATE, Float* b) {
return bit_and(state, Bignum::from_double(state, b->val));
}
- INTEGER Bignum::bit_or(STATE, INTEGER b) {
+ Integer* Bignum::bit_or(STATE, Integer* b) {
NMP;
if(kind_of<Fixnum>(b)) {
@@ -556,11 +556,11 @@ namespace rubinius {
return Bignum::normalize(state, n_obj);
}
- INTEGER Bignum::bit_or(STATE, Float* b) {
+ Integer* Bignum::bit_or(STATE, Float* b) {
return bit_or(state, Bignum::from_double(state, b->val));
}
- INTEGER Bignum::bit_xor(STATE, INTEGER b) {
+ Integer* Bignum::bit_xor(STATE, Integer* b) {
NMP;
if(kind_of<Fixnum>(b)) {
@@ -571,11 +571,11 @@ namespace rubinius {
return Bignum::normalize(state, n_obj);
}
- INTEGER Bignum::bit_xor(STATE, Float* b) {
+ Integer* Bignum::bit_xor(STATE, Float* b) {
return bit_xor(state, Bignum::from_double(state, b->val));
}
- INTEGER Bignum::invert(STATE) {
+ Integer* Bignum::invert(STATE) {
NMP;
mp_int a; mp_init(&a);
@@ -589,7 +589,7 @@ namespace rubinius {
return Bignum::normalize(state, n_obj);
}
- INTEGER Bignum::neg(STATE) {
+ Integer* Bignum::neg(STATE) {
NMP;
mp_neg(mp_val(), n);
@@ -599,7 +599,7 @@ namespace rubinius {
/* These 2 don't use mp_lshd because it shifts by internal digits,
not bits. */
- INTEGER Bignum::left_shift(STATE, INTEGER bits) {
+ Integer* Bignum::left_shift(STATE, Integer* bits) {
NMP;
int shift = bits->to_native();
if(shift < 0) {
@@ -612,7 +612,7 @@ namespace rubinius {
return Bignum::normalize(state, n_obj);
}
- INTEGER Bignum::right_shift(STATE, INTEGER bits) {
+ Integer* Bignum::right_shift(STATE, Integer* bits) {
NMP;
int shift = bits->to_native();
if(shift < 0) {
@@ -639,7 +639,7 @@ namespace rubinius {
return Bignum::normalize(state, n_obj);
}
- OBJECT Bignum::equal(STATE, FIXNUM b) {
+ Object* Bignum::equal(STATE, Fixnum* b) {
native_int bi = b->to_native();
mp_int* a = mp_val();
if(bi < 0) {
@@ -656,18 +656,18 @@ namespace rubinius {
return Qfalse;
}
- OBJECT Bignum::equal(STATE, Bignum* b) {
+ Object* Bignum::equal(STATE, Bignum* b) {
if(mp_cmp(mp_val(), b->mp_val()) == MP_EQ) {
return Qtrue;
}
return Qfalse;
}
- OBJECT Bignum::equal(STATE, Float* b) {
+ Object* Bignum::equal(STATE, Float* b) {
return Float::coerce(state, this)->equal(state, b);
}
- FIXNUM Bignum::compare(STATE, FIXNUM b) {
+ Fixnum* Bignum::compare(STATE, Fixnum* b) {
native_int bi = b->to_native();
mp_int* a = mp_val();
if(bi < 0) {
@@ -694,7 +694,7 @@ namespace rubinius {
return Fixnum::from(0);
}
- FIXNUM Bignum::compare(STATE, Bignum* b) {
+ Fixnum* Bignum::compare(STATE, Bignum* b) {
switch(mp_cmp(mp_val(), b->mp_val())) {
case MP_LT:
return Fixnum::from(-1);
@@ -704,11 +704,11 @@ namespace rubinius {
return Fixnum::from(0);
}
- FIXNUM Bignum::compare(STATE, Float* b) {
+ Fixnum* Bignum::compare(STATE, Float* b) {
return Float::coerce(state, this)->compare(state, b);
}
- OBJECT Bignum::gt(STATE, FIXNUM b) {
+ Object* Bignum::gt(STATE, Fixnum* b) {
native_int bi = b->to_native();
mp_int* a = mp_val();
@@ -730,18 +730,18 @@ namespace rubinius {
}
}
- OBJECT Bignum::gt(STATE, Bignum* b) {
+ Object* Bignum::gt(STATE, Bignum* b) {
if(mp_cmp(mp_val(), b->mp_val()) == MP_GT) {
return Qtrue;
}
return Qfalse;
}
- OBJECT Bignum::gt(STATE, Float* b) {
+ Object* Bignum::gt(STATE, Float* b) {
return Float::coerce(state, this)->gt(state, b);
}
- OBJECT Bignum::ge(STATE, FIXNUM b) {
+ Object* Bignum::ge(STATE, Fixnum* b) {
native_int bi = b->to_native();
mp_int* a = mp_val();
@@ -764,11 +764,11 @@ namespace rubinius {
}
}
- OBJECT Bignum::ge(STATE, Float* b) {
+ Object* Bignum::ge(STATE, Float* b) {
return Float::coerce(state, this)->ge(state, b);
}
- OBJECT Bignum::ge(STATE, Bignum* b) {
+ Object* Bignum::ge(STATE, Bignum* b) {
int r = mp_cmp(mp_val(), b->mp_val());
if(r == MP_GT || r == MP_EQ) {
return Qtrue;
@@ -776,7 +776,7 @@ namespace rubinius {
return Qfalse;
}
- OBJECT Bignum::lt(STATE, FIXNUM b) {
+ Object* Bignum::lt(STATE, Fixnum* b) {
native_int bi = b->to_native();
mp_int* a = mp_val();
@@ -798,18 +798,18 @@ namespace rubinius {
}
}
- OBJECT Bignum::lt(STATE, Bignum* b) {
+ Object* Bignum::lt(STATE, Bignum* b) {
if(mp_cmp(mp_val(), b->mp_val()) == MP_LT) {
return Qtrue;
}
return Qfalse;
}
- OBJECT Bignum::lt(STATE, Float* b) {
+ Object* Bignum::lt(STATE, Float* b) {
return Float::coerce(state, this)->lt(state, b);
}
- OBJECT Bignum::le(STATE, FIXNUM b) {
+ Object* Bignum::le(STATE, Fixnum* b) {
native_int bi = b->to_native();
mp_int* a = mp_val();
@@ -832,7 +832,7 @@ namespace rubinius {
}
}
- OBJECT Bignum::le(STATE, Bignum* b) {
+ Object* Bignum::le(STATE, Bignum* b) {
int r = mp_cmp(mp_val(), b->mp_val());
if(r == MP_LT || r == MP_EQ) {
return Qtrue;
@@ -840,7 +840,7 @@ namespace rubinius {
return Qfalse;
}
- OBJECT Bignum::le(STATE, Float* b) {
+ Object* Bignum::le(STATE, Float* b) {
return Float::coerce(state, this)->le(state, b);
}
@@ -848,7 +848,7 @@ namespace rubinius {
return Float::coerce(state, this);
}
- String* Bignum::to_s(STATE, INTEGER radix) {
+ String* Bignum::to_s(STATE, Integer* radix) {
char *buf;
int sz = 1024;
int k;
@@ -867,7 +867,7 @@ namespace rubinius {
}
}
- INTEGER Bignum::from_string_detect(STATE, const char *str) {
+ Integer* Bignum::from_string_detect(STATE, const char *str) {
const char *s;
int radix;
int sign;
@@ -909,7 +909,7 @@ namespace rubinius {
return Bignum::normalize(state, n_obj);
}
- INTEGER Bignum::from_string(STATE, const char *str, size_t radix) {
+ Integer* Bignum::from_string(STATE, const char *str, size_t radix) {
NMP;
mp_read_radix(n, str, radix);
return Bignum::normalize(state, n_obj);
@@ -953,11 +953,11 @@ namespace rubinius {
return res;
}
- INTEGER Bignum::from_float(STATE, Float* f) {
+ Integer* Bignum::from_float(STATE, Float* f) {
return Bignum::from_double(state, f->val);
}
- INTEGER Bignum::from_double(STATE, double d) {
+ Integer* Bignum::from_double(STATE, double d) {
NMP;
long i = 0;
@@ -1003,10 +1003,10 @@ namespace rubinius {
return ary;
}
- Array* Bignum::coerce(STATE, FIXNUM other) {
+ Array* Bignum::coerce(STATE, Fixnum* other) {
Array* ary = Array::create(state, 2);
- if(FIXNUM fix = try_as<Fixnum>(Bignum::normalize(state, this))) {
+ if(Fixnum* fix = try_as<Fixnum>(Bignum::normalize(state, this))) {
ary->set(state, 0, other);
ary->set(state, 1, fix);
} else {
@@ -1017,7 +1017,7 @@ namespace rubinius {
return ary;
}
- INTEGER Bignum::size(STATE)
+ Integer* Bignum::size(STATE)
{
int bits = mp_count_bits(mp_val());
int bytes = (bits + 7) / 8;
108 vm/builtin/bignum.hpp
View
@@ -39,131 +39,131 @@ namespace rubinius {
long long to_long_long();
unsigned long long to_ulong_long();
- static INTEGER normalize(STATE, Bignum* obj);
- static INTEGER from_string_detect(STATE, const char* str);
- static INTEGER from_string(STATE, const char* str, size_t radix);
- static INTEGER from_double(STATE, double d);
+ static Integer* normalize(STATE, Bignum* obj);
+ static Integer* from_string_detect(STATE, const char* str);
+ static Integer* from_string(STATE, const char* str, size_t radix);
+ static Integer* from_double(STATE, double d);
// Ruby.primitive :bignum_new
- static Bignum* create(STATE, FIXNUM f);
+ static Bignum* create(STATE, Fixnum* f);
// Ruby.primitive :bignum_from_float
- static INTEGER from_float(STATE, Float* f);
+ static Integer* from_float(STATE, Float* f);
// Ruby.primitive! :bignum_initialize_copy
Bignum* initialize_copy(STATE, Bignum* other);
// Ruby.primitive! :bignum_add
- INTEGER add(STATE, FIXNUM b);
+ Integer* add(STATE, Fixnum* b);
// Ruby.primitive! :bignum_add
- INTEGER add(STATE, Bignum* b);
+ Integer* add(STATE, Bignum* b);
// Ruby.primitive! :bignum_add
Float* add(STATE, Float* b);
// Ruby.primitive! :bignum_sub
- INTEGER sub(STATE, FIXNUM b);
+ Integer* sub(STATE, Fixnum* b);
// Ruby.primitive! :bignum_sub
- INTEGER sub(STATE, Bignum* b);
+ Integer* sub(STATE, Bignum* b);
// Ruby.primitive! :bignum_sub
Float* sub(STATE, Float* b);
// Ruby.primitive! :bignum_mul
- INTEGER mul(STATE, FIXNUM b);
+ Integer* mul(STATE, Fixnum* b);
// Ruby.primitive! :bignum_mul
- INTEGER mul(STATE, Bignum* b);
+ Integer* mul(STATE, Bignum* b);
// Ruby.primitive! :bignum_mul
Float* mul(STATE, Float* b);
- INTEGER divide(STATE, FIXNUM b, INTEGER* mod);
- INTEGER divide(STATE, Bignum* b, INTEGER* mod);
+ Integer* divide(STATE, Fixnum* b, Integer** mod);
+ Integer* divide(STATE, Bignum* b, Integer** mod);
// Ruby.primitive! :bignum_div
- INTEGER div(STATE, FIXNUM b);
+ Integer* div(STATE, Fixnum* b);
// Ruby.primitive! :bignum_div
- INTEGER div(STATE, Bignum* b);
+ Integer* div(STATE, Bignum* b);
// Ruby.primitive! :bignum_div
Float* div(STATE, Float* b);
// Ruby.primitive! :bignum_divmod
- Array* divmod(STATE, FIXNUM b);
+ Array* divmod(STATE, Fixnum* b);
// Ruby.primitive! :bignum_divmod
Array* divmod(STATE, Bignum* b);
// Ruby.primitive! :bignum_divmod
Array* divmod(STATE, Float* b);
// Ruby.primitive! :bignum_mod
- INTEGER mod(STATE, FIXNUM b);
+ Integer* mod(STATE, Fixnum* b);
// Ruby.primitive! :bignum_mod
- INTEGER mod(STATE, Bignum* b);
+ Integer* mod(STATE, Bignum* b);
// Ruby.primitive! :bignum_mod
Float* mod(STATE, Float* b);
// Ruby.primitive :bignum_invert
- INTEGER invert(STATE);
+ Integer* invert(STATE);
// Ruby.primitive :bignum_neg
- INTEGER neg(STATE);
+ Integer* neg(STATE);
// Ruby.primitive! :bignum_equal
- OBJECT equal(STATE, FIXNUM b);
+ Object* equal(STATE, Fixnum* b);
// Ruby.primitive! :bignum_equal
- OBJECT equal(STATE, Bignum* b);
+ Object* equal(STATE, Bignum* b);
// Ruby.primitive! :bignum_equal
- OBJECT equal(STATE, Float* b);
+ Object* equal(STATE, Float* b);
// Ruby.primitive! :bignum_compare
- FIXNUM compare(STATE, FIXNUM b);
+ Fixnum* compare(STATE, Fixnum* b);
// Ruby.primitive! :bignum_compare
- FIXNUM compare(STATE, Bignum* b);
+ Fixnum* compare(STATE, Bignum* b);
// Ruby.primitive! :bignum_compare
- FIXNUM compare(STATE, Float* b);
+ Fixnum* compare(STATE, Float* b);
// Ruby.primitive! :bignum_and
- INTEGER bit_and(STATE, INTEGER b);
+ Integer* bit_and(STATE, Integer* b);
// Ruby.primitive! :bignum_and
- INTEGER bit_and(STATE, Float* b);
+ Integer* bit_and(STATE, Float* b);
// Ruby.primitive! :bignum_or
- INTEGER bit_or(STATE, INTEGER b);
+ Integer* bit_or(STATE, Integer* b);
// Ruby.primitive! :bignum_or
- INTEGER bit_or(STATE, Float* b);
+ Integer* bit_or(STATE, Float* b);
// Ruby.primitive! :bignum_xor
- INTEGER bit_xor(STATE, INTEGER b);
+ Integer* bit_xor(STATE, Integer* b);
// Ruby.primitive! :bignum_xor
- INTEGER bit_xor(STATE, Float* b);
+ Integer* bit_xor(STATE, Float* b);
// Ruby.primitive :bignum_left_shift
- INTEGER left_shift(STATE, INTEGER bits);
+ Integer* left_shift(STATE, Integer* bits);
// Ruby.primitive :bignum_right_shift
- INTEGER right_shift(STATE, INTEGER bits);
+ Integer* right_shift(STATE, Integer* bits);
// Ruby.primitive! :bignum_gt
- OBJECT gt(STATE, FIXNUM b);
+ Object* gt(STATE, Fixnum* b);
// Ruby.primitive! :bignum_gt
- OBJECT gt(STATE, Bignum* b);
+ Object* gt(STATE, Bignum* b);
// Ruby.primitive! :bignum_gt
- OBJECT gt(STATE, Float* b);
+ Object* gt(STATE, Float* b);
// Ruby.primitive! :bignum_ge
- OBJECT ge(STATE, FIXNUM b);
+ Object* ge(STATE, Fixnum* b);
// Ruby.primitive! :bignum_ge
- OBJECT ge(STATE, Bignum* b);
+ Object* ge(STATE, Bignum* b);
// Ruby.primitive! :bignum_ge
- OBJECT ge(STATE, Float* b);
+ Object* ge(STATE, Float* b);
// Ruby.primitive! :bignum_lt
- OBJECT lt(STATE, FIXNUM b);
+ Object* lt(STATE, Fixnum* b);
// Ruby.primitive! :bignum_lt
- OBJECT lt(STATE, Bignum* b);
+ Object* lt(STATE, Bignum* b);
// Ruby.primitive! :bignum_lt
- OBJECT lt(STATE, Float* b);
+ Object* lt(STATE, Float* b);
// Ruby.primitive! :bignum_le
- OBJECT le(STATE, FIXNUM b);
+ Object* le(STATE, Fixnum* b);
// Ruby.primitive! :bignum_le
- OBJECT le(STATE, Bignum* b);
+ Object* le(STATE, Bignum* b);
// Ruby.primitive! :bignum_le
- OBJECT le(STATE, Float* b);
+ Object* le(STATE, Float* b);
// Ruby.primitive :bignum_to_float
Float* to_float(STATE);
@@ -171,24 +171,24 @@ namespace rubinius {
// Ruby.primitive! :bignum_coerce
Array* coerce(STATE, Bignum* other);
// Ruby.primitive! :bignum_coerce
- Array* coerce(STATE, FIXNUM other);
+ Array* coerce(STATE, Fixnum* other);
// Ruby.primitive :bignum_to_s
- String* to_s(STATE, INTEGER radix);
+ String* to_s(STATE, Integer* radix);
void into_string(STATE, size_t radix, char* buf, size_t sz);
double to_double(STATE);
// Ruby.primitive :bignum_size
- INTEGER size(STATE);
+ Integer* size(STATE);
hashval hash_bignum(STATE);
class Info : public TypeInfo {
public:
Info(object_type type, bool cleanup = true) : TypeInfo(type, true) { }
- virtual void mark(OBJECT t, ObjectMark& mark);
- virtual void cleanup(OBJECT obj);
- virtual void show(STATE, OBJECT self, int level);
- virtual void show_simple(STATE, OBJECT self, int level);
+ virtual void mark(Object* t, ObjectMark& mark);
+ virtual void cleanup(Object* obj);
+ virtual void show(STATE, Object* self, int level);
+ virtual void show_simple(STATE, Object* self, int level);
};
};
6 vm/builtin/block_environment.cpp
View
@@ -36,7 +36,7 @@ namespace rubinius {
}
void BlockEnvironment::call(STATE, Task* task, size_t args) {
- OBJECT val;
+ Object* val;
if(args > 0) {
Tuple* tup = Tuple::create(state, args);
for(int i = args - 1; i >= 0; i--) {
@@ -62,7 +62,7 @@ namespace rubinius {
}
void BlockEnvironment::call(STATE, Task* task, Message& msg) {
- OBJECT val;
+ Object* val;
if(msg.args() > 0) {
Tuple* tup = Tuple::create(state, msg.args());
for(int i = msg.args() - 1; i >= 0; i--) {
@@ -139,7 +139,7 @@ namespace rubinius {
return be;
}
- void BlockEnvironment::Info::show(STATE, OBJECT self, int level) {
+ void BlockEnvironment::Info::show(STATE, Object* self, int level) {
BlockEnvironment* be = as<BlockEnvironment>(self);
class_header(state, self);
4 vm/builtin/block_environment.hpp
View
@@ -21,7 +21,7 @@ namespace rubinius {
private:
MethodContext* home_; // slot
MethodContext* home_block_; // slot
- OBJECT local_count_; // slot
+ Object* local_count_; // slot
CompiledMethod* method_; // slot
public:
@@ -55,7 +55,7 @@ namespace rubinius {
class Info : public TypeInfo {
public:
BASIC_TYPEINFO(TypeInfo)
- virtual void show(STATE, OBJECT self, int level);
+ virtual void show(STATE, Object* self, int level);
};
};
};
18 vm/builtin/bytearray.cpp
View
@@ -20,7 +20,7 @@ namespace rubinius {
return (ByteArray*)state->om->new_object_bytes(G(bytearray), bytes);
}
- void ByteArray::Info::mark(OBJECT t, ObjectMark& mark) {
+ void ByteArray::Info::mark(Object* t, ObjectMark& mark) {
// TODO: implement
}
@@ -34,15 +34,15 @@ namespace rubinius {
return out;
}
- ByteArray* ByteArray::allocate(STATE, INTEGER bytes) {
+ ByteArray* ByteArray::allocate(STATE, Integer* bytes) {
return ByteArray::create(state, bytes->to_native());
}
- INTEGER ByteArray::size(STATE) {
+ Integer* ByteArray::size(STATE) {
return Integer::from(state, SIZE_OF_BODY(this));
}
- FIXNUM ByteArray::get_byte(STATE, INTEGER index) {
+ Fixnum* ByteArray::get_byte(STATE, Integer* index) {
native_int size = SIZE_OF_BODY(this);
native_int idx = index->to_native();
@@ -53,7 +53,7 @@ namespace rubinius {
return Fixnum::from(this->bytes[idx]);
}
- FIXNUM ByteArray::set_byte(STATE, INTEGER index, FIXNUM value) {
+ Fixnum* ByteArray::set_byte(STATE, Integer* index, Fixnum* value) {
native_int size = SIZE_OF_BODY(this);
native_int idx = index->to_native();
@@ -65,7 +65,7 @@ namespace rubinius {
return Fixnum::from(this->bytes[idx]);
}
- INTEGER ByteArray::move_bytes(STATE, INTEGER start, INTEGER count, INTEGER dest) {
+ Integer* ByteArray::move_bytes(STATE, Integer* start, Integer* count, Integer* dest) {
native_int size = SIZE_OF_BODY(this);
native_int src = start->to_native();
native_int cnt = count->to_native();
@@ -88,7 +88,7 @@ namespace rubinius {
return count;
}
- ByteArray* ByteArray::fetch_bytes(STATE, INTEGER start, INTEGER count) {
+ ByteArray* ByteArray::fetch_bytes(STATE, Integer* start, Integer* count) {
native_int size = SIZE_OF_BODY(this);
native_int src = start->to_native();
native_int cnt = count->to_native();
@@ -108,7 +108,7 @@ namespace rubinius {
return ba;
}
- FIXNUM ByteArray::compare_bytes(STATE, ByteArray* other, INTEGER a, INTEGER b) {
+ Fixnum* ByteArray::compare_bytes(STATE, ByteArray* other, Integer* a, Integer* b) {
native_int size = SIZE_OF_BODY(this);
native_int osize = SIZE_OF_BODY(other);
native_int slim = a->to_native();
@@ -155,7 +155,7 @@ namespace rubinius {
return other;
}
- OBJECT ByteArray::locate(STATE, String* pattern, Integer* start) {
+ Object* ByteArray::locate(STATE, String* pattern, Integer* start) {
native_int size = SIZE_OF_BODY(this);
const char *pat = pattern->byte_address();
native_int len = pattern->size();
18 vm/builtin/bytearray.hpp
View
@@ -20,10 +20,10 @@ namespace rubinius {
static ByteArray* create(STATE, size_t bytes);
// Ruby.primitive :bytearray_allocate
- static ByteArray* allocate(STATE, INTEGER bytes);
+ static ByteArray* allocate(STATE, Integer* bytes);
// Ruby.primitive :bytearray_size
- INTEGER size(STATE);
+ Integer* size(STATE);
// Return the number of bytes this ByteArray contains
size_t size() {
@@ -31,19 +31,19 @@ namespace rubinius {
}
// Ruby.primitive :bytearray_get_byte
- FIXNUM get_byte(STATE, INTEGER index);
+ Fixnum* get_byte(STATE, Integer* index);
// Ruby.primitive :bytearray_set_byte
- FIXNUM set_byte(STATE, INTEGER index, FIXNUM value);
+ Fixnum* set_byte(STATE, Integer* index, Fixnum* value);
// Ruby.primitive :bytearray_move_bytes
- INTEGER move_bytes(STATE, INTEGER start, INTEGER count, INTEGER dest);
+ Integer* move_bytes(STATE, Integer* start, Integer* count, Integer* dest);
// Ruby.primitive :bytearray_fetch_bytes
- ByteArray* fetch_bytes(STATE, INTEGER start, INTEGER count);
+ ByteArray* fetch_bytes(STATE, Integer* start, Integer* count);
// Ruby.primitive :bytearray_compare_bytes
- FIXNUM compare_bytes(STATE, ByteArray* other, INTEGER a, INTEGER b);
+ Fixnum* compare_bytes(STATE, ByteArray* other, Integer* a, Integer* b);
// Ruby.primitive :bytearray_dup_into
ByteArray* dup_into(STATE, ByteArray* other);
@@ -55,14 +55,14 @@ namespace rubinius {
*/
// Ruby.primitive :bytearray_locate
- OBJECT locate(STATE, String* pattern, Integer* start);
+ Object* locate(STATE, String* pattern, Integer* start);
char* to_chars(STATE);
class Info : public TypeInfo {
public:
Info(object_type type, bool cleanup = false): TypeInfo(type, cleanup) { }
- virtual void mark(OBJECT t, ObjectMark& mark);
+ virtual void mark(Object* t, ObjectMark& mark);
};
};
};
26 vm/builtin/channel.cpp
View
@@ -24,7 +24,7 @@ namespace rubinius {
return chan;
}
- OBJECT Channel::send(STATE, OBJECT val) {
+ Object* Channel::send(STATE, Object* val) {
if(!waiting_->empty_p()) {
Thread* thr = as<Thread>(waiting_->shift(state));
thr->set_top(state, val);
@@ -49,7 +49,7 @@ namespace rubinius {
task->active()->clear_stack(msg.stack);
if(!value_->nil_p()) {
- OBJECT val = as<List>(value_)->shift(state);
+ Object* val = as<List>(value_)->shift(state);
task->push(val);
return cExecuteContinue;
}
@@ -64,9 +64,9 @@ namespace rubinius {
return cExecuteRestart;
}
- OBJECT Channel::receive(STATE) {
+ Object* Channel::receive(STATE) {
if(!value_->nil_p()) {
- OBJECT val = as<List>(value_)->shift(state);
+ Object* val = as<List>(value_)->shift(state);
state->return_value(val);
return Qnil;
}
@@ -92,24 +92,24 @@ namespace rubinius {
SendToChannel(STATE, Channel* chan) : ObjectCallback(state), chan(state, chan) { }
- virtual OBJECT object() {
+ virtual Object* object() {
return chan.get();
}
- virtual void call(OBJECT obj) {
+ virtual void call(Object* obj) {
chan->send(state, obj);
}
};
- OBJECT Channel::send_on_signal(STATE, Channel* chan, FIXNUM signal) {
+ Object* Channel::send_on_signal(STATE, Channel* chan, Fixnum* signal) {
SendToChannel* cb = new SendToChannel(state, chan);
event::Signal* sig = new event::Signal(state, cb, signal->to_native());
state->signal_events->start(sig);
return signal;
}
- OBJECT Channel::send_on_readable(STATE, Channel* chan, IO* io,
- IOBuffer* buffer, FIXNUM bytes) {
+ Object* Channel::send_on_readable(STATE, Channel* chan, IO* io,
+ IOBuffer* buffer, Fixnum* bytes) {
SendToChannel* cb = new SendToChannel(state, chan);
event::Read* sig = new event::Read(state, cb, io->to_fd());
@@ -119,17 +119,17 @@ namespace rubinius {
return io;
}
- OBJECT Channel::send_in_microseconds(STATE, Channel* chan, Integer* useconds, OBJECT tag) {
+ Object* Channel::send_in_microseconds(STATE, Channel* chan, Integer* useconds, Object* tag) {
double seconds = useconds->to_native() / 1000000.0;
return send_in_seconds(state, chan, seconds, tag);
}
- OBJECT Channel::send_in_seconds(STATE, Channel* chan, Float* seconds, OBJECT tag) {
+ Object* Channel::send_in_seconds(STATE, Channel* chan, Float* seconds, Object* tag) {
return send_in_seconds(state, chan, seconds->to_double(state), tag);
}
- OBJECT Channel::send_in_seconds(STATE, Channel* chan, double seconds, OBJECT tag) {
+ Object* Channel::send_in_seconds(STATE, Channel* chan, double seconds, Object* tag) {
SendToChannel* cb = new SendToChannel(state, chan);
event::Timer* sig = new event::Timer(state, cb, seconds, tag);
state->events->start(sig);
@@ -155,7 +155,7 @@ namespace rubinius {
channel.set(chan, &GO(roots));
}
- void ChannelCallback::call(OBJECT obj) {
+ void ChannelCallback::call(Object* obj) {
channel->send(state, obj);
}
}
18 vm/builtin/channel.hpp
View
@@ -22,7 +22,7 @@ namespace rubinius {
const static object_type type = ChannelType;
private:
- OBJECT value_; // slot
+ Object* value_; // slot
List* waiting_; // slot
public:
@@ -37,26 +37,26 @@ namespace rubinius {
static Channel* create(STATE);
// Ruby.primitive :channel_send
- OBJECT send(STATE, OBJECT);
+ Object* send(STATE, Object*);
// Ruby.primitive? :channel_receive
ExecuteStatus receive_prim(STATE, Executable* exec, Task* task, Message& msg);
- OBJECT receive(STATE);
+ Object* receive(STATE);
bool has_readers_p();
// Ruby.primitive :scheduler_send_on_signal
- static OBJECT send_on_signal(STATE, Channel* chan, FIXNUM signal);
+ static Object* send_on_signal(STATE, Channel* chan, Fixnum* signal);
// Ruby.primitive :scheduler_send_on_readable
- static OBJECT send_on_readable(STATE, Channel* chan, IO* io, IOBuffer* buffer, FIXNUM bytes);
+ static Object* send_on_readable(STATE, Channel* chan, IO* io, IOBuffer* buffer, Fixnum* bytes);
// Ruby.primitive :scheduler_send_in_microseconds
- static OBJECT send_in_microseconds(STATE, Channel* chan, Integer* useconds, OBJECT tag);
+ static Object* send_in_microseconds(STATE, Channel* chan, Integer* useconds, Object* tag);
// Ruby.primitive :scheduler_send_in_seconds
- static OBJECT send_in_seconds(STATE, Channel* chan, Float* seconds, OBJECT tag);
- static OBJECT send_in_seconds(STATE, Channel* chan, double seconds, OBJECT tag);
+ static Object* send_in_seconds(STATE, Channel* chan, Float* seconds, Object* tag);
+ static Object* send_in_seconds(STATE, Channel* chan, double seconds, Object* tag);
/**
* Event child process ending.
@@ -77,7 +77,7 @@ namespace rubinius {
TypedRoot<Channel*> channel;
ChannelCallback(STATE, Channel* chan);
- virtual void call(OBJECT obj);
+ virtual void call(Object* obj);
};
}
8 vm/builtin/class.cpp
View
@@ -17,7 +17,7 @@ namespace rubinius {
Class* Class::create(STATE, Class* super) {
Class* cls = (Class*)state->new_object(G(klass));
- cls->name(state, (SYMBOL)Qnil);
+ cls->name(state, (Symbol*)Qnil);
cls->instance_fields(state, super->instance_fields());
cls->instance_type(state, super->instance_type());
cls->superclass(state, super);
@@ -33,11 +33,11 @@ namespace rubinius {
return as<Class>(state->new_object(G(klass)));
}
- OBJECT Class::allocate(STATE) {
+ Object* Class::allocate(STATE) {
return state->new_object(this);
}
- MetaClass* MetaClass::attach(STATE, OBJECT obj, OBJECT sup) {
+ MetaClass* MetaClass::attach(STATE, Object* obj, Object* sup) {
MetaClass *meta;
meta = (MetaClass*)state->new_object(G(metaclass));
@@ -51,7 +51,7 @@ namespace rubinius {
return meta;
}
- void MetaClass::Info::show(STATE, OBJECT self, int level) {
+ void MetaClass::Info::show(STATE, Object* self, int level) {
MetaClass* cls = as<MetaClass>(self);
Module* mod = try_as<Module>(cls->attached_instance());
12 vm/builtin/class.hpp
View
@@ -15,8 +15,8 @@ namespace rubinius {
const static object_type type = ClassType;
private:
- FIXNUM instance_fields_; // slot
- FIXNUM instance_type_; // slot
+ Fixnum* instance_fields_; // slot
+ Fixnum* instance_type_; // slot
public:
/* accessors */
@@ -36,7 +36,7 @@ namespace rubinius {
static Class* s_allocate(STATE);
// Ruby.primitive :class_allocate
- OBJECT allocate(STATE);
+ Object* allocate(STATE);
class Info : public Module::Info {
public:
@@ -50,7 +50,7 @@ namespace rubinius {
const static object_type type = MetaClassType;
private:
- OBJECT attached_instance_; // slot
+ Object* attached_instance_; // slot
public:
/* accessors */
@@ -59,12 +59,12 @@ namespace rubinius {
/* interface */
- static MetaClass* attach(STATE, OBJECT obj, OBJECT sup = NULL);
+ static MetaClass* attach(STATE, Object* obj, Object* sup = NULL);
class Info : public Class::Info {
public:
BASIC_TYPEINFO(Class::Info)
- virtual void show(STATE, OBJECT self, int level);
+ virtual void show(STATE, Object* self, int level);
};
};
};
16 vm/builtin/compactlookuptable.cpp
View
@@ -22,7 +22,7 @@ namespace rubinius {
COMPACTLOOKUPTABLE_SIZE);
}
- OBJECT CompactLookupTable::fetch(STATE, OBJECT key) {
+ Object* CompactLookupTable::fetch(STATE, Object* key) {
for(unsigned int i = 0; i < COMPACTLOOKUPTABLE_SIZE; i += 2) {
if(at(state, i) == key) return at(state, i + 1);
}
@@ -30,9 +30,9 @@ namespace rubinius {
return Qnil;
}
- OBJECT CompactLookupTable::store(STATE, OBJECT key, OBJECT val) {
+ Object* CompactLookupTable::store(STATE, Object* key, Object* val) {
for(unsigned int i = 0; i < COMPACTLOOKUPTABLE_SIZE; i += 2) {
- OBJECT tmp = at(state, i);
+ Object* tmp = at(state, i);
if(tmp == key || tmp->nil_p()) {
put(state, i, key);
put(state, i + 1, val);
@@ -43,7 +43,7 @@ namespace rubinius {
return Qfalse;
}
- OBJECT CompactLookupTable::has_key(STATE, OBJECT key) {
+ Object* CompactLookupTable::has_key(STATE, Object* key) {
for(unsigned int i = 0; i < COMPACTLOOKUPTABLE_SIZE; i += 2) {
if(at(state, i) == key) return Qtrue;
}
@@ -55,7 +55,7 @@ namespace rubinius {
Array* ary = Array::create(state, COMPACTLOOKUPTABLE_SIZE / 2);
for(unsigned int i = 0; i < COMPACTLOOKUPTABLE_SIZE; i += 2) {
- OBJECT key = at(state, i);
+ Object* key = at(state, i);
if(!key->nil_p()) ary->append(state, key);
}
@@ -66,7 +66,7 @@ namespace rubinius {
Array* ary = Array::create(state, COMPACTLOOKUPTABLE_SIZE / 2);
for(unsigned int i = 0; i < COMPACTLOOKUPTABLE_SIZE; i += 2) {
- OBJECT key = at(state, i);
+ Object* key = at(state, i);
if(!key->nil_p()) ary->append(state, at(state, i + 1));
}
@@ -77,14 +77,14 @@ namespace rubinius {
LookupTable* tbl = (LookupTable*)LookupTable::create(state);
for(unsigned int i = 0; i < COMPACTLOOKUPTABLE_SIZE; i += 2) {
- OBJECT key = at(state, i);
+ Object* key = at(state, i);
if(!key->nil_p()) tbl->store(state, key, at(state, i + 1));
}
return tbl;
}
- void CompactLookupTable::Info::show(STATE, OBJECT self, int level) {
+ void CompactLookupTable::Info::show(STATE, Object* self, int level) {
CompactLookupTable* tbl = as<CompactLookupTable>(self);
Array* keys = tbl->keys(state);
size_t size = keys->size();
8 vm/builtin/compactlookuptable.hpp
View
@@ -22,13 +22,13 @@ namespace rubinius {
static CompactLookupTable* create(STATE);
// Ruby.primitive :compactlookuptable_fetch
- OBJECT fetch(STATE, OBJECT key);
+ Object* fetch(STATE, Object* key);
// Ruby.primitive :compactlookuptable_store
- OBJECT store(STATE, OBJECT key, OBJECT val);
+ Object* store(STATE, Object* key, Object* val);
// Ruby.primitive :compactlookuptable_has_key
- OBJECT has_key(STATE, OBJECT key);
+ Object* has_key(STATE, Object* key);
// Ruby.primitive :compactlookuptable_keys
Array* keys(STATE);
@@ -41,7 +41,7 @@ namespace rubinius {
class Info : public Tuple::Info {
public:
Info(object_type type, bool cleanup = false) : Tuple::Info(type, cleanup) { }
- virtual void show(STATE, OBJECT self, int level);
+ virtual void show(STATE, Object* self, int level);
};
};
};
6 vm/builtin/compiledmethod.cpp
View
@@ -81,7 +81,7 @@ namespace rubinius {
backend_method_ = vmm;
if(!primitive()->nil_p()) {
- if(SYMBOL name = try_as<Symbol>(primitive())) {
+ if(Symbol* name = try_as<Symbol>(primitive())) {
set_executor(Primitives::resolve_primitive(state, name));
}
}
@@ -95,7 +95,7 @@ namespace rubinius {
backend_method_->specialize(state, ti);
}
- OBJECT CompiledMethod::compile(STATE) {
+ Object* CompiledMethod::compile(STATE) {
backend_method_ = NULL;
formalize(state);
return this;
@@ -115,7 +115,7 @@ namespace rubinius {
return local_count_->to_native();
}
- void CompiledMethod::Info::show(STATE, OBJECT self, int level) {
+ void CompiledMethod::Info::show(STATE, Object* self, int level) {
CompiledMethod* cm = as<CompiledMethod>(self);
class_header(state, self);
18 vm/builtin/compiledmethod.hpp
View
@@ -18,18 +18,18 @@ namespace rubinius {
const static size_t saved_fields = 16;
private:
- SYMBOL name_; // slot
+ Symbol* name_; // slot
InstructionSequence* iseq_; // slot
- FIXNUM stack_size_; // slot
- FIXNUM local_count_; // slot
- FIXNUM required_args_; // slot
- FIXNUM total_args_; // slot
- OBJECT splat_; // slot
+ Fixnum* stack_size_; // slot
+ Fixnum* local_count_; // slot
+ Fixnum* required_args_; // slot
+ Fixnum* total_args_; // slot
+ Object* splat_; // slot
Tuple* literals_; // slot
Tuple* exceptions_; // slot
Tuple* lines_; // slot
Tuple* local_names_; // slot
- SYMBOL file_; // slot
+ Symbol* file_; // slot
StaticScope* scope_; // slot
public:
@@ -74,12 +74,12 @@ namespace rubinius {
static ExecuteStatus default_executor(STATE, Task*, Message&);
// Ruby.primitive :compiledmethod_compile
- OBJECT compile(STATE);
+ Object* compile(STATE);
class Info : public TypeInfo {
public:
BASIC_TYPEINFO(TypeInfo)
- virtual void show(STATE, OBJECT self, int level);
+ virtual void show(STATE, Object* self, int level);
};
};
21 vm/builtin/contexts.cpp
View
@@ -30,7 +30,7 @@ namespace rubinius {
/* Calculate how much big of an object (in bytes) to allocate
* for one with a body of +original+ and a stack of +stack+ */
static inline size_t add_stack(size_t original, size_t stack) {
- return original + (sizeof(OBJECT) * stack);
+ return original + (sizeof(Object*) * stack);
}
/* Initialize +ctx+'s fields */
@@ -97,9 +97,9 @@ namespace rubinius {
for(size_t i = 0; i < cm_->lines()->num_fields(); i++) {
Tuple* entry = as<Tuple>(cm_->lines()->at(state, i));
- FIXNUM start_ip = as<Fixnum>(entry->at(state, 0));
- FIXNUM end_ip = as<Fixnum>(entry->at(state, 1));
- FIXNUM line = as<Fixnum>(entry->at(state, 2));
+ Fixnum* start_ip = as<Fixnum>(entry->at(state, 0));
+ Fixnum* end_ip = as<Fixnum>(entry->at(state, 1));
+ Fixnum* line = as<Fixnum>(entry->at(state, 2));
if(start_ip->to_native() <= ip && end_ip->to_native() >= ip)
return line->to_native();
@@ -168,7 +168,7 @@ namespace rubinius {
* The returned MethodContext is in an 'initial' state. The caller is
* expected to SET any fields it needs to, e.g. +module+
*/
- MethodContext* MethodContext::create(STATE, OBJECT recv, CompiledMethod* meth) {
+ MethodContext* MethodContext::create(STATE, Object* recv, CompiledMethod* meth) {
MethodContext* ctx = allocate(state, G(methctx), meth->backend_method_->stack_size);
ctx->self(state, recv);
@@ -257,7 +257,7 @@ namespace rubinius {
/* Retrieve a field within the context, referenced by name. This
* is used as a primitive. */
- OBJECT MethodContext::get_internal_data(STATE, FIXNUM type) {
+ Object* MethodContext::get_internal_data(STATE, Fixnum* type) {
switch(type->to_native()) {
case 1:
return Fixnum::from(ip);
@@ -277,7 +277,7 @@ namespace rubinius {
return ctx;
}
- void MethodContext::Info::mark(OBJECT obj, ObjectMark& mark) {
+ void MethodContext::Info::mark(Object* obj, ObjectMark& mark) {
auto_mark(obj, mark);
MethodContext* ctx = as<MethodContext>(obj);
@@ -287,11 +287,10 @@ namespace rubinius {
}
/* Now also mark the stack */
- OBJECT stack_obj, marked;
for(size_t i = 0; i < ctx->stack_size; i++) {
- stack_obj = ctx->stack_at(i);
+ Object* stack_obj = ctx->stack_at(i);
if(!stack_obj) continue;
- marked = mark.call(stack_obj);
+ Object* marked = mark.call(stack_obj);
if(marked) {
ctx->stack_put(i, marked);
mark.just_set(ctx, marked);
@@ -299,7 +298,7 @@ namespace rubinius {
}
}
- void MethodContext::Info::show(STATE, OBJECT self, int level) {
+ void MethodContext::Info::show(STATE, Object* self, int level) {
MethodContext* ctx = as<MethodContext>(self);
class_header(state, self);
38 vm/builtin/contexts.hpp
View
@@ -24,13 +24,13 @@ namespace rubinius {
private:
MethodContext* sender_; // slot
MethodContext* home_; // slot
- OBJECT self_; // slot
+ Object* self_; // slot
CompiledMethod* cm_; // slot
Module* module_; // slot
- OBJECT block_; // slot
- OBJECT name_; // slot
+ Object* block_; // slot
+ Object* name_; // slot
public:
// TODO: fix up data members that aren't slots
@@ -44,7 +44,7 @@ namespace rubinius {
size_t stack_size;
// MUST BE AT THE LAST DATA MEMBER
- OBJECT stk[];
+ Object* stk[];
public:
/* accessors */
@@ -61,7 +61,7 @@ namespace rubinius {
static void init(STATE);
static MethodContext* create(STATE, size_t stack_size);
- static MethodContext* create(STATE, OBJECT recv, CompiledMethod* meth);
+ static MethodContext* create(STATE, Object* recv, CompiledMethod* meth);
static void initialize_cache(STATE);
static void reset_cache(STATE);
@@ -70,18 +70,18 @@ namespace rubinius {
void reference(STATE);
// Ruby.primitive :context_get_field
- OBJECT get_internal_data(STATE, FIXNUM type);
+ Object* get_internal_data(STATE, Fixnum* type);
// Ruby.primitive :context_dup
MethodContext* dup(STATE);
/* Locals manipulation functions */
/* Locals are just stored at the top of the stack. */
- void set_local(size_t pos, OBJECT val) {
+ void set_local(size_t pos, Object* val) {
stk[pos] = val;
}
- OBJECT get_local(size_t pos) {
+ Object* get_local(size_t pos) {
return stk[pos];
}
@@ -91,36 +91,36 @@ namespace rubinius {
js.stack -= amount;
}
- OBJECT pop() {
+ Object* pop() {
return *js.stack--;
}
- void push(OBJECT value) {
+ void push(Object* value) {
*++js.stack = value;
}
- OBJECT stack_back(size_t position) {
- OBJECT* pos = js.stack - position;
+ Object* stack_back(size_t position) {
+ Object** pos = js.stack - position;
return *pos;
}
- OBJECT* stack_back_position(size_t position) {
+ Object** stack_back_position(size_t position) {
return js.stack - position;
}
- OBJECT top() {
+ Object* top() {
return *js.stack;
}
- void set_top(OBJECT val) {
+ void set_top(Object* val) {
*js.stack = val;
}
- OBJECT stack_at(size_t pos) {
+ Object* stack_at(size_t pos) {
return stk[pos];
}
- void stack_put(size_t pos, OBJECT val) {
+ void stack_put(size_t pos, Object* val) {
stk[pos] = val;
}
@@ -140,8 +140,8 @@ namespace rubinius {
public:
BASIC_TYPEINFO(TypeInfo)
- virtual void mark(OBJECT, ObjectMark& mark);
- virtual void show(STATE, OBJECT self, int level);
+ virtual void mark(Object*, ObjectMark& mark);
+ virtual void show(STATE, Object* self, int level);
};
};
10 vm/builtin/dir.cpp
View
@@ -31,7 +31,7 @@ namespace rubinius {
}
}
- OBJECT Dir::open(STATE, String* path) {
+ Object* Dir::open(STATE, String* path) {
DIR* d = opendir(path->c_str());
if(!d) Exception::errno_error(state, "Unable to open directory");
@@ -40,7 +40,7 @@ namespace rubinius {
return Qnil;
}
- OBJECT Dir::close(STATE) {
+ Object* Dir::close(STATE) {
guard(state);
DIR* d = (DIR*)data_->pointer;
@@ -53,11 +53,11 @@ namespace rubinius {
return Qfalse;
}
- OBJECT Dir::closed_p(STATE) {
+ Object* Dir::closed_p(STATE) {
return data_->nil_p() ? Qtrue : Qfalse;
}
- OBJECT Dir::read(STATE) {
+ Object* Dir::read(STATE) {
guard(state);
DIR* d = (DIR*)data_->pointer;
@@ -68,7 +68,7 @@ namespace rubinius {
return String::create(state, ent->d_name);
}
- OBJECT Dir::control(STATE, FIXNUM kind, INTEGER pos) {
+ Object* Dir::control(STATE, Fixnum* kind, Integer* pos) {
guard(state);
DIR* d = (DIR*)data_->pointer;
10 vm/builtin/dir.hpp
View
@@ -26,15 +26,15 @@ namespace rubinius {
static void init(STATE);
static Dir* create(STATE);
// Ruby.primitive :dir_open
- OBJECT open(STATE, String *path);
+ Object* open(STATE, String *path);
// Ruby.primitive :dir_close
- OBJECT close(STATE);
+ Object* close(STATE);
// Ruby.primitive :dir_closed_p
- OBJECT closed_p(STATE);
+ Object* closed_p(STATE);
// Ruby.primitive :dir_read
- OBJECT read(STATE);
+ Object* read(STATE);
// Ruby.primitive :dir_control
- OBJECT control(STATE, FIXNUM kind, INTEGER pos);
+ Object* control(STATE, Fixnum* kind, Integer* pos);
void guard(STATE);
class Info : public TypeInfo {
14 vm/builtin/exception.cpp
View
@@ -50,7 +50,7 @@ namespace rubinius {
RubyException::raise(make_exception(state, get_argument_error(state), reason));
}
- Exception* Exception::make_type_error(STATE, object_type type, OBJECT object,
+ Exception* Exception::make_type_error(STATE, object_type type, Object* object,
const char* reason) {
std::ostringstream msg;
@@ -77,7 +77,7 @@ namespace rubinius {
RubyException::raise(make_exception(state, get_type_error(state), reason));
}
- void Exception::type_error(STATE, object_type type, OBJECT object,
+ void Exception::type_error(STATE, object_type type, Object* object,
const char* reason) {
RubyException::raise(make_type_error(state, type, object, reason));
}
@@ -102,7 +102,7 @@ namespace rubinius {
system_call_error(state, reason.c_str());
}
- void Exception::object_bounds_exceeded_error(STATE, OBJECT obj, size_t index) {
+ void Exception::object_bounds_exceeded_error(STATE, Object* obj, size_t index) {
TypeInfo* info = state->find_type(obj->obj_type); // HACK use object
std::ostringstream msg;
@@ -119,7 +119,7 @@ namespace rubinius {
get_object_bounds_exceeded_error(state), reason));
}
- Exception* Exception::make_errno_exception(STATE, Class* exc_class, OBJECT reason) {
+ Exception* Exception::make_errno_exception(STATE, Class* exc_class, Object* reason) {
Exception* exc = (Exception*)state->new_object(exc_class);
MethodContext* ctx = G(current_task)->active();
@@ -146,7 +146,7 @@ namespace rubinius {
}
/* exception_errno_error primitive */
- OBJECT Exception::errno_error(STATE, OBJECT reason, FIXNUM ern) {
+ Object* Exception::errno_error(STATE, Object* reason, Fixnum* ern) {
Class* exc_class = get_errno_error(state, ern);
if(exc_class->nil_p()) return Qnil;
@@ -244,7 +244,7 @@ namespace rubinius {
return as<Class>(G(object)->get_const(state, "SystemCallError"));
}
- Class* Exception::get_errno_error(STATE, FIXNUM ern) {
+ Class* Exception::get_errno_error(STATE, Fixnum* ern) {
if(Class* cls = try_as<Class>(G(errno_mapping)->fetch(state, ern))) {
return cls;
}
@@ -256,7 +256,7 @@ namespace rubinius {
return as<Class>(G(object)->get_const(state, "IOError"));
}
- void Exception::Info::show(STATE, OBJECT self, int level) {
+ void Exception::Info::show(STATE, Object* self, int level) {
Exception* exc = as<Exception>(self);
class_header(state, self);
14 vm/builtin/exception.hpp
View
@@ -31,22 +31,22 @@ namespace rubinius {
static Exception* create(STATE);
static Exception* make_exception(STATE, Class* exc_class, const char* message);
- static Exception* make_type_error(STATE, object_type type, OBJECT object,
+ static Exception* make_type_error(STATE, object_type type, Object* object,
const char* reason = NULL);
- static Exception* make_errno_exception(STATE, Class* exc_class, OBJECT reason);
+ static Exception* make_errno_exception(STATE, Class* exc_class, Object* reason);
static void argument_error(STATE, int expected, int given);
static void argument_error(STATE, const char* reason);
static void regexp_error(STATE, const char* reason);
static void type_error(STATE, const char* reason);
- static void type_error(STATE, object_type type, OBJECT object,
+ static void type_error(STATE, object_type type, Object* object,
const char* reason = NULL);
static void float_domain_error(STATE, const char* reason = NULL);
static void zero_division_error(STATE, const char* reason = NULL);
static void io_error(STATE, const char* reason);
static void assertion_error(STATE, const char* reason = NULL);
- static void object_bounds_exceeded_error(STATE, OBJECT obj, size_t index);
+ static void object_bounds_exceeded_error(STATE, Object* obj, size_t index);
static void object_bounds_exceeded_error(STATE, const char* reason);
/** Raise a SystemCallError with given message. */
@@ -54,7 +54,7 @@ namespace rubinius {
static void system_call_error(STATE, const std::string& reason);
// Ruby.primitive :exception_errno_error
- static OBJECT errno_error(STATE, OBJECT reason, FIXNUM ern);
+ static Object* errno_error(STATE, Object* reason, Fixnum* ern);
static void errno_error(STATE, const char* reason = NULL, int ern = 0);
/**
@@ -82,12 +82,12 @@ namespace rubinius {
static Class* get_object_bounds_exceeded_error(STATE);
static Class* get_io_error(STATE);
static Class* get_system_call_error(STATE);
- static Class* get_errno_error(STATE, FIXNUM ern);
+ static Class* get_errno_error(STATE, Fixnum* ern);
class Info : public TypeInfo {
public:
BASIC_TYPEINFO(TypeInfo)
- virtual void show(STATE, OBJECT self, int level);
+ virtual void show(STATE, Object* self, int level);
};
};
};
4 vm/builtin/executable.cpp
View
@@ -16,9 +16,9 @@ namespace rubinius {
G(executable)->set_object_type(state, ExecutableType);
}
- Executable* Executable::allocate(STATE, OBJECT self) {
+ Executable* Executable::allocate(STATE, Object* self) {
Executable* executable = (Executable*)state->new_object(G(executable));
- executable->primitive(state, (SYMBOL)Qnil);
+ executable->primitive(state, (Symbol*)Qnil);
executable->serial(state, Fixnum::from(0));
executable->set_executor(Executable::default_executor);
6 vm/builtin/executable.hpp
View
@@ -16,8 +16,8 @@ namespace rubinius {
const static object_type type = ExecutableType;
private:
- SYMBOL primitive_; // slot
- FIXNUM serial_; // slot
+ Symbol* primitive_; // slot
+ Fixnum* serial_; // slot
public:
// This one is public so it can be directly invoked.
@@ -34,7 +34,7 @@ namespace rubinius {
static ExecuteStatus default_executor(STATE, Task* task, Message& msg);
// Ruby.primitive :executable_allocate
- static Executable* allocate(STATE, OBJECT self);
+ static Executable* allocate(STATE, Object* self);
void set_executor(rubinius::executor exc) {
execute = exc;
90 vm/builtin/fixnum.cpp
View
@@ -37,7 +37,7 @@ namespace rubinius {
return (unsigned long long)STRIP_TAG(this);
}
- INTEGER Fixnum::add(STATE, Bignum* other) {
+ Integer* Fixnum::add(STATE, Bignum* other) {
return other->add(state, this);
}
@@ -45,7 +45,7 @@ namespace rubinius {
return other->add(state, this);
}
- INTEGER Fixnum::sub(STATE, Bignum* other) {
+ Integer* Fixnum::sub(STATE, Bignum* other) {
return as<Bignum>(other->neg(state))->add(state, this);
}
@@ -53,7 +53,7 @@ namespace rubinius {
return Float::coerce(state, this)->sub(state, other);
}
- INTEGER Fixnum::mul(STATE, FIXNUM other) {
+ Integer* Fixnum::mul(STATE, Fixnum* other) {
native_int a = to_native();
native_int b = other->to_native();
@@ -84,7 +84,7 @@ namespace rubinius {
return Fixnum::from(to_native() * other->to_native());
}
- INTEGER Fixnum::mul(STATE, Bignum* other) {
+ Integer* Fixnum::mul(STATE, Bignum* other) {
return other->mul(state, this);
}
@@ -92,7 +92,7 @@ namespace rubinius {
return other->mul(state, this);
}
- INTEGER Fixnum::div(STATE, FIXNUM other) {
+ Integer* Fixnum::div(STATE, Fixnum* other) {
if(other->to_native() == 0) {
Exception::zero_division_error(state, "divided by 0");
}
@@ -103,7 +103,7 @@ namespace rubinius {
return Fixnum::from(quotient);
}
- INTEGER Fixnum::div(STATE, Bignum* other) {
+ Integer* Fixnum::div(STATE, Bignum* other) {
return Bignum::from(state, to_native())->div(state, other);
}
@@ -111,14 +111,14 @@ namespace rubinius {
return Float::coerce(state, this)->div(state, other);
}
- INTEGER Fixnum::mod(STATE, FIXNUM other) {
+ Integer* Fixnum::mod(STATE, Fixnum* other) {
native_int numerator = to_native();
native_int denominator = other->to_native();
native_int quotient = div(state, other)->to_native();
return Fixnum::from(numerator - denominator * quotient);
}
- INTEGER Fixnum::mod(STATE, Bignum* other) {
+ Integer* Fixnum::mod(STATE, Bignum* other) {
return Bignum::from(state, to_native())->mod(state, other);
}
@@ -126,7 +126,7 @@ namespace rubinius {
return Float::create(state, to_native())->mod(state, other);
}
- Array* Fixnum::divmod(STATE, FIXNUM other) {
+ Array* Fixnum::divmod(STATE, Fixnum* other) {
if(other->to_native() == 0) {
Exception::zero_division_error(state, "divided by 0");
}
@@ -147,23 +147,23 @@ namespace rubinius {
return Float::create(state, to_native())->divmod(state, other);
}
- INTEGER Fixnum::neg(STATE) {
+ Integer* Fixnum::neg(STATE) {
return Fixnum::from(-to_native());
}
- OBJECT Fixnum::equal(STATE, FIXNUM other) {
+ Object* Fixnum::equal(STATE, Fixnum* other) {
return to_native() == other->to_native() ? Qtrue : Qfalse;
}
- OBJECT Fixnum::equal(STATE, Bignum* other) {
+ Object* Fixnum::equal(STATE, Bignum* other) {
return other->equal(state, this);
}
- OBJECT Fixnum::equal(STATE, Float* other) {
+ Object* Fixnum::equal(STATE, Float* other) {
return (double)to_native() == other->val ? Qtrue : Qfalse;
}
- FIXNUM Fixnum::compare(STATE, FIXNUM other) {
+ Fixnum* Fixnum::compare(STATE, Fixnum* other) {