seafoam 0.7 → 0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) 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/bgv/bgv_parser.rb +11 -4
  7. data/lib/seafoam/commands.rb +140 -58
  8. data/lib/seafoam/formatters/base.rb +88 -0
  9. data/lib/seafoam/formatters/formatters.rb +8 -0
  10. data/lib/seafoam/formatters/json.rb +82 -0
  11. data/lib/seafoam/formatters/text.rb +70 -0
  12. data/lib/seafoam/graal/graph_description.rb +22 -0
  13. data/lib/seafoam/graal/pi.rb +18 -0
  14. data/lib/seafoam/graal/source.rb +5 -9
  15. data/lib/seafoam/graph.rb +33 -1
  16. data/lib/seafoam/graphviz_writer.rb +24 -2
  17. data/lib/seafoam/json_writer.rb +1 -3
  18. data/lib/seafoam/{annotators → passes}/fallback.rb +4 -4
  19. data/lib/seafoam/{annotators → passes}/graal.rb +43 -15
  20. data/lib/seafoam/passes/truffle.rb +58 -0
  21. data/lib/seafoam/passes.rb +61 -0
  22. data/lib/seafoam/version.rb +1 -1
  23. data/lib/seafoam.rb +7 -4
  24. metadata +34 -63
  25. data/.github/probots.yml +0 -2
  26. data/.github/workflows/workflows.yml +0 -39
  27. data/.gitignore +0 -7
  28. data/.rubocop.yml +0 -37
  29. data/.ruby-version +0 -1
  30. data/.seafoam/config +0 -1
  31. data/CODE_OF_CONDUCT.md +0 -128
  32. data/CONTRIBUTING.md +0 -5
  33. data/Gemfile +0 -2
  34. data/LICENSE.md +0 -7
  35. data/README.md +0 -378
  36. data/demos/box-unbox-stats +0 -65
  37. data/docs/annotators.md +0 -43
  38. data/docs/bgv.md +0 -293
  39. data/docs/getting-graphs.md +0 -59
  40. data/docs/images/igv.png +0 -0
  41. data/docs/images/seafoam.png +0 -0
  42. data/docs/images/spotlight-igv.png +0 -0
  43. data/docs/images/spotlight-seafoam.png +0 -0
  44. data/docs/json.md +0 -35
  45. data/examples/Fib.java +0 -24
  46. data/examples/MatMult.java +0 -39
  47. data/examples/fib-java.bgv.gz +0 -0
  48. data/examples/fib.js +0 -15
  49. data/examples/fib.rb +0 -15
  50. data/examples/identity.rb +0 -13
  51. data/examples/java/Irreducible.class +0 -0
  52. data/examples/java/Irreducible.j +0 -35
  53. data/examples/java/IrreducibleDecompiled.java +0 -21
  54. data/examples/java/JavaExamples.java +0 -418
  55. data/examples/matmult.rb +0 -29
  56. data/examples/overflow.rb +0 -13
  57. data/examples/ruby/clamps.rb +0 -20
  58. data/examples/ruby/graal.patch +0 -15
  59. data/examples/ruby/ruby_examples.rb +0 -278
  60. data/lib/seafoam/annotators.rb +0 -54
  61. data/lib/seafoam/config.rb +0 -34
  62. data/seafoam.gemspec +0 -22
  63. data/spec/seafoam/annotators/fallback_spec.rb +0 -69
  64. data/spec/seafoam/annotators/graal_spec.rb +0 -96
  65. data/spec/seafoam/annotators_spec.rb +0 -61
  66. data/spec/seafoam/bgv/bgv_parser_spec.rb +0 -157
  67. data/spec/seafoam/binary/io_binary_reader_spec.rb +0 -176
  68. data/spec/seafoam/cfg/cfg_parser_spec.rb +0 -21
  69. data/spec/seafoam/cfg/disassembler_spec.rb +0 -32
  70. data/spec/seafoam/command_spec.rb +0 -316
  71. data/spec/seafoam/graph_spec.rb +0 -172
  72. data/spec/seafoam/graphviz_writer_spec.rb +0 -63
  73. data/spec/seafoam/json_writer_spec.rb +0 -14
  74. data/spec/seafoam/spec_helpers.rb +0 -34
  75. data/spec/seafoam/spotlight_spec.rb +0 -38
  76. 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.7'
4
+ version: '0.11'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Seaton
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-05 00:00:00.000000000 Z
11
+ date: 2022-01-26 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
@@ -66,8 +80,8 @@ dependencies:
66
80
  - - "~>"
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0.74'
69
- description:
70
- email:
83
+ description:
84
+ email:
71
85
  executables:
72
86
  - seafoam
73
87
  - bgv2json
@@ -76,83 +90,39 @@ 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
- - LICENSE.md
89
- - README.md
90
93
  - bin/bgv2isabelle
91
94
  - bin/bgv2json
92
95
  - bin/cfg2asm
93
96
  - bin/seafoam
94
- - demos/box-unbox-stats
95
- - docs/annotators.md
96
- - docs/bgv.md
97
- - docs/getting-graphs.md
98
- - docs/images/igv.png
99
- - docs/images/seafoam.png
100
- - docs/images/spotlight-igv.png
101
- - docs/images/spotlight-seafoam.png
102
- - docs/json.md
103
- - examples/Fib.java
104
- - examples/MatMult.java
105
- - examples/fib-java.bgv.gz
106
- - examples/fib.js
107
- - examples/fib.rb
108
- - examples/identity.rb
109
- - examples/java/Irreducible.class
110
- - examples/java/Irreducible.j
111
- - examples/java/IrreducibleDecompiled.java
112
- - examples/java/JavaExamples.java
113
- - examples/matmult.rb
114
- - examples/overflow.rb
115
- - examples/ruby/clamps.rb
116
- - examples/ruby/graal.patch
117
- - examples/ruby/ruby_examples.rb
118
97
  - lib/seafoam.rb
