seafoam 0.8 → 0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/bin/bgv2isabelle +1 -5
  3. data/bin/bgv2json +1 -5
  4. data/bin/cfg2asm +1 -5
  5. data/bin/seafoam +1 -5
  6. data/lib/seafoam/commands.rb +48 -31
  7. data/lib/seafoam/graal/pi.rb +18 -0
  8. data/lib/seafoam/graph.rb +9 -1
  9. data/lib/seafoam/graphviz_writer.rb +3 -0
  10. data/lib/seafoam/json_writer.rb +1 -3
  11. data/lib/seafoam/{annotators → passes}/fallback.rb +4 -4
  12. data/lib/seafoam/{annotators → passes}/graal.rb +43 -13
  13. data/lib/seafoam/passes/truffle.rb +58 -0
  14. data/lib/seafoam/passes.rb +61 -0
  15. data/lib/seafoam/version.rb +1 -1
  16. data/lib/seafoam.rb +5 -4
  17. metadata +23 -60
  18. data/.github/probots.yml +0 -2
  19. data/.github/workflows/workflows.yml +0 -40
  20. data/.gitignore +0 -6
  21. data/.rubocop.yml +0 -37
  22. data/.ruby-version +0 -1
  23. data/.seafoam/config +0 -1
  24. data/CODE_OF_CONDUCT.md +0 -128
  25. data/CONTRIBUTING.md +0 -5
  26. data/Gemfile +0 -2
  27. data/Gemfile.lock +0 -59
  28. data/LICENSE.md +0 -7
  29. data/README.md +0 -378
  30. data/demos/box-unbox-stats +0 -65
  31. data/docs/annotators.md +0 -43
  32. data/docs/bgv.md +0 -294
  33. data/docs/getting-graphs.md +0 -63
  34. data/docs/images/igv.png +0 -0
  35. data/docs/images/seafoam.png +0 -0
  36. data/docs/images/spotlight-igv.png +0 -0
  37. data/docs/images/spotlight-seafoam.png +0 -0
  38. data/docs/json.md +0 -35
  39. data/examples/Fib.java +0 -24
  40. data/examples/MatMult.java +0 -39
  41. data/examples/fib-java.bgv.gz +0 -0
  42. data/examples/fib.js +0 -15
  43. data/examples/fib.rb +0 -15
  44. data/examples/identity.rb +0 -13
  45. data/examples/java/Irreducible.class +0 -0
  46. data/examples/java/Irreducible.j +0 -35
  47. data/examples/java/IrreducibleDecompiled.java +0 -21
  48. data/examples/java/JavaExamples.java +0 -418
  49. data/examples/matmult.rb +0 -29
  50. data/examples/overflow.rb +0 -13
  51. data/examples/ruby/clamps.rb +0 -20
  52. data/examples/ruby/graal.patch +0 -15
  53. data/examples/ruby/ruby_examples.rb +0 -278
  54. data/lib/seafoam/annotators.rb +0 -54
  55. data/lib/seafoam/config.rb +0 -34
  56. data/seafoam.gemspec +0 -22
  57. data/spec/seafoam/annotators/fallback_spec.rb +0 -69
  58. data/spec/seafoam/annotators/graal_spec.rb +0 -96
  59. data/spec/seafoam/annotators_spec.rb +0 -61
  60. data/spec/seafoam/bgv/bgv_parser_spec.rb +0 -167
  61. data/spec/seafoam/binary/io_binary_reader_spec.rb +0 -176
  62. data/spec/seafoam/cfg/cfg_parser_spec.rb +0 -21
  63. data/spec/seafoam/cfg/disassembler_spec.rb +0 -32
  64. data/spec/seafoam/command_spec.rb +0 -314
  65. data/spec/seafoam/graph_spec.rb +0 -172
  66. data/spec/seafoam/graphviz_writer_spec.rb +0 -63
  67. data/spec/seafoam/json_writer_spec.rb +0 -14
  68. data/spec/seafoam/spec_helpers.rb +0 -34
  69. data/spec/seafoam/spotlight_spec.rb +0 -38
  70. data/tools/render-all +0 -36
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seafoam
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.8'
4
+ version: '0.9'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Seaton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-05 00:00:00.000000000 Z
11
+ date: 2021-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: crabstone
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '2.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 13.0.6
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 13.0.6
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rspec
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -76,79 +90,29 @@ executables:
76
90
  extensions: []
