Skip to content

Commit c041673

Browse files
Initial analysis: plan to upgrade JGit from 7.0.0 to 7.3.0
Co-authored-by: bartkamphorst <571173+bartkamphorst@users.noreply.github.com>
1 parent 900dad3 commit c041673

2,633 files changed

Lines changed: 409166 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

jruby-9.4.8.0/BSDL

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
2+
3+
Redistribution and use in source and binary forms, with or without
4+
modification, are permitted provided that the following conditions
5+
are met:
6+
1. Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
2. Redistributions in binary form must reproduce the above copyright
9+
notice, this list of conditions and the following disclaimer in the
10+
documentation and/or other materials provided with the distribution.
11+
12+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22+
SUCH DAMAGE.

jruby-9.4.8.0/COPYING

Lines changed: 1433 additions & 0 deletions
Large diffs are not rendered by default.

jruby-9.4.8.0/LEGAL

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
In Ruby's source distribution, this would describe a number of C source files
2+
that have different licenses than Ruby itself. None of those apply to JRuby,
3+
so we have this file here as a placeholder because Ola said so.

jruby-9.4.8.0/LICENSE.RUBY

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
JRuby distributes some ruby modules which are distributed under Ruby
2+
license:
3+
4+
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
5+
You can redistribute it and/or modify it under either the terms of the
6+
2-clause BSDL (see the file BSDL), or the conditions below:
7+
8+
1. You may make and give away verbatim copies of the source form of the
9+
software without restriction, provided that you duplicate all of the
10+
original copyright notices and associated disclaimers.
11+
12+
2. You may modify your copy of the software in any way, provided that
13+
you do at least ONE of the following:
14+
15+
a) place your modifications in the Public Domain or otherwise
16+
make them Freely Available, such as by posting said
17+
modifications to Usenet or an equivalent medium, or by allowing
18+
the author to include your modifications in the software.
19+
20+
b) use the modified software only within your corporation or
21+
organization.
22+
23+
c) give non-standard binaries non-standard names, with
24+
instructions on where to get the original software distribution.
25+
26+
d) make other distribution arrangements with the author.
27+
28+
3. You may distribute the software in object code or binary form,
29+
provided that you do at least ONE of the following:
30+
31+
a) distribute the binaries and library files of the software,
32+
together with instructions (in the manual page or equivalent)
33+
on where to get the original distribution.
34+
35+
b) accompany the distribution with the machine-readable source of
36+
the software.
37+
38+
c) give non-standard binaries non-standard names, with
39+
instructions on where to get the original software distribution.
40+
41+
d) make other distribution arrangements with the author.
42+
43+
4. You may modify and include the part of the software into any other
44+
software (possibly commercial). But some files in the distribution
45+
are not written by the author, so that they are not under these terms.
46+
47+
For the list of those files and their copying conditions, see the
48+
file LEGAL.
49+
50+
5. The scripts and library files supplied as input to or produced as
51+
output from the software do not automatically fall under the
52+
copyright of the software, but belong to whomever generated them,
53+
and may be sold commercially, and may be aggregated with this
54+
software.
55+
56+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
57+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
58+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
59+
PURPOSE.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-XX:+TieredCompilation
2+
-XX:TieredStopAtLevel=1
3+
-XX:-PrintWarnings
4+
-Djruby.compile.mode=OFF
5+
-Djruby.compile.invokedynamic=false
6+
-Djnr.ffi.asm.enabled=false
7+
-Xverify:none
8+

jruby-9.4.8.0/bin/.jruby.java_opts

Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
--add-opens java.base/java.io=org.jruby.dist
2+
--add-opens java.base/java.nio.channels=org.jruby.dist
3+
--add-opens java.base/sun.nio.ch=org.jruby.dist
4+
--add-opens java.management/sun.management=org.jruby.dist

jruby-9.4.8.0/bin/ast