119
- - lib/seafoam/annotators.rb
120
- - lib/seafoam/annotators/fallback.rb
121
- - lib/seafoam/annotators/graal.rb
122
98
  - lib/seafoam/bgv/bgv_parser.rb
123
99
  - lib/seafoam/binary/io_binary_reader.rb
124
100
  - lib/seafoam/cfg/cfg_parser.rb
125
101
  - lib/seafoam/cfg/disassembler.rb
126
102
  - lib/seafoam/colors.rb
127
103
  - lib/seafoam/commands.rb
128
- - lib/seafoam/config.rb
104
+ - lib/seafoam/formatters/base.rb
105
+ - lib/seafoam/formatters/formatters.rb
106
+ - lib/seafoam/formatters/json.rb
107
+ - lib/seafoam/formatters/text.rb
108
+ - lib/seafoam/graal/graph_description.rb
109
+ - lib/seafoam/graal/pi.rb
129
110
  - lib/seafoam/graal/source.rb
130
111
  - lib/seafoam/graph.rb
131
112
  - lib/seafoam/graphviz_writer.rb
132
113
  - lib/seafoam/isabelle_writer.rb
133
114
  - lib/seafoam/json_writer.rb
115
+ - lib/seafoam/passes.rb
116
+ - lib/seafoam/passes/fallback.rb
117
+ - lib/seafoam/passes/graal.rb
118
+ - lib/seafoam/passes/truffle.rb
134
119
  - lib/seafoam/spotlight.rb
135
120
  - lib/seafoam/version.rb
136
- - seafoam.gemspec
137
- - spec/seafoam/annotators/fallback_spec.rb
138
- - spec/seafoam/annotators/graal_spec.rb
139
- - spec/seafoam/annotators_spec.rb
140
- - spec/seafoam/bgv/bgv_parser_spec.rb
141
- - spec/seafoam/binary/io_binary_reader_spec.rb
142
- - spec/seafoam/cfg/cfg_parser_spec.rb
143
- - spec/seafoam/cfg/disassembler_spec.rb
144
- - spec/seafoam/command_spec.rb
145
- - spec/seafoam/graph_spec.rb
146
- - spec/seafoam/graphviz_writer_spec.rb
147
- - spec/seafoam/json_writer_spec.rb
148
- - spec/seafoam/spec_helpers.rb
149
- - spec/seafoam/spotlight_spec.rb
150
- - tools/render-all
151
121
  homepage: https://github.com/Shopify/seafoam
152
122
  licenses:
153
123
  - MIT
154
124
  metadata: {}
155
- post_install_message:
125
+ post_install_message:
156
126
  rdoc_options: []
157
127
  require_paths:
158
128
  - lib
@@ -160,15 +130,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
160
130
  requirements:
161
131
  - - ">="
162
132
  - !ruby/object:Gem::Version
163
- version: 2.5.8
133
+ version: 2.5.9
164
134
  required_rubygems_version: !ruby/object:Gem::Requirement
165
135
  requirements:
166
136
  - - ">="
167
137
  - !ruby/object:Gem::Version
168
138
  version: '0'
169
139
  requirements: []
170
- rubygems_version: 3.1.4
171
- signing_key:
140
+ rubyforge_project:
141
+ rubygems_version: 2.7.6.3
142
+ signing_key:
172
143
  specification_version: 4
173
144
  summary: A tool for working with compiler graphs
174
145
  test_files: []
data/.github/probots.yml DELETED
@@ -1,2 +0,0 @@
1
- enabled:
2
- - cla
@@ -1,39 +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: bundle install
10
- - run: bundle exec rubocop
11
- specs:
12
- strategy:
13
- matrix:
14
- os: [ubuntu, macos]
15
- ruby: [2.5, 2.6, 2.7]
16
- runs-on: ${{ matrix.os }}-latest
17
- steps:
18
- - uses: actions/checkout@v2
19
- - uses: ruby/setup-ruby@v1
20
- with:
21
- ruby-version: ${{ matrix.ruby }}
22
- bundler-cache: true
23
- - run: bundle install
24
- - run: if [[ $(uname) == "Darwin" ]]; then brew install graphviz capstone; else sudo apt-get install graphviz libcapstone3; fi
25
- - run: bundle exec rspec
26
- specs-no-dependencies:
27
- strategy:
28
- matrix:
29
- os: [ubuntu, macos]
30
- ruby: [2.5, 2.6, 2.7]
31
- runs-on: ${{ matrix.os }}-latest
32
- steps:
33
- - uses: actions/checkout@v2
34
- - uses: ruby/setup-ruby@v1
35
- with:
36
- ruby-version: ${{ matrix.ruby }}
37
- bundler-cache: true
38
- - run: bundle install
39
- - run: NO_DEPENDENCIES_INSTALLED=true bundle exec rspec
data/.gitignore DELETED
@@ -1,7 +0,0 @@
1
- *.pdf
2
- *.dot
3
- *.png
4
- *.svg
5
- *.class
6
- /.idea
7
- /Gemfile.lock
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.8
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/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.