Permalink
Browse files

Cleaned up debris from CompiledMethod rename.

  • Loading branch information...
1 parent 6fce2f6 commit 149a3642abded597128dd1c516613f5a67387485 @brixen brixen committed Aug 30, 2012
Showing with 608 additions and 603 deletions.
  1. +6 −6 kernel/bootstrap/block_environment.rb
  2. +4 −4 kernel/bootstrap/compiled_code.rb
  3. +4 −4 kernel/bootstrap/rubinius.rb
  4. +2 −2 kernel/common/binding.rb
  5. +19 −18 kernel/common/block_environment.rb
  6. +1 −1 kernel/common/codeloader.rb
  7. +12 −12 kernel/common/compiled_code.rb
  8. +3 −3 kernel/common/kernel.rb
  9. +6 −6 kernel/common/kernel18.rb
  10. +6 −6 kernel/common/kernel19.rb
  11. +17 −17 kernel/common/module.rb
  12. +6 −6 kernel/common/proc.rb
  13. +2 −2 kernel/common/sprinter.rb
  14. +2 −2 kernel/common/thread.rb
  15. +2 −2 kernel/delta/class.rb
  16. +11 −11 kernel/delta/codeloader.rb
  17. +19 −19 lib/compiler/compiled_file.rb
  18. +12 −12 lib/compiler/compiler.rb
  19. +18 −18 lib/compiler/generator.rb
  20. +18 −18 lib/compiler/printers.rb
  21. +1 −1 spec/core/kernel/fixtures/classes.rb
  22. +4 −4 vm/builtin/block_as_method.cpp
  23. +18 −18 vm/builtin/block_environment.cpp
  24. +5 −5 vm/builtin/block_environment.hpp
  25. +50 −50 vm/builtin/compiledcode.cpp
  26. +1 −1 vm/builtin/compiledcode.hpp
  27. +2 −2 vm/builtin/exception.cpp
  28. +1 −1 vm/builtin/exception.hpp
  29. +5 −5 vm/builtin/executable.cpp
  30. +1 −1 vm/builtin/executable.hpp
  31. +11 −10 vm/builtin/location.cpp
  32. +1 −1 vm/builtin/nativemethod.cpp
  33. +4 −4 vm/builtin/proc.cpp
  34. +12 −12 vm/builtin/system.cpp
  35. +1 −1 vm/builtin/system.hpp
  36. +1 −1 vm/builtin/thread.cpp
  37. +2 −2 vm/bytecode_verification.cpp
  38. +1 −1 vm/bytecode_verification.hpp
  39. +11 −10 vm/call_frame.cpp
  40. +4 −4 vm/call_frame.hpp
  41. +3 −3 vm/capi/18/include/rbxti.hpp
  42. +3 −3 vm/capi/19/include/rbxti.hpp
  43. +4 −4 vm/compiled_file.cpp
  44. +6 −6 vm/gc/gc.cpp
  45. +2 −2 vm/globals.hpp
  46. +8 −8 vm/inline_cache.cpp
  47. +2 −2 vm/instructions.cpp
  48. +16 −16 vm/instructions.def
  49. +6 −6 vm/instruments/rbxti.cpp
  50. +5 −5 vm/instruments/tooling.cpp
  51. +6 −6 vm/instruments/tooling.hpp
  52. +2 −2 vm/llvm/background_compile_request.hpp
  53. +26 −26 vm/llvm/inline.cpp
  54. +6 −6 vm/llvm/inline.hpp
  55. +2 −2 vm/llvm/inline_block.cpp
  56. +1 −1 vm/llvm/inline_block.hpp
  57. +17 −17 vm/llvm/inline_primitive.cpp
  58. +3 −3 vm/llvm/jit_block.cpp
  59. +9 −9 vm/llvm/jit_compiler.cpp
  60. +1 −1 vm/llvm/jit_compiler.hpp
  61. +4 −4 vm/llvm/jit_inline_block.cpp
  62. +4 −4 vm/llvm/jit_inline_method.cpp
  63. +4 −4 vm/llvm/jit_method.cpp
  64. +22 −22 vm/llvm/jit_util.cpp
  65. +14 −12 vm/llvm/jit_visit.hpp
  66. +2 −2 vm/llvm/method_info.cpp
  67. +1 −1 vm/llvm/method_info.hpp
  68. +1 −1 vm/llvm/offset_specific.hpp
  69. +23 −23 vm/llvm/state.cpp
  70. +2 −2 vm/llvm/state.hpp
  71. +12 −12 vm/machine_code.cpp
  72. +2 −2 vm/machine_code.hpp
  73. +22 −22 vm/marshal.cpp
  74. +1 −1 vm/marshal.hpp
  75. +2 −2 vm/stack_variables.cpp
  76. +4 −4 vm/super-instruction/analyze.rb
  77. +2 −2 vm/test/test_compiled_file.hpp
  78. +13 −13 vm/test/test_machine_code.hpp
  79. +10 −10 vm/test/test_message.hpp
  80. +9 −9 vm/test/test_object.hpp
  81. +3 −3 vm/test/test_ontology.hpp
  82. +17 −17 vm/test/test_unmarshal.hpp
@@ -29,27 +29,27 @@ def self.new(block_env)
end
def arity
- @block_env.code.arity
+ @block_env.compiled_code.arity
end
def local_names
- @block_env.code.local_names
+ @block_env.compiled_code.local_names
end
def required_args
- @block_env.code.required_args
+ @block_env.compiled_code.required_args
end
def total_args
- @block_env.code.total_args
+ @block_env.compiled_code.total_args
end
def post_args
- @block_env.code.post_args
+ @block_env.compiled_code.post_args
end
def splat
- @block_env.code.splat
+ @block_env.compiled_code.splat
end
def file
@@ -21,14 +21,14 @@ def dup
# For example:
#
# def g
- # f_cm = Rubinius::CompiledCode.of_sender
+ # f_code = Rubinius::CompiledCode.of_sender
# end
#
# def f
# g
# end
#
- # f_cm is the CompiledCode of f as requested by g.
+ # f_code is the CompiledCode of f as requested by g.
#
def self.of_sender
Rubinius.primitive :compiledcode_of_sender
@@ -48,8 +48,8 @@ def self.current
end
end
- # NOTE: Temporary alias for backwards compatibility. CompiledMethod will
- # eventually be deprecated in favor of CompiledCode.
+ # NOTE: Temporary alias for backwards compatibility. CompiledMethod is
+ # deprecated. Client code should use CompiledCode.
CompiledMethod = CompiledCode
end
@@ -193,10 +193,10 @@ def self.thread_state
raise PrimitiveFailure, "Rubinius.thread_state primitive failed"
end
- # Used to invoke a CompiledCode +cm+ as a script body.
- # Sets up the MAIN object as self and bypasses JIT'ing
- # (because why JIT a script you only run once).
- def self.run_script(cm)
+ # Used to invoke a CompiledCode instance as a script body. Sets up the MAIN
+ # object as self and bypasses JIT'ing (because why JIT a script you only run
+ # once).
+ def self.run_script(compiled_code)
Rubinius.primitive :vm_run_script
raise PrimitiveFailure, "Rubinius.run_script primitive failed"
end
View
@@ -2,7 +2,7 @@
class Binding
attr_accessor :variables
- attr_accessor :code
+ attr_accessor :compiled_code
attr_accessor :constant_scope
attr_accessor :proc_environment
attr_accessor :self
@@ -28,7 +28,7 @@ def self.setup(variables, code, constant_scope, recv=nil, location=nil)
bind.self = recv || variables.self
bind.variables = variables
- bind.code = code
+ bind.compiled_code = code
bind.constant_scope = constant_scope
bind.location = location
@@ -11,7 +11,7 @@ class BlockEnvironment
attr_reader :module
# The CompiledCode that implements the code for the block
- attr_reader :code
+ attr_reader :compiled_code
attr_accessor :proc_environment
attr_reader :metadata_container
@@ -20,37 +20,37 @@ def from_proc?
@proc_environment
end
- def under_context(scope, cmethod)
+ def under_context(scope, code)
@top_scope = scope
@scope = scope
- @code = cmethod
- @module = cmethod.scope.module
+ @compiled_code = code
+ @module = code.scope.module
return self
end
def change_name(name)
- @code = @code.change_name name
+ @compiled_code = @compiled_code.change_name name
end
def repoint_scope(where)
- @code.scope.using_current_as where
+ @compiled_code.scope.using_current_as where
end
def disable_scope!
- @code.scope.using_disabled_scope
+ @compiled_code.scope.using_disabled_scope
end
def constant_scope
- @code.scope
+ @compiled_code.scope
end
def to_binding
- Binding.setup @scope, @code, @code.scope
+ Binding.setup @scope, @compiled_code, @compiled_code.scope
end
def set_eval_binding(bind)
- @code.scope.script.eval_binding = bind
+ @compiled_code.scope.script.eval_binding = bind
end
##
@@ -72,23 +72,24 @@ def make_independent
end
def call_on_instance(obj, *args)
- call_under obj, @code.scope, *args
+ call_under obj, @compiled_code.scope, *args
end
def arity
- if @code.splat and (@code.splat >= 0 or @code.splat == -2)
- -(@code.required_args + 1)
+ if @compiled_code.splat and
+ (@compiled_code.splat >= 0 or @compiled_code.splat == -2)
+ -(@compiled_code.required_args + 1)
else
- @code.required_args
+ @compiled_code.required_args
end
end
def file
- @code.file
+ @compiled_code.file
end
def line
- @code.defined_line
+ @compiled_code.defined_line
end
class AsMethod < Executable
@@ -112,8 +113,8 @@ def ==(other)
# The BEs are identical otherwise, except for the
# name of the CompiledCode.
- other_code = other.block_env.code
- code = block_env.code
+ other_code = other.block_env.compiled_code
+ code = block_env.compiled_code
block_env.scope == other.block_env.scope &&
block_env.top_scope == other.block_env.top_scope &&
@@ -209,7 +209,7 @@ def require(name)
case req.type
when :ruby
begin
- Rubinius.run_script loader.cm
+ Rubinius.run_script loader.compiled_code
else
req.passed!
ensure
@@ -341,20 +341,20 @@ def child_methods
end
def change_name(name)
- cm = dup
- cm.name = name
+ code = dup
+ code.name = name
- lits = Tuple.new(cm.literals.size)
- cm.literals.each_with_index do |lit, idx|
+ lits = Tuple.new(code.literals.size)
+ code.literals.each_with_index do |lit, idx|
if lit.kind_of? CompiledCode and lit.is_block?
lit = lit.change_name name
end
lits[idx] = lit
end
- cm.literals = lits
- return cm
+ code.literals = lits
+ return code
end
##
@@ -516,25 +516,25 @@ def parameters
# To generate VM opcodes documentation
# use rake doc:vm task.
class Instruction
- def initialize(inst, cm, ip)
+ def initialize(inst, code, ip)
@instruction = inst[0]
@args = inst[1..-1]
@comment = nil
@args.each_index do |i|
case @instruction.args[i]
when :literal
- @args[i] = cm.literals[@args[i]]
+ @args[i] = code.literals[@args[i]]
when :local
# TODO: Blocks should be able to retrieve local names as well,
# but need access to method corresponding to home context
- if cm.local_names and !cm.is_block?
- @comment = cm.local_names[args[i]].to_s
+ if code.local_names and !code.is_block?
+ @comment = code.local_names[args[i]].to_s
end
end
end
- @cm = cm
+ @compiled_code = code
@ip = ip
end
@@ -545,7 +545,7 @@ def initialize(inst, cm, ip)
# Return the line that this instruction is on in the method
#
def line
- @cm.line_from_ip(ip)
+ @compiled_code.line_from_ip(ip)
end
##
View
@@ -166,12 +166,12 @@ def lambda(&prc)
def caller(start=1, exclude_kernel=true)
# The + 1 is to skip this frame
Rubinius.mri_backtrace(start + 1).map do |tup|
- cm = tup[0]
+ code = tup[0]
line = tup[1]
is_block = tup[2]
name = tup[3]
- "#{cm.active_path}:#{line}:in `#{name}'"
+ "#{code.active_path}:#{line}:in `#{name}'"
end
end
module_function :caller
@@ -577,7 +577,7 @@ def load(name, wrap=false)
cl = Rubinius::CodeLoader.new(name)
cl.load(wrap)
- Rubinius.run_script cl.cm
+ Rubinius.run_script cl.compiled_code
Rubinius::CodeLoader.loaded_hook.trigger!(name)
View
@@ -3,10 +3,10 @@
module Kernel
def method(name)
name = Rubinius::Type.coerce_to_symbol name
- cm = Rubinius.find_method(self, name)
+ code = Rubinius.find_method(self, name)
- if cm
- Method.new(self, cm[1], cm[0], name)
+ if code
+ Method.new(self, code[1], code[0], name)
else
raise NameError, "undefined method `#{name}' for #{self.inspect}"
end
@@ -155,10 +155,10 @@ def type
def method(name)
name = Rubinius::Type.coerce_to_symbol name
- cm = Rubinius.find_method(self, name)
+ code = Rubinius.find_method(self, name)
- if cm
- return Method.new(self, cm[1], cm[0], name)
+ if code
+ return Method.new(self, code[1], code[0], name)
else
raise NameError, "undefined method `#{name}' for #{self.inspect}"
end
View
@@ -3,10 +3,10 @@
module Kernel
def method(name)
name = Rubinius::Type.coerce_to_symbol name
- cm = Rubinius.find_method(self, name)
+ code = Rubinius.find_method(self, name)
- if cm
- Method.new(self, cm[1], cm[0], name)
+ if code
+ Method.new(self, code[1], code[0], name)
elsif respond_to_missing?(name, true)
Method.new(self, self.class, Rubinius::MissingMethod.new(self, name), name)
else
@@ -16,10 +16,10 @@ def method(name)
def public_method(name)
name = Rubinius::Type.coerce_to_symbol name
- cm = Rubinius.find_public_method(self, name)
+ code = Rubinius.find_public_method(self, name)
- if cm
- Method.new(self, cm[1], cm[0], name)
+ if code
+ Method.new(self, code[1], code[0], name)
elsif respond_to_missing?(name, false)
Method.new(self, self.class, Rubinius::MissingMethod.new(self, name), name)
else
Oops, something went wrong.

0 comments on commit 149a364

Please sign in to comment.