mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
fixes for rubinius
This commit is contained in:
parent
2b1c38b792
commit
eeea845a0c
4 changed files with 33 additions and 3 deletions
|
@ -5,7 +5,7 @@ V8SRC=build/v8
|
|||
LIBV8=build/v8/libv8.a
|
||||
LIBV8_G=build/v8/libv8_g.a
|
||||
GCC_VERSION=$(shell ruby -e 'puts %x{gcc --version} =~ /(\d)\.(\d)\.\d/ ? $$1 + $$2 : "UNKNOWN"')
|
||||
ARCH=$(shell ruby -e "puts ['foo'].pack('p').size == 8 ? 'x64' : 'ia32'")
|
||||
ARCH=$(shell ruby build_cpu.rb)
|
||||
|
||||
all: $(LIBV8)
|
||||
|
||||
|
|
31
ext/v8/upstream/build_cpu.rb
Normal file
31
ext/v8/upstream/build_cpu.rb
Normal file
|
@ -0,0 +1,31 @@
|
|||
require 'rbconfig'
|
||||
|
||||
def x86_64_from_build_cpu
|
||||
RbConfig::MAKEFILE_CONFIG['build_cpu'] == 'x86_64'
|
||||
end
|
||||
|
||||
def x86_64_from_byte_length
|
||||
['foo'].pack('p').size == 8
|
||||
end
|
||||
|
||||
def x86_64_from_arch_flag
|
||||
RbConfig::MAKEFILE_CONFIG['ARCH_FLAG'] =~ /x86_64/
|
||||
end
|
||||
|
||||
def darwin?
|
||||
RUBY_PLATFORM =~ /darwin/
|
||||
end
|
||||
|
||||
def rubinius?
|
||||
Object.const_defined?(:RUBY_ENGINE) && RUBY_ENGINE == "rbx"
|
||||
end
|
||||
|
||||
def x64?
|
||||
if darwin? && !rubinius?
|
||||
x86_64_from_arch_flag
|
||||
else
|
||||
x86_64_from_build_cpu || x86_64_from_byte_length
|
||||
end
|
||||
end
|
||||
|
||||
puts x64? ? "x64" : "ia32"
|
|
@ -70,7 +70,7 @@ namespace {
|
|||
return rr_v82rb(args(self)->length);
|
||||
}
|
||||
VALUE Get(VALUE self, VALUE index) {
|
||||
int i = NUM2INT(rb_to_int(index));
|
||||
int i = NUM2INT(index);
|
||||
return rr_v82rb(args(self)->values->Get(i));
|
||||
}
|
||||
VALUE Callee(VALUE self) {
|
||||
|
|
|
@ -157,7 +157,6 @@ namespace {
|
|||
|
||||
VALUE New(VALUE function_template) {
|
||||
HandleScope handles;
|
||||
rb_need_block();
|
||||
VALUE code = rb_block_proc();
|
||||
if (NIL_P(code)) {
|
||||
return Qnil;
|
||||
|
|
Loading…
Add table
Reference in a new issue