Lines changed: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
#!/usr/bin/env jruby
2+
3+
require 'optparse'
4+
require 'jruby'
5+
6+
opts = {}
7+
options = {
8+
:print_source => false,
9+
:print_sexp => false,
10+
:print_ast => true,
11+
:print_ir => false,
12+
:print_pass => nil,
13+
:pretty_ir => false,
14+
:dot_format => false
15+
}
16+
17+
OptionParser.new do |opts|
18+
opts.banner = "Usage: #{$0} [options]"
19+
20+
opts.on('-d', '--dot', 'Display as dot data') do |h|
21+
options[:dot_format] = true
22+
end
23+
24+
opts.on('-h', '--help', 'Display this help') do |h|
25+
puts opts
26+
exit true
27+
end
28+
29+
opts.on('-i', '--ir', 'Dump all IR passes without executing') do |h|
30+
options[:print_ir] = true
31+
end
32+
33+
opts.on('-p', '--pass passes_list', 'Dump IR after running a pass') do |pass|
34+
options[:print_pass] = pass
35+
end
36+
37+
opts.on('-f', '--formatted-ir', 'Pretty printer for IR (without CFG)') do |f|
38+
options[:pretty_ir] = f
39+
end
40+
41+
opts.on('-s', '--sexp', 'Display the S-Expression for the AST') do |t|
42+
options[:print_sexp] = true
43+
end
44+
45+
opts.on('--source', 'Display the source') do |s|
46+
options[:print_source] = true
47+
end
48+
49+
opts.on('--no-ast', 'Do not print out the AST for this (only useful with -s)') do |a|
50+
options[:print_ast] = false
51+
end
52+
53+
opts.on('-e exp', '--expression') do |e|
54+
options[:expression] = e
55+
end
56+
57+
end.parse!
58+
59+
if ARGV.length > 1
60+
abort "You may only specify one script (see --help)"
61+
elsif ARGV.length == 1
62+
if options[:expression]
63+
abort "-e and a script is not a valid combination (see --help)"
64+
end
65+
options[:expression] = File.read(ARGV.shift)
66+
elsif ! options.has_key?(:expression)
67+
abort "No script specified (see --help)"
68+
end
69+
70+
if options[:print_ir] && options[:print_pass]
71+
abort "-p and -i is not valid. Use only one of them (see --help)"
72+
end
73+
74+
$indent_string = " "
75+
76+
def indexes(string, lindex, rindex)
77+
lindex = string.index("(", lindex) if lindex != nil
78+
rindex = string.index(")", rindex) if rindex != nil
79+
return lindex, rindex
80+
end
81+
82+
def indent(string)
83+
depth = -1
84+
85+
lindex, rindex = indexes(string, 0, 0)
86+
87+
while (lindex != nil || rindex != nil)
88+
if (lindex != nil && lindex < rindex)
89+
depth += 1
90+
string[lindex, 1] = "\n#{$indent_string * depth}"
91+
else
92+
depth -= 1
93+
string[rindex, 1] = "\n"
94+
end
95+
96+
lindex, rindex = indexes(string, lindex, rindex)
97+
end
98+
string.gsub(/,\s*$/, '').squeeze("\n")
99+
end
100+
101+
if options[:print_source]
102+
puts "Source:"
103+
puts options[:expression]
104+
puts
105+
end
106+
107+
module DotGraph
108+
def self.dot_label(node)
109+
extra = case node
110+
when org.jruby.ast.StrNode then
111+
": '#{node.value}'"
112+
when org.jruby.ast.FixnumNode then
113+
": #{node.value}"
114+
when org.jruby.ast.FloatNode then
115+
": #{node.value}"
116+
when org.jruby.ast.types.INameNode then
117+
": #{node.name}"
118+
else
119+
""
120+
end
121+
122+
"#{short_name(node)}#{extra}"
123+
end
124+
125+
def self.short_name(node)
126+
node.class.name.split("::")[-1].gsub("Node", "")
127+
end
128+
129+
def self.dot_node_def(node)
130+
%Q{#{node.hash} [label="#{dot_label(node)}"];\n}
131+
end
132+
133+
def self.dot(defs, parent)
134+
defs[parent.hash] = dot_node_def(parent)
135+
136+
"".tap do |str|
137+
parent.child_nodes.each do |child|
138+
str << "#{parent.hash} -> #{child.hash};\n"
139+
str << dot(defs, child)
140+
end
141+
end
142+
end
143+
144+
def self.print_graph(root_node)
145+
defs = {}
146+
graph_section = DotGraph.dot(defs, root_node)
147+
puts "digraph AST {"
148+
puts defs.values.join('')
149+
puts graph_section
150+
puts "}"
151+
end
152+
end
153+
154+
root = JRuby.parse(options[:expression])
155+
156+
if options[:print_ast]
157+
if options[:dot_format]
158+
DotGraph.print_graph(root)
159+
else
160+
print "AST:"
161+
puts indent(root.to_string)
162+
puts
163+
end
164+
end
165+
166+
def print_passes_on(scope, passes)
167+
if !scope.kind_of? org.jruby.ir.IRClosure
168+
passes.each { |pass| pass.run(scope) }
169+
end
170+
171+
scope.lexical_scopes.each do |child_scope|
172+
child_scope.prepare_for_compilation
173+
print_passes_on(child_scope, passes)
174+
end
175+
end
176+
177+
def print_pass_on(scope, pass)
178+
if !scope.kind_of? org.jruby.ir.IRClosure
179+
pass.run(scope)
180+
end
181+
182+
scope.lexical_scopes.each do |child_scope|
183+
print_pass_on(child_scope, pass)
184+
end
185+
end
186+
187+
def ir_setup(root)
188+
runtime = JRuby::runtime
189+
manager = runtime.ir_manager
190+
191+
JRuby::IR.compiler_debug = true
192+
193+
194+
builder = org.jruby.ir.builder.IRBuilderAST
195+
196+
scope = builder.build_root(manager, root).scope
197+
scope.prepare_for_compilation
198+
passes = manager.get_compiler_passes(scope)
199+
[scope, passes]
200+
end
201+
202+
module IRPrettyPrinter
203+
def self.pretty_ir(scope, indent="")
204+
i = 0
205+
pretty_str = scope.instrs.map do |instr|
206+
f_str = "%s%3i\s\s%s" % [indent, i, instr]
207+
i += 1
208+
f_str
209+
end
210+
pretty_str = [indent + scope.to_s] + pretty_str
211+
scope.lexical_scopes.each do |lex_scope|
212+
pretty_str += pretty_ir(lex_scope, indent + "\s" * 4)
213+
end
214+
pretty_str
215+
end
216+
217+
def self.print_ir(scope)
218+
instrs = pretty_ir(scope)
219+
instrs.each do |instr|
220+
puts instr
221+
end
222+
end
223+
end
224+
225+
if options[:pretty_ir]
226+
scope, passes = ir_setup(root)
227+
puts "IR:"
228+
IRPrettyPrinter.print_ir(scope)
229+
end
230+
231+
if options[:print_pass]
232+
scope, passes = ir_setup(root)
233+
pass_name = options[:print_pass]
234+
pass = passes.find do |p|
235+
p.java_class.to_s.include?(pass_name.to_s)
236+
end
237+
print_pass_on(scope, pass)
238+
end
239+
240+
if options[:print_ir]
241+
scope, passes = ir_setup(root)
242+
243+
print_passes_on(scope, passes)
244+
end
245+
246+
if options[:print_sexp]
247+
puts "SEXP:"
248+
puts org.jruby.ast.util.SexpMaker.create(root)
249+
end

jruby-9.4.8.0/bin/ast.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@ECHO OFF
2+
@"%~dp0jruby.exe" -S ast %*

jruby-9.4.8.0/bin/bundle

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env jruby
2+
#
3+
# This file was generated by RubyGems.
4+
#
5+
# The application 'bundler' is installed as part of a gem, and
6+
# this file is here to facilitate running it.
7+
#
8+
9+
require 'rubygems'
10+
11+
version = ">= 0.a"
12+
13+
str = ARGV.first
14+
if str
15+
str = str.b[/\A_(.*)_\z/, 1]
16+
if str and Gem::Version.correct?(str)
17+
version = str
18+
ENV['BUNDLER_VERSION'] = str
19+
20+
ARGV.shift
21+
end
22+
end
23+
24+
if Gem.respond_to?(:activate_bin_path)
25+
load Gem.activate_bin_path('bundler', 'bundle', version)
26+
else
27+
gem "bundler", version
28+
load Gem.bin_path("bundler", "bundle", version)
29+
end

0 commit comments

Comments
 (0)