cast_off 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -53,13 +53,10 @@ opt.on_tail('-h', "--help", "Show this help.") do
53
53
  ------------------------------------------
54
54
 
55
55
  1 Profile and compile fib.rb:
56
- $cast_off fib.rb 10 # 10 is a argument of fib.rb.
57
- # Because profile execution is very slow,
58
- # argument of fib.rb is 10 to finish profile execution faster.
56
+ $cast_off fib.rb 30 # 30 is a argument of fib.rb
59
57
 
60
58
  2 Run fib.rb with compiled codes:
61
- $cast_off --run fib.rb 35 # 35 is a argument of fib.rb.
62
- # Compiled fib is used in this execution, so fib.rb runs faster.
59
+ $cast_off --run fib.rb 30 # 30 is a argument of fib.rb
63
60
 
64
61
  Report bugs to <http://github.com/soba1104/CastOff/issues>.
65
62
  EOS
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "cast_off"
3
- spec.version = "0.4.0"
3
+ spec.version = "0.4.1"
4
4
  spec.platform = Gem::Platform::RUBY
5
5
  spec.summary = "Compiler for Ruby1.9.3"
6
6
  spec.description = <<-EOS
@@ -27,6 +27,6 @@ So, if you attempt to use CastOff, please install CastOff under Ruby1.9.3 runtim
27
27
  spec.email = 'shiba@rvm.jp'
28
28
  spec.homepage = 'http://github.com/soba1104/CastOff'
29
29
  #spec.rubyforge_project = 'cast_off'
30
- spec.required_ruby_version = '= 1.9.3'
30
+ spec.required_ruby_version = '>= 1.9.3'
31
31
  end
32
32
 
@@ -110,7 +110,7 @@ static inline VALUE MULT(long a, long b)
110
110
  % :binary_operator,
111
111
  % {'VALUE' => 'FIX2LONG', 'long' => ''},
112
112
  % {'VALUE' => 'FIX2LONG', 'long' => ''},
113
- % {'VALUE' => 'CBOOL2RBOOL'}],
113
+ % {'VALUE' => ''}],
114
114
  % ['fixnum_float',
115
115
  % {'+' => 'plus', '-' => 'minus', '*' => 'mult'},
116
116
  % 1,
@@ -46,7 +46,7 @@ module CastOff
46
46
  # trace method invocation
47
47
  # TODO should handle singleton class
48
48
 
49
- method_table = (class_table[klass] ||= Hash.new(0))
49
+ method_table = (class_table[klass] ||= Hash.new(-1))
50
50
  count = (method_table[mid] += 1)
51
51
  #count = @@compilation_threshold if contain_loop?(klass, mid) if count == 0
52
52
  if count == @@compilation_threshold
@@ -432,7 +432,7 @@ Currently, CastOff cannot compile method which source file is not exist.
432
432
  union_base_configuration(conf, manager)
433
433
  end
434
434
  warn("compilng #{mid}...")
435
- vlog("use configuration #{conf}, has_binding? = #{!!conf.bind}")
435
+ vlog("use configuration #{conf}, binding = #{!!conf.bind}")
436
436
 
437
437
  require 'cast_off/compile/namespace/uuid'
438
438
  require 'cast_off/compile/namespace/namespace'
@@ -632,10 +632,9 @@ Currently, CastOff cannot compile method which source file is not exist.
632
632
  last = manager.load_last_configuration()
633
633
  bind = last ? (last.bind ? last.bind.bind : nil) : nil
634
634
  base_configuration = Configuration.new({}, bind)
635
- update_p = true
636
635
  end
637
636
  bug() unless base_configuration.instance_of?(Configuration)
638
- update_p |= update_configuration(base_configuration, reciever_result, return_value_result)
637
+ update_p = update_configuration(base_configuration, reciever_result, return_value_result)
639
638
  return false unless update_p
640
639
  manager.save_base_configuration(base_configuration)
641
640
  true
@@ -1486,12 +1486,10 @@ Call site is (#{@insn}).
1486
1486
  attr_reader :method_id
1487
1487
 
1488
1488
  IncompatMethods = [
1489
- :eval, # use vm_get_ruby_level_caller_cfp
1490
- :binding, # use vm_get_ruby_level_caller_cfp
1491
- :block_given?, # use vm_get_ruby_level_caller_cfp
1492
- :iterator?, # use vm_get_ruby_level_caller_cfp
1493
- :__method__, # use rb_frame_caller()
1494
- :__callee__, # use rb_frame_caller()
1489
+ :eval, # use vm_get_ruby_level_caller_cfp
1490
+ :binding, # use vm_get_ruby_level_caller_cfp
1491
+ :block_given?, # use vm_get_ruby_level_caller_cfp
1492
+ :iterator?, # use vm_get_ruby_level_caller_cfp
1495
1493
  ]
1496
1494
 
1497
1495
  def initialize(mid, flags, param, argc, return_value, insn, cfg)
@@ -1068,14 +1068,17 @@ Source line is #{@root_iseq.source_line}.
1068
1068
  end
1069
1069
 
1070
1070
  # for suggestion
1071
- MSG_TYPE_NOT_RESOLVED = "Unresolved receivers"
1071
+ MSG_TYPE_NOT_RESOLVED = "Reciever not resolved."
1072
1072
  COL_TYPE_NOT_RESOLVED = ["<Reciever>", "<Method>", "<Line>", "<Source>"]
1073
- MSG_LITERAL_DUPLICATED = "Duplicated literals"
1073
+ MSG_LITERAL_DUPLICATED = "These literals have duplicated."
1074
1074
  COL_LITERAL_DUPLICATED = ["<Literal>", "<Reason>", "<Line>", "<Source>"]
1075
+ MSG_INLINEAPI_NOT_USED = "Some inline apis have not used."
1076
+ COL_INLINEAPI_NOT_USED = ["<Method>", "<Reason>", "<Line>", "<Source>"]
1075
1077
 
1076
1078
  SUGGESTION_TABLE = [
1077
1079
  [MSG_TYPE_NOT_RESOLVED, COL_TYPE_NOT_RESOLVED, :@type_suggestion],
1078
1080
  [MSG_LITERAL_DUPLICATED, COL_LITERAL_DUPLICATED, :@literal_suggestion],
1081
+ [MSG_INLINEAPI_NOT_USED, COL_INLINEAPI_NOT_USED, :@inlineapi_suggestion],
1079
1082
  ]
1080
1083
 
1081
1084
  SUGGESTION_TABLE.each do |(msg, col, ivar)|
@@ -81,7 +81,7 @@ module CastOff
81
81
  suggestion << "#{side}#{line.zip(l_titles).map{|c, l| pretty ? c.center(l) : c }.join(" | ")}#{side}"
82
82
  end
83
83
  suggestion << " #{sep} "
84
- @suggestion << suggestion.map{|s| s.force_encoding('ASCII-8BIT')}.join("\n")
84
+ @suggestion << suggestion.join("\n")
85
85
  end
86
86
 
87
87
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cast_off
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-07 00:00:00.000000000 Z
12
+ date: 2012-02-22 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! "CastOff is a compiler for Ruby1.9.3.\nCommand line tool cast_off is
15
15
  available after installation.\nSee 'cast_off --help' for more information.\nCurrently,
@@ -106,7 +106,7 @@ require_paths:
106
106
  required_ruby_version: !ruby/object:Gem::Requirement
107
107
  none: false
108
108
  requirements:
109
- - - =
109
+ - - ! '>='
110
110
  - !ruby/object:Gem::Version
111
111
  version: 1.9.3
112
112
  required_rubygems_version: !ruby/object:Gem::Requirement