77
91
  extra_rdoc_files: []
78
92
  files:
79
- - ".github/probots.yml"
80
- - ".github/workflows/workflows.yml"
81
- - ".gitignore"
82
- - ".rubocop.yml"
83
- - ".ruby-version"
84
- - ".seafoam/config"
85
- - CODE_OF_CONDUCT.md
86
- - CONTRIBUTING.md
87
- - Gemfile
88
- - Gemfile.lock
89
- - LICENSE.md
90
- - README.md
91
93
  - bin/bgv2isabelle
92
94
  - bin/bgv2json
93
95
  - bin/cfg2asm
94
96
  - bin/seafoam
95
- - demos/box-unbox-stats
96
- - docs/annotators.md
97
- - docs/bgv.md
98
- - docs/getting-graphs.md
99
- - docs/images/igv.png
100
- - docs/images/seafoam.png
101
- - docs/images/spotlight-igv.png
102
- - docs/images/spotlight-seafoam.png
103
- - docs/json.md
104
- - examples/Fib.java
105
- - examples/MatMult.java
106
- - examples/fib-java.bgv.gz
107
- - examples/fib.js
108
- - examples/fib.rb
109
- - examples/identity.rb
110
- - examples/java/Irreducible.class
111
- - examples/java/Irreducible.j
112
- - examples/java/IrreducibleDecompiled.java
113
- - examples/java/JavaExamples.java
114
- - examples/matmult.rb
115
- - examples/overflow.rb
116
- - examples/ruby/clamps.rb
117
- - examples/ruby/graal.patch
118
- - examples/ruby/ruby_examples.rb
119
97
  - lib/seafoam.rb
120
- - lib/seafoam/annotators.rb
121
- - lib/seafoam/annotators/fallback.rb
122
- - lib/seafoam/annotators/graal.rb
123
98
  - lib/seafoam/bgv/bgv_parser.rb
124
99
  - lib/seafoam/binary/io_binary_reader.rb
125
100
  - lib/seafoam/cfg/cfg_parser.rb
126
101
  - lib/seafoam/cfg/disassembler.rb
127
102
  - lib/seafoam/colors.rb
128
103
  - lib/seafoam/commands.rb
129
- - lib/seafoam/config.rb
104
+ - lib/seafoam/graal/pi.rb
130
105
  - lib/seafoam/graal/source.rb
131
106
  - lib/seafoam/graph.rb
132
107
  - lib/seafoam/graphviz_writer.rb
133
108
  - lib/seafoam/isabelle_writer.rb
134
109
  - lib/seafoam/json_writer.rb
110
+ - lib/seafoam/passes.rb
111
+ - lib/seafoam/passes/fallback.rb
112
+ - lib/seafoam/passes/graal.rb
113
+ - lib/seafoam/passes/truffle.rb
135
114
  - lib/seafoam/spotlight.rb
136
115
  - lib/seafoam/version.rb
137
- - seafoam.gemspec
138
- - spec/seafoam/annotators/fallback_spec.rb
139
- - spec/seafoam/annotators/graal_spec.rb
140
- - spec/seafoam/annotators_spec.rb
141
- - spec/seafoam/bgv/bgv_parser_spec.rb
142
- - spec/seafoam/binary/io_binary_reader_spec.rb
143
- - spec/seafoam/cfg/cfg_parser_spec.rb
144
- - spec/seafoam/cfg/disassembler_spec.rb
145
- - spec/seafoam/command_spec.rb
146
- - spec/seafoam/graph_spec.rb
147
- - spec/seafoam/graphviz_writer_spec.rb
148
- - spec/seafoam/json_writer_spec.rb
149
- - spec/seafoam/spec_helpers.rb
150
- - spec/seafoam/spotlight_spec.rb
151
- - tools/render-all
152
116
  homepage: https://github.com/Shopify/seafoam
153
117
  licenses:
154
118
  - MIT
@@ -161,15 +125,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
161
125
  requirements:
162
126
  - - ">="
163
127
  - !ruby/object:Gem::Version
164
- version: 2.5.8
128
+ version: 2.5.9
165
129
  required_rubygems_version: !ruby/object:Gem::Requirement
166
130
  requirements:
167
131
  - - ">="
168
132
  - !ruby/object:Gem::Version
169
133
  version: '0'
170
134
  requirements: []
171
- rubyforge_project:
172
- rubygems_version: 2.7.6.3
135
+ rubygems_version: 3.2.22
173
136
  signing_key:
174
137
  specification_version: 4
175
138
  summary: A tool for working with compiler graphs
data/.github/probots.yml DELETED
@@ -1,2 +0,0 @@
1
- enabled:
2
- - cla
@@ -1,40 +0,0 @@
1
- name: Workflows
2
- on: [push]
3
- jobs:
4
- rubocop:
5
- runs-on: ubuntu-latest
6
- steps:
7
- - uses: actions/checkout@v2
8
- - uses: ruby/setup-ruby@v1
9
- - run: gem install bundler:1.17.2
10
- - run: bundle install
11
- - run: bundle exec rubocop
12
- specs:
13
- strategy:
14
- matrix:
15
- os: [ubuntu, macos]
16
- ruby: [2.5, 2.6, 2.7, 3.0]
17
- runs-on: ${{ matrix.os }}-latest
18
- steps:
19
- - uses: actions/checkout@v2
20
- - uses: ruby/setup-ruby@v1
21
- with:
22
- ruby-version: ${{ matrix.ruby }}
23
- bundler-cache: true
24
- - run: bundle install
25
- - run: if [[ $(uname) == "Darwin" ]]; then brew install graphviz capstone; else sudo apt-get install graphviz libcapstone3; fi
26
- - run: bundle exec rspec
27
- specs-no-dependencies:
28
- strategy:
29
- matrix:
30
- os: [ubuntu, macos]
31
- ruby: [2.5, 2.6, 2.7, 3.0]
32
- runs-on: ${{ matrix.os }}-latest
33
- steps:
34
- - uses: actions/checkout@v2
35
- - uses: ruby/setup-ruby@v1
36
- with:
37
- ruby-version: ${{ matrix.ruby }}
38
- bundler-cache: true
39
- - run: bundle install
40
- - run: NO_DEPENDENCIES_INSTALLED=true bundle exec rspec
data/.gitignore DELETED
@@ -1,6 +0,0 @@
1
- *.pdf
2
- *.dot
3
- *.png
4
- *.svg
5
- *.class
6
- /.idea
data/.rubocop.yml DELETED
@@ -1,37 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 2.5
3
- Exclude:
4
- - examples/**/*.rb
5
-
6
- Style/FrozenStringLiteralComment:
7
- Enabled: false
8
-
9
- Style/MutableConstant:
10
- Enabled: false
11
-
12
- Metrics:
13
- Enabled: false
14
-
15
- Lint/EmptyWhen:
16
- Enabled: false
17
-
18
- Style/ConditionalAssignment:
19
- Enabled: false
20
-
21
- Style/GuardClause:
22
- Enabled: false
23
-
24
- Style/IfUnlessModifier:
25
- Enabled: false
26
-
27
- Lint/InterpolationCheck:
28
- Enabled: false
29
-
30
- Security/Eval:
31
- Enabled: false
32
-
33
- Naming/FileName:
34
- Enabled: false
35
-
36
- Metrics/LineLength:
37
- Max: 300
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.5.9
data/.seafoam/config DELETED
@@ -1 +0,0 @@
1
- # Empty configuration file
data/CODE_OF_CONDUCT.md DELETED
@@ -1,128 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our
6
- community a harassment-free experience for everyone, regardless of age, body
7
- size, visible or invisible disability, ethnicity, sex characteristics, gender
8
- identity and expression, level of experience, education, socio-economic status,
9
- nationality, personal appearance, race, religion, or sexual identity
10
- and orientation.
11
-
12
- We pledge to act and interact in ways that contribute to an open, welcoming,
13
- diverse, inclusive, and healthy community.
14
-
15
- ## Our Standards
16
-
17
- Examples of behavior that contributes to a positive environment for our
18
- community include:
19
-
20
- * Demonstrating empathy and kindness toward other people
21
- * Being respectful of differing opinions, viewpoints, and experiences
22
- * Giving and gracefully accepting constructive feedback
23
- * Accepting responsibility and apologizing to those affected by our mistakes,
24
- and learning from the experience
25
- * Focusing on what is best not just for us as individuals, but for the
26
- overall community
27
-
28
- Examples of unacceptable behavior include:
29
-
30
- * The use of sexualized language or imagery, and sexual attention or
31
- advances of any kind
32
- * Trolling, insulting or derogatory comments, and personal or political attacks
33
- * Public or private harassment
34
- * Publishing others' private information, such as a physical or email
35
- address, without their explicit permission
36
- * Other conduct which could reasonably be considered inappropriate in a
37
- professional setting
38
-
39
- ## Enforcement Responsibilities
40
-
41
- Community leaders are responsible for clarifying and enforcing our standards of
42
- acceptable behavior and will take appropriate and fair corrective action in
43
- response to any behavior that they deem inappropriate, threatening, offensive,
44
- or harmful.
45
-
46
- Community leaders have the right and responsibility to remove, edit, or reject
47
- comments, commits, code, wiki edits, issues, and other contributions that are
48
- not aligned to this Code of Conduct, and will communicate reasons for moderation
49
- decisions when appropriate.
50
-
51
- ## Scope
52
-
53
- This Code of Conduct applies within all community spaces, and also applies when
54
- an individual is officially representing the community in public spaces.
55
- Examples of representing our community include using an official e-mail address,
56
- posting via an official social media account, or acting as an appointed
57
- representative at an online or offline event.
58
-
59
- ## Enforcement
60
-
61
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
- reported to the community leaders responsible for enforcement at
63
- opensource@shopify.com.
64
- All complaints will be reviewed and investigated promptly and fairly.
65
-
66
- All community leaders are obligated to respect the privacy and security of the
67
- reporter of any incident.
68
-
69
- ## Enforcement Guidelines
70
-
71
- Community leaders will follow these Community Impact Guidelines in determining
72
- the consequences for any action they deem in violation of this Code of Conduct:
73
-
74
- ### 1. Correction
75
-
76
- **Community Impact**: Use of inappropriate language or other behavior deemed
77
- unprofessional or unwelcome in the community.
78
-
79
- **Consequence**: A private, written warning from community leaders, providing
80
- clarity around the nature of the violation and an explanation of why the
81
- behavior was inappropriate. A public apology may be requested.
82
-
83
- ### 2. Warning
84
-
85
- **Community Impact**: A violation through a single incident or series
86
- of actions.
87
-
88
- **Consequence**: A warning with consequences for continued behavior. No
89
- interaction with the people involved, including unsolicited interaction with
90
- those enforcing the Code of Conduct, for a specified period of time. This
91
- includes avoiding interactions in community spaces as well as external channels
92
- like social media. Violating these terms may lead to a temporary or
93
- permanent ban.
94
-
95
- ### 3. Temporary Ban
96
-
97
- **Community Impact**: A serious violation of community standards, including
98
- sustained inappropriate behavior.
99
-
100
- **Consequence**: A temporary ban from any sort of interaction or public
101
- communication with the community for a specified period of time. No public or
102
- private interaction with the people involved, including unsolicited interaction
103
- with those enforcing the Code of Conduct, is allowed during this period.
104
- Violating these terms may lead to a permanent ban.
105
-
106
- ### 4. Permanent Ban
107
-
108
- **Community Impact**: Demonstrating a pattern of violation of community
109
- standards, including sustained inappropriate behavior, harassment of an
110
- individual, or aggression toward or disparagement of classes of individuals.
111
-
112
- **Consequence**: A permanent ban from any sort of public interaction within
113
- the community.
114
-
115
- ## Attribution
116
-
117
- This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
- version 2.0, available at
119
- https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
-
121
- Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
- enforcement ladder](https://github.com/mozilla/diversity).
123
-
124
- [homepage]: https://www.contributor-covenant.org
125
-
126
- For answers to common questions about this code of conduct, see the FAQ at
127
- https://www.contributor-covenant.org/faq. Translations are available at
128
- https://www.contributor-covenant.org/translations.
data/CONTRIBUTING.md DELETED
@@ -1,5 +0,0 @@
1
- # Contribution
2
-
3
- Contributions welcome. Please discuss big ideas in an issue first.
4
-
5
- You'll need to sign the Shopify Contributor License Agreement (CLA) https://cla.shopify.com/.
data/Gemfile DELETED
@@ -1,2 +0,0 @@
1
- source 'https://rubygems.org'
2
- gemspec
data/Gemfile.lock DELETED
@@ -1,59 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- seafoam (0.7)
5
- crabstone (~> 4.0)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- ast (2.4.2)
11
- benchmark-ips (2.8.4)
12
- crabstone (4.0.3)
13
- ffi
14
- diff-lcs (1.4.4)
15
- ffi (1.15.0)
16
- parallel (1.20.1)
17
- parser (3.0.1.1)
18
- ast (~> 2.4.1)
19
- rainbow (3.0.0)
20
- regexp_parser (2.1.1)
21
- rexml (3.2.5)
22
- rspec (3.10.0)
23
- rspec-core (~> 3.10.0)
24
- rspec-expectations (~> 3.10.0)
25
- rspec-mocks (~> 3.10.0)
26
- rspec-core (3.10.1)
27
- rspec-support (~> 3.10.0)
28
- rspec-expectations (3.10.1)
29
- diff-lcs (>= 1.2.0, < 2.0)
30
- rspec-support (~> 3.10.0)
31
- rspec-mocks (3.10.2)
32
- diff-lcs (>= 1.2.0, < 2.0)
33
- rspec-support (~> 3.10.0)
34
- rspec-support (3.10.2)
35
- rubocop (0.93.1)
36
- parallel (~> 1.10)
37
- parser (>= 2.7.1.5)
38
- rainbow (>= 2.2.2, < 4.0)
39
- regexp_parser (>= 1.8)
40
- rexml
41
- rubocop-ast (>= 0.6.0)
42
- ruby-progressbar (~> 1.7)
43
- unicode-display_width (>= 1.4.0, < 2.0)
44
- rubocop-ast (1.5.0)
45
- parser (>= 3.0.1.1)
46
- ruby-progressbar (1.11.0)
47
- unicode-display_width (1.7.0)
48
-
49
- PLATFORMS
50
- ruby
51
-
52
- DEPENDENCIES
53
- benchmark-ips (~> 2.7)
54
- rspec (~> 3.8)
55
- rubocop (~> 0.74)
56
- seafoam!
57
-
58
- BUNDLED WITH
59
- 1.17.2
data/LICENSE.md DELETED
@@ -1,7 +0,0 @@
1
- Copyright 2019-present, Shopify Inc.
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.