Permalink
Browse files

Rename CompiledMethod to CompiledCode

  • Loading branch information...
1 parent b2dc727 commit 35dbaf5efa8c3b0babf2b2ee656769cf8438b54f @dbussink dbussink committed Jul 30, 2012
Showing with 786 additions and 786 deletions.
  1. +50 −0 kernel/bootstrap/compiled_code.rb
  2. +0 −50 kernel/bootstrap/compiled_method.rb
  3. +1 −1 kernel/bootstrap/load_order18.txt
  4. +1 −1 kernel/bootstrap/load_order19.txt
  5. +1 −1 kernel/bootstrap/load_order20.txt
  6. +1 −1 kernel/bootstrap/rubinius.rb
  7. +1 −1 kernel/common/binding.rb
  8. +2 −2 kernel/common/block_environment.rb
  9. +28 −28 kernel/common/{compiled_method.rb → compiled_code.rb}
  10. +3 −3 kernel/common/eval.rb
  11. +1 −1 kernel/common/eval18.rb
  12. +1 −1 kernel/common/eval19.rb
  13. +4 −4 kernel/common/exception.rb
  14. +3 −3 kernel/common/executable.rb
  15. +1 −1 kernel/common/load_order18.txt
  16. +1 −1 kernel/common/load_order19.txt
  17. +1 −1 kernel/common/load_order20.txt
  18. +1 −1 kernel/common/method.rb
  19. +2 −2 kernel/common/method_equality.rb
  20. +3 −3 kernel/common/module.rb
  21. +2 −2 kernel/common/variable_scope.rb
  22. +1 −1 kernel/delta/class.rb
  23. +1 −1 kernel/delta/codeloader.rb
  24. +3 −3 kernel/delta/rubinius.rb
  25. +1 −1 lib/bin/compile.rb
  26. +1 −1 lib/compiler/ast/transforms.rb
  27. +4 −4 lib/compiler/compiled_file.rb
  28. +4 −4 lib/compiler/compiler.rb
  29. +1 −1 lib/compiler/printers.rb
  30. +2 −2 lib/compiler/stages.rb
  31. +1 −1 lib/mri_bridge.rb
  32. +1 −1 lib/rbx_bridge.rb
  33. +2 −2 lib/rubinius/debugger.rb
  34. +2 −2 lib/rubinius/debugger/old/debugger.rb
  35. +5 −5 lib/rubinius/debugger/old/standard_commands.rb
  36. +1 −1 lib/rubinius/debugger/old/vm_commands.rb
  37. +1 −1 lib/tooling/profiler/profiler_vm.cpp
  38. +1 −1 rakelib/vm.rake
  39. +3 −3 spec/compiler/transforms/fast_new_spec.rb
  40. +1 −1 spec/core/compiledmethod/fixtures/arguments_1.9.rb
  41. +10 −10 spec/core/compiledmethod/locate_line_spec.rb
  42. +1 −1 spec/core/compiledmethod/locate_spec.rb
  43. +7 −7 spec/core/compiledmethod/versions/arguments_1.9.rb
  44. +1 −1 spec/core/kernel/eval_spec.rb
  45. +10 −10 spec/ruby/CHANGES.before-2008-05-10
  46. +1 −1 spec/ruby/core/module/shared/class_eval.rb
  47. +2 −2 vm/builtin/block_environment.cpp
  48. +4 −4 vm/builtin/block_environment.hpp
  49. +1 −1 vm/builtin/cache.cpp
  50. +1 −1 vm/builtin/class.cpp
  51. +1 −1 vm/builtin/class.hpp
  52. +41 −41 vm/builtin/{compiledmethod.cpp → compiledcode.cpp}
  53. +15 −15 vm/builtin/{compiledmethod.hpp → compiledcode.hpp}
  54. +3 −3 vm/builtin/exception.cpp
  55. +2 −2 vm/builtin/exception.hpp
  56. +6 −6 vm/builtin/executable.cpp
  57. +4 −4 vm/builtin/executable.hpp
  58. +2 −2 vm/builtin/location.cpp
  59. +1 −1 vm/builtin/proc.cpp
  60. +4 −4 vm/builtin/system.cpp
  61. +4 −4 vm/builtin/system.hpp
  62. +1 −1 vm/builtin/variable_scope.cpp
  63. +4 −4 vm/builtin/variable_scope.hpp
  64. +4 −4 vm/bytecode_verification.cpp
  65. +3 −3 vm/bytecode_verification.hpp
  66. +1 −1 vm/call_frame.cpp
  67. +1 −1 vm/call_frame.hpp
  68. +4 −4 vm/codegen/field_extract.rb
  69. +3 −3 vm/compiled_file.cpp
  70. +2 −2 vm/drivers/compile.cpp
  71. +2 −2 vm/drivers/jit-test.cpp
  72. +4 −4 vm/gc/gc.cpp
  73. +1 −1 vm/global_cache.hpp
  74. +1 −1 vm/helpers.cpp
  75. +1 −1 vm/helpers.hpp
  76. +3 −3 vm/inline_cache.hpp
  77. +1 −1 vm/instructions.cpp
  78. +4 −4 vm/instructions.def
  79. +4 −4 vm/instruments/rbxti-internal.hpp
  80. +2 −2 vm/instruments/rbxti.cpp
  81. +3 −3 vm/instruments/tooling.cpp
  82. +4 −4 vm/instruments/tooling.hpp
  83. +6 −6 vm/llvm/background_compile_request.hpp
  84. +5 −5 vm/llvm/inline.cpp
  85. +6 −6 vm/llvm/inline.hpp
  86. +2 −2 vm/llvm/inline_block.cpp
  87. +3 −3 vm/llvm/inline_block.hpp
  88. +5 −5 vm/llvm/inline_primitive.cpp
  89. +1 −1 vm/llvm/jit_block.cpp
  90. +3 −3 vm/llvm/jit_compiler.cpp
  91. +1 −1 vm/llvm/jit_compiler.hpp
  92. +1 −1 vm/llvm/jit_method.cpp
  93. +2 −2 vm/llvm/jit_runtime.cpp
  94. +4 −4 vm/llvm/jit_runtime.hpp
  95. +4 −4 vm/llvm/jit_util.cpp
  96. +4 −4 vm/llvm/jit_visit.hpp
  97. +2 −2 vm/llvm/method_info.cpp
  98. +3 −3 vm/llvm/method_info.hpp
  99. +1 −1 vm/llvm/offset_specific.hpp
  100. +7 −7 vm/llvm/state.cpp
  101. +5 −5 vm/llvm/state.hpp
  102. +25 −25 vm/llvm/types.cpp.gen
  103. +6 −6 vm/llvm/types.ll
  104. +3 −3 vm/marshal.cpp
  105. +2 −2 vm/marshal.hpp
  106. +2 −2 vm/ontology.cpp
  107. +5 −5 vm/super-instruction/analyze.rb
  108. +1 −1 vm/test/test_arguments.hpp
  109. +2 −2 vm/test/test_compiled_file.hpp
  110. +1 −1 vm/test/test_compiledmethod.hpp
  111. +3 −3 vm/test/test_message.hpp
  112. +2 −2 vm/test/test_object.hpp
  113. +1 −1 vm/test/test_ontology.hpp
  114. +2 −2 vm/test/test_unmarshal.hpp
  115. +3 −3 vm/test/test_vmmethod.hpp
  116. +1 −1 vm/type_info.hpp
  117. +13 −13 vm/vmmethod.cpp
  118. +9 −9 vm/vmmethod.hpp
  119. +3 −3 web/_includes/instructions.markdown
  120. +2 −2 web/_site/about/1.1.1/index.html
  121. +1 −1 web/_site/about/one_one/index.html
  122. +3 −3 web/_site/doc/de/virtual-machine/instructions/index.html
  123. +14 −14 web/_site/doc/en/bytecode-compiler/packager/index.html
  124. +6 −6 web/_site/doc/en/bytecode-compiler/writer/index.html
  125. +3 −3 web/_site/doc/en/virtual-machine/instructions/index.html
  126. +12 −12 web/_site/doc/es/bytecode-compiler/packager/index.html
  127. +5 −5 web/_site/doc/es/bytecode-compiler/writer/index.html
  128. +3 −3 web/_site/doc/es/virtual-machine/instructions/index.html
  129. +14 −14 web/_site/doc/fr/bytecode-compiler/packager/index.html
  130. +6 −6 web/_site/doc/fr/bytecode-compiler/writer/index.html
  131. +3 −3 web/_site/doc/fr/virtual-machine/instructions/index.html
  132. +14 −14 web/_site/doc/it/bytecode-compiler/packager/index.html
  133. +6 −6 web/_site/doc/it/bytecode-compiler/writer/index.html
  134. +3 −3 web/_site/doc/it/virtual-machine/instructions/index.html
  135. +3 −3 web/_site/doc/ja/virtual-machine/instructions/index.html
  136. +14 −14 web/_site/doc/pl/bytecode-compiler/packager/index.html
  137. +6 −6 web/_site/doc/pl/bytecode-compiler/writer/index.html
  138. +3 −3 web/_site/doc/pl/virtual-machine/instructions/index.html
  139. +14 −14 web/_site/doc/pt-br/bytecode-compiler/packager/index.html
  140. +6 −6 web/_site/doc/pt-br/bytecode-compiler/writer/index.html
  141. +3 −3 web/_site/doc/pt-br/virtual-machine/instructions/index.html
  142. +14 −14 web/_site/doc/ru/bytecode-compiler/packager/index.html
  143. +6 −6 web/_site/doc/ru/bytecode-compiler/writer/index.html
  144. +3 −3 web/_site/doc/ru/virtual-machine/instructions/index.html
  145. +1 −1 web/_site/releases/1.1.0/index.html
  146. +2 −2 web/_site/releases/1.1.1/index.html
  147. +3 −3 web/_site/releases/1.2.4/index.html
  148. +2 −2 web/about/1.1.1.markdown
  149. +1 −1 web/about/one_one.markdown
  150. +14 −14 web/doc/en/bytecode-compiler/packager.markdown
  151. +6 −6 web/doc/en/bytecode-compiler/writer.markdown
  152. +12 −12 web/doc/es/bytecode-compiler/packager.markdown
  153. +5 −5 web/doc/es/bytecode-compiler/writer.markdown
  154. +14 −14 web/doc/fr/bytecode-compiler/packager.markdown
  155. +6 −6 web/doc/fr/bytecode-compiler/writer.markdown
  156. +14 −14 web/doc/it/bytecode-compiler/packager.markdown
  157. +6 −6 web/doc/it/bytecode-compiler/writer.markdown
  158. +14 −14 web/doc/pl/bytecode-compiler/packager.markdown
  159. +6 −6 web/doc/pl/bytecode-compiler/writer.markdown
  160. +14 −14 web/doc/pt-br/bytecode-compiler/packager.markdown
  161. +6 −6 web/doc/pt-br/bytecode-compiler/writer.markdown
  162. +14 −14 web/doc/ru/bytecode-compiler/packager.markdown
  163. +6 −6 web/doc/ru/bytecode-compiler/writer.markdown
  164. +1 −1 web/releases/1.1.0.markdown
  165. +2 −2 web/releases/1.1.1.markdown
  166. +3 −3 web/releases/1.2.4.markdown
@@ -0,0 +1,50 @@
+# -*- encoding: us-ascii -*-
+
+module Rubinius
+ class CompiledCode < Executable
+
+ attr_accessor :name
+
+ def self.allocate
+ Rubinius.primitive :compiledcode_allocate
+ raise PrimitiveFailure, "CompiledCode.allocate primitive failed"
+ end
+
+ def dup
+ Rubinius.primitive :compiledcode_dup
+ raise PrimitiveFailure, "CompiledCode#dup primitive failed"
+ end
+
+ # Return the CompiledCode for caller of the method that called
+ # .of_sender.
+ #
+ # For example:
+ #
+ # def g
+ # f_cm = Rubinius::CompiledCode.of_sender
+ # end
+ #
+ # def f
+ # g
+ # end
+ #
+ # f_cm is the CompiledCode of f as requested by g.
+ #
+ def self.of_sender
+ Rubinius.primitive :compiledcode_of_sender
+ raise PrimitiveFailure, "CompiledCode.of_sender failed"
+ end
+
+ # Returns the CompiledCode object for the currently executing Ruby
+ # method. For example:
+ #
+ # def m
+ # p Rubinius::CompiledCode.current.name
+ # end
+ #
+ def self.current
+ Rubinius.primitive :compiledcode_current
+ raise PrimitiveFailure, "CompiledCode.current failed"
+ end
+ end
+end
@@ -1,50 +0,0 @@
-# -*- encoding: us-ascii -*-
-
-module Rubinius
- class CompiledMethod < Executable
-
- attr_accessor :name
-
- def self.allocate
- Rubinius.primitive :compiledmethod_allocate
- raise PrimitiveFailure, "CompiledMethod.allocate primitive failed"
- end
-
- def dup
- Rubinius.primitive :compiledmethod_dup
- raise PrimitiveFailure, "CompiledMethod#dup primitive failed"
- end
-
- # Return the CompiledMethod for caller of the method that called
- # .of_sender.
- #
- # For example:
- #
- # def g
- # f_cm = Rubinius::CompiledMethod.of_sender
- # end
- #
- # def f
- # g
- # end
- #
- # f_cm is the CompiledMethod of f as requested by g.
- #
- def self.of_sender
- Rubinius.primitive :compiledmethod_of_sender
- raise PrimitiveFailure, "CompiledMethod.of_sender failed"
- end
-
- # Returns the CompiledMethod object for the currently executing Ruby
- # method. For example:
- #
- # def m
- # p Rubinius::CompiledMethod.current.name
- # end
- #
- def self.current
- Rubinius.primitive :compiledmethod_current
- raise PrimitiveFailure, "CompiledMethod.current failed"
- end
- end
-end
@@ -8,7 +8,7 @@ bytearray.rbc
channel.rbc
class.rbc
compactlookuptable.rbc
-compiled_method.rbc
+compiled_code.rbc
configuration.rbc
dir.rbc
exception.rbc
@@ -9,7 +9,7 @@ bytearray.rbc
channel.rbc
class.rbc
compactlookuptable.rbc
-compiled_method.rbc
+compiled_code.rbc
configuration.rbc
dir.rbc
encoding.rbc
@@ -9,7 +9,7 @@ bytearray.rbc
channel.rbc
class.rbc
compactlookuptable.rbc
-compiled_method.rbc
+compiled_code.rbc
configuration.rbc
dir.rbc
encoding.rbc
@@ -193,7 +193,7 @@ def self.thread_state
raise PrimitiveFailure, "Rubinius.thread_state failed"
end
- # Used to invoke a CompiledMethod +cm+ as a script body.
+ # 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)
View
@@ -17,7 +17,7 @@ def from_proc?
# all the right arguments.
#
# +variables+ is a Rubinius::VariableScope object
- # +code+ is a Rubinius::CompiledMethod object
+ # +code+ is a Rubinius::CompiledCode object
# +constant_scope+ is a Rubinius::ConstantScope object
#
# See Kernel#binding in kernel/common/eval.rb for a simple example of
@@ -10,7 +10,7 @@ class BlockEnvironment
attr_reader :top_scope
attr_reader :module
- # The CompiledMethod that implements the code for the block
+ # The CompiledCode that implements the code for the block
attr_reader :code
attr_accessor :proc_environment
@@ -110,7 +110,7 @@ def ==(other)
# when given a Proc.
#
# The BEs are identical otherwise, except for the
- # name of the CompiledMethod.
+ # name of the CompiledCode.
other_code = other.block_env.code
code = block_env.code
@@ -1,10 +1,10 @@
# -*- encoding: us-ascii -*-
module Rubinius
- class CompiledMethod < Executable
+ class CompiledCode < Executable
##
- # Any CompiledMethod with this value in it's serial slot
+ # Any CompiledCode with this value in it's serial slot
# is expected to be the default, kernel version
KernelMethodSerial = 47
@@ -34,8 +34,8 @@ class CompiledMethod < Executable
##
# Compare this method with +other+. Instead of bugging out if +other+
- # isn't a {CompiledMethod}, this returns +false+ immediately unless
- # we're comparing two apples, AKA, {CompiledMethod}s. The methods have
+ # isn't a {CompiledCode}, this returns +false+ immediately unless
+ # we're comparing two apples, AKA, {CompiledCode}s. The methods have
# to be the exact same in implementation, but their scoping (location)
# can differ.
#
@@ -54,14 +54,14 @@ class CompiledMethod < Executable
# end
#
# would all be the same, despite their access to different ivars and scopes
- # (which {CompiledMethod}s DO keep track of)
+ # (which {CompiledCode}s DO keep track of)
#
# @todo Make example (in method documentation) match reality
- # @param [Rubinius::CompiledMethod] other the other part to compare
+ # @param [Rubinius::CompiledCode] other the other part to compare
# @param [Boolean]
#
def ==(other)
- return false unless other.kind_of? CompiledMethod
+ return false unless other.kind_of? CompiledCode
@primitive == other.primitive and
@name == other.name and
@iseq == other.iseq and
@@ -111,35 +111,35 @@ def inherit_scope(other)
# this is.
#
def set_breakpoint(ip, obj)
- Rubinius.primitive :compiledmethod_set_breakpoint
+ Rubinius.primitive :compiledcode_set_breakpoint
raise ArgumentError, "Unable to set breakpoint on #{inspect} at invalid bytecode address #{ip}"
end
##
# Erase a breakpoint at +ip+
#
def clear_breakpoint(ip)
- Rubinius.primitive :compiledmethod_clear_breakpoint
+ Rubinius.primitive :compiledcode_clear_breakpoint
raise ArgumentError, "Unable to clear breakpoint on #{inspect} at invalid bytecode address #{ip}"
end
##
# Indicate if there is a breakpoint set at +ip+
#
def breakpoint?(ip)
- Rubinius.primitive :compiledmethod_is_breakpoint
+ Rubinius.primitive :compiledcode_is_breakpoint
raise ArgumentError, "Unable to retrieve breakpoint status on #{inspect} at bytecode address #{ip}"
end
class Script
- attr_accessor :compiled_method
+ attr_accessor :compiled_code
attr_accessor :file_path
attr_accessor :data_path
attr_accessor :eval_binding
attr_accessor :eval_source
def initialize(method, path=nil, for_eval=false)
- @compiled_method = method
+ @compiled_code = method
@file_path = path
@for_eval = for_eval
@eval_binding = nil
@@ -162,7 +162,7 @@ def main?
# Creates the Script instance for a toplevel compiled method.
def create_script(wrap=false)
- script = CompiledMethod::Script.new(self)
+ script = CompiledCode::Script.new(self)
# Setup the scoping.
cs = ConstantScope.new(Object)
@@ -231,13 +231,13 @@ def line_from_ip(ip)
end
##
- # Returns the address (IP) of the first instruction in this CompiledMethod
+ # Returns the address (IP) of the first instruction in this CompiledCode
# that is on the specified line, or the address of the first instruction on
# the next code line after the specified line if there are no instructions
# on the requested line.
- # This method only looks at instructions within the current CompiledMethod;
+ # This method only looks at instructions within the current CompiledCode;
# see #locate_line for an alternate method that also searches inside the child
- # CompiledMethods.
+ # CompiledCodes.
#
# Optionally only consider ip's greater than +start+
#
@@ -285,7 +285,7 @@ def defined_line
##
#
- # Given all CompiledMethods in the system, find one that
+ # Given all CompiledCodes in the system, find one that
# was defined in file +file+ and encompasses +line+
#
def self.locate(file, line=nil)
@@ -299,7 +299,7 @@ def self.locate(file, line=nil)
end
ary = []
- ObjectSpace.find_object([:kind_of, Rubinius::CompiledMethod], ary)
+ ObjectSpace.find_object([:kind_of, Rubinius::CompiledCode], ary)
methods = ary.find_all do |x|
x.scope and path = x.scope.absolute_active_path and \
@@ -332,12 +332,12 @@ def describe
end
##
- # Convenience method to return an array of the child CompiledMethods from
- # this CompiledMethod's literals.
+ # Convenience method to return an array of the child CompiledCodes from
+ # this CompiledCode's literals.
#
# @return [Tuple]
def child_methods
- literals.select { |lit| lit.kind_of? CompiledMethod }
+ literals.select { |lit| lit.kind_of? CompiledCode }
end
def change_name(name)
@@ -346,7 +346,7 @@ def change_name(name)
lits = Tuple.new(cm.literals.size)
cm.literals.each_with_index do |lit, idx|
- if lit.kind_of? CompiledMethod and lit.is_block?
+ if lit.kind_of? CompiledCode and lit.is_block?
lit = lit.change_name name
end
@@ -358,14 +358,14 @@ def change_name(name)
end
##
- # Locates the CompiledMethod and instruction address (IP) of the first
+ # Locates the CompiledCode and instruction address (IP) of the first
# instruction on the specified line. This method recursively examines child
# compiled methods until an exact match for the searched line is found.
- # It returns both the matching CompiledMethod and the IP of the first
+ # It returns both the matching CompiledCode and the IP of the first
# instruction on the requested line, or nil if no match for the specified line
# is found.
#
- # @return [(Rubinius::CompiledMethod, Fixnum), NilClass] returns
+ # @return [(Rubinius::CompiledCode, Fixnum), NilClass] returns
# nil if nothing is found, else an array of size 2 containing the method
# the line was found in and the IP pointing there.
def locate_line(line)
@@ -402,9 +402,9 @@ def locate_line(line)
# but then converts opcode literal arguments to their actual values by looking
# them up in the literals tuple.
# Takes an optional bytecodes argument representing the bytecode that is to
- # be decoded using this CompiledMethod's locals and literals. This is provided
+ # be decoded using this CompiledCode's locals and literals. This is provided
# for use by the debugger, where the bytecode sequence to be decoded may not
- # exactly match the bytecode currently held by the CompiledMethod, typically
+ # exactly match the bytecode currently held by the CompiledCode, typically
# as a result of substituting yield_debugger instructions into the bytecode.
def decode(bytecodes = @iseq)
require 'compiler/iseq'
@@ -511,7 +511,7 @@ def parameters
# Represents virtual machine's CPU instruction.
# Instructions are organized into instruction
# sequences known as iSeq, forming body
- # of CompiledMethods.
+ # of CompiledCodes.
#
# To generate VM opcodes documentation
# use rake doc:vm task.
View
@@ -35,7 +35,7 @@ def local_variables
def binding
return Binding.setup(
Rubinius::VariableScope.of_sender,
- Rubinius::CompiledMethod.of_sender,
+ Rubinius::CompiledCode.of_sender,
Rubinius::ConstantScope.of_sender,
self,
Rubinius::Location.of_closest_ruby_method
@@ -55,7 +55,7 @@ def eval(string, binding=nil, filename=nil, lineno=nil)
filename ||= binding.constant_scope.active_path
else
binding = Binding.setup(Rubinius::VariableScope.of_sender,
- Rubinius::CompiledMethod.of_sender,
+ Rubinius::CompiledCode.of_sender,
Rubinius::ConstantScope.of_sender,
self)
@@ -111,7 +111,7 @@ def module_eval(string=undefined, filename="(eval)", line=1, &prc)
cs = Rubinius::ConstantScope.new self, Rubinius::ConstantScope.of_sender
binding = Binding.setup(Rubinius::VariableScope.of_sender,
- Rubinius::CompiledMethod.of_sender,
+ Rubinius::CompiledCode.of_sender,
cs)
be = Rubinius::Compiler.construct_block string, binding,
View
@@ -55,7 +55,7 @@ def instance_eval(string=nil, filename="(eval)", line=1, &prc)
end
binding = Binding.setup(Rubinius::VariableScope.of_sender,
- Rubinius::CompiledMethod.of_sender,
+ Rubinius::CompiledCode.of_sender,
constant_scope)
be = Rubinius::Compiler.construct_block string, binding,
Oops, something went wrong.

0 comments on commit 35dbaf5

Please sign in to comment.