Skip to content

Commit

Permalink
Showing 8 changed files with 21 additions and 51 deletions.
7 changes: 0 additions & 7 deletions truffle/src/main/java/org/jruby/truffle/core/CoreLibrary.java
Original file line number Diff line number Diff line change
@@ -193,7 +193,6 @@ public class CoreLibrary {
private final DynamicObject ioErrorClass;
private final DynamicObject loadErrorClass;
private final DynamicObject localJumpErrorClass;
private final DynamicObject lookupTableClass;
private final DynamicObject matchDataClass;
private final DynamicObjectFactory matchDataFactory;
private final DynamicObject moduleClass;
@@ -640,7 +639,6 @@ public CoreLibrary(RubyContext context) {
byteArrayClass = defineClass(rubiniusModule, objectClass, "ByteArray");
byteArrayFactory = Layouts.BYTE_ARRAY.createByteArrayShape(byteArrayClass, byteArrayClass);
Layouts.CLASS.setInstanceFactoryUnsafe(byteArrayClass, byteArrayFactory);
lookupTableClass = defineClass(rubiniusModule, hashClass, "LookupTable");
defineClass(rubiniusModule, objectClass, "StringData");
transcodingClass = defineClass(encodingClass, objectClass, "Transcoding");
randomizerClass = defineClass(rubiniusModule, objectClass, "Randomizer");
@@ -1476,10 +1474,6 @@ public DynamicObjectFactory getStatFactory() {
return statFactory;
}

public DynamicObject getLookupTableClass() {
return lookupTableClass;
}

public DynamicObject getTranscodingClass() {
return transcodingClass;
}
@@ -1692,7 +1686,6 @@ public Object getTruffleKernelModule() {

private static final String[] coreFiles = {
"/core/pre.rb",
"/core/lookuptable.rb",
"/core/basic_object.rb",
"/core/mirror.rb",
"/core/bignum.rb",
18 changes: 9 additions & 9 deletions truffle/src/main/ruby/core/encoding.rb
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ def inspect

class << self
def build_encoding_map
map = Rubinius::LookupTable.new
map = {}
Encoding.list.each_with_index { |encoding, index|
key = encoding.name.upcase.to_sym
map[key] = [nil, index]
@@ -73,7 +73,7 @@ def build_encoding_map
private :build_encoding_map

def build_transcoding_map
map = Rubinius::LookupTable.new
map = {}
Encoding::Converter.each_transcoder { |source, destinations|
h = {}
destinations.each { |dest|
@@ -152,7 +152,7 @@ def self.asciicompat_encoding(string_or_encoding)
return unless encoding
return if encoding.ascii_compatible?

transcoding = TranscodingMap[encoding.name.upcase]
transcoding = TranscodingMap[encoding.name.upcase.to_sym]
return unless transcoding and transcoding.size == 1

Encoding.find transcoding.keys.first.to_s
@@ -229,7 +229,7 @@ def initialize(from, to, options=0)
name = enc.to_s.upcase
next if name == replacement_encoding_name

_, converters = TranscodingPath[replacement_encoding_name, enc]
_, converters = TranscodingPath[replacement_encoding_name.to_sym, enc]
@replacement_converters << name << converters
end
end
@@ -646,17 +646,17 @@ def self._load(name)

end

Encoding::TranscodingMap[:'UTF-16BE'] = Rubinius::LookupTable.new
Encoding::TranscodingMap[:'UTF-16BE'] = {}
Encoding::TranscodingMap[:'UTF-16BE'][:'UTF-8'] = nil

Encoding::TranscodingMap[:'UTF-16LE'] = Rubinius::LookupTable.new
Encoding::TranscodingMap[:'UTF-16LE'] = {}
Encoding::TranscodingMap[:'UTF-16LE'][:'UTF-8'] = nil

Encoding::TranscodingMap[:'UTF-32BE'] = Rubinius::LookupTable.new
Encoding::TranscodingMap[:'UTF-32BE'] = {}
Encoding::TranscodingMap[:'UTF-32BE'][:'UTF-8'] = nil

Encoding::TranscodingMap[:'UTF-32LE'] = Rubinius::LookupTable.new
Encoding::TranscodingMap[:'UTF-32LE'] = {}
Encoding::TranscodingMap[:'UTF-32LE'][:'UTF-8'] = nil

Encoding::TranscodingMap[:'ISO-2022-JP'] = Rubinius::LookupTable.new
Encoding::TranscodingMap[:'ISO-2022-JP'] = {}
Encoding::TranscodingMap[:'ISO-2022-JP'][:'STATELESS-ISO-2022-JP'] = nil
24 changes: 0 additions & 24 deletions truffle/src/main/ruby/core/lookuptable.rb

This file was deleted.

4 changes: 2 additions & 2 deletions truffle/src/main/ruby/core/marshal.rb
Original file line number Diff line number Diff line change
@@ -468,8 +468,8 @@ class State

def initialize(stream, depth, proc)
# shared
@links = Rubinius::LookupTable.new
@symlinks = Rubinius::LookupTable.new
@links = {}
@symlinks = {}
@symbols = []
@objects = []

2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/process_mirror.rb
Original file line number Diff line number Diff line change
@@ -112,7 +112,7 @@ def initialize(env_or_cmd, *args)
@argv = argv
end

@options = Rubinius::LookupTable.new
@options = {}

if options
options.each do |key, value|
6 changes: 3 additions & 3 deletions truffle/src/main/ruby/core/thread.rb
Original file line number Diff line number Diff line change
@@ -106,7 +106,7 @@ def self.detect_recursion(obj, paired_obj=nil)

# We've seen +obj+ before and it's got multiple paired objects associated
# with it, so check the pair and yield if there is no recursion.
when Rubinius::LookupTable
when Hash
return true if objects[id][pair_id]
objects[id][pair_id] = true

@@ -119,13 +119,13 @@ def self.detect_recursion(obj, paired_obj=nil)
# We've seen +obj+ with one paired object, so check the stored one for
# recursion.
#
# This promotes the value to a LookupTable since there is another new paired
# This promotes the value to a Hash since there is another new paired
# object.
else
previous = objects[id]
return true if previous == pair_id

objects[id] = Rubinius::LookupTable.new(previous => true, pair_id => true)
objects[id] = { previous => true, pair_id => true }

begin
yield
4 changes: 2 additions & 2 deletions truffle/src/main/ruby/core/truffle/ffi/ffi.rb
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ class NotFoundError < RuntimeError; end
#
CURRENT_PROCESS = nil

TypeDefs = Rubinius::LookupTable.new
TypeDefs = {}

class << self
def add_typedef(current, add)
@@ -195,7 +195,7 @@ def errno
add_typedef TYPE_ULL, :uint64
end

TypeSizes = Rubinius::LookupTable.new
TypeSizes = {}
TypeSizes[1] = :char
TypeSizes[2] = :short
TypeSizes[4] = :int
7 changes: 4 additions & 3 deletions truffle/src/main/ruby/core/truffle/ffi/ffi_struct.rb
Original file line number Diff line number Diff line change
@@ -38,14 +38,14 @@ def self.layout(*spec)
# Pick up a enclosing FFI::Library
@enclosing_module ||= find_nested_parent

cspec = Rubinius::LookupTable.new
cspec = {}
i = 0

@size = 0
@members = []

while i < spec.size
name = spec[i]
name = spec[i].to_sym
@members << name

f = spec[i + 1]
@@ -118,9 +118,10 @@ def self.layout(*spec)

def self.config(base, *fields)
@size = Rubinius::Config["#{base}.sizeof"]
cspec = Rubinius::LookupTable.new
cspec = {}

fields.each do |field|
field = field.to_sym
offset = Rubinius::Config["#{base}.#{field}.offset"]
size = Rubinius::Config["#{base}.#{field}.size"]
type = Rubinius::Config["#{base}.#{field}.type"]

0 comments on commit 7b032fe

Please sign in to comment.