seafoam 0.5 → 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/bgv/bgv_parser.rb +10 -2
  7. data/lib/seafoam/commands.rb +53 -32
  8. data/lib/seafoam/graal/pi.rb +18 -0
  9. data/lib/seafoam/graph.rb +33 -1
  10. data/lib/seafoam/graphviz_writer.rb +24 -2
  11. data/lib/seafoam/json_writer.rb +1 -3
  12. data/lib/seafoam/{annotators → passes}/fallback.rb +4 -4
  13. data/lib/seafoam/{annotators → passes}/graal.rb +43 -13
  14. data/lib/seafoam/passes/truffle.rb +58 -0
  15. data/lib/seafoam/passes.rb +61 -0
  16. data/lib/seafoam/version.rb +1 -1
  17. data/lib/seafoam.rb +5 -4
  18. metadata +32 -66
  19. data/.github/probots.yml +0 -2
  20. data/.github/workflows/workflows.yml +0 -39
  21. data/.gitignore +0 -7
  22. data/.rubocop.yml +0 -37
  23. data/.ruby-version +0 -1
  24. data/.seafoam/config +0 -1
  25. data/CODE_OF_CONDUCT.md +0 -128
  26. data/CONTRIBUTING.md +0 -5
  27. data/Gemfile +0 -2
  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 -293
  33. data/docs/getting-graphs.md +0 -59
  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 -21
  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 -157
  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 -316
  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
data/lib/seafoam.rb CHANGED
@@ -6,12 +6,13 @@ require 'seafoam/cfg/disassembler'
6
6
  require 'seafoam/colors'
7
7
  require 'seafoam/graph'
8
8
  require 'seafoam/graal/source'
9
- require 'seafoam/annotators'
10
- require 'seafoam/annotators/graal'
11
- require 'seafoam/annotators/fallback'
9
+ require 'seafoam/graal/pi'
10
+ require 'seafoam/passes'
11
+ require 'seafoam/passes/truffle'
12
+ require 'seafoam/passes/graal'
13
+ require 'seafoam/passes/fallback'
12
14
  require 'seafoam/spotlight'
13
15
  require 'seafoam/isabelle_writer'
14
16
  require 'seafoam/json_writer'
15
17
  require 'seafoam/graphviz_writer'
16
- require 'seafoam/config'
17
18
  require 'seafoam/commands'
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seafoam
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: '0.9'
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: 2021-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: crabstone
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: benchmark-ips
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -25,19 +39,19 @@ dependencies:
25
39
  - !ruby/object:Gem::Version
26
40
  version: '2.7'
27
41
  - !ruby/object:Gem::Dependency
28
- name: crabstone
42
+ name: rake
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: '4.0'
47
+ version: 13.0.6
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: '4.0'
54
+ version: 13.0.6
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rspec
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,92 +80,44 @@ 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
74
88
  - bgv2isabelle
89
+ - cfg2asm
75
90
  extensions: []
76
91
  extra_rdoc_files: []
77
92
  files:
78
- - ".github/probots.yml"
79
- - ".github/workflows/workflows.yml"
80
- - ".gitignore"
81
- - ".rubocop.yml"
82
- - ".ruby-version"
83
- - ".seafoam/config"
84
- - CODE_OF_CONDUCT.md
85
- - CONTRIBUTING.md
86
- - Gemfile
87
- - LICENSE.md
88
- - README.md
89
93
  - bin/bgv2isabelle
90
94
  - bin/bgv2json
91
95
  - bin/cfg2asm
92
96
  - bin/seafoam
93
- - demos/box-unbox-stats
94
- - docs/annotators.md
95
- - docs/bgv.md
96
- - docs/getting-graphs.md
97
- - docs/images/igv.png
98
- - docs/images/seafoam.png
99
- - docs/images/spotlight-igv.png
100
- - docs/images/spotlight-seafoam.png
101
- - docs/json.md
102
- - examples/Fib.java
103
- - examples/MatMult.java
104
- - examples/fib-java.bgv.gz
105
- - examples/fib.js
106
- - examples/fib.rb
107
- - examples/identity.rb
108
- - examples/java/Irreducible.class
109
- - examples/java/Irreducible.j
110
- - examples/java/IrreducibleDecompiled.java
111
- - examples/java/JavaExamples.java
112
- - examples/matmult.rb
113
- - examples/overflow.rb
114
- - examples/ruby/clamps.rb
115
- - examples/ruby/graal.patch
116
- - examples/ruby/ruby_examples.rb
117
97
  - lib/seafoam.rb
118
- - lib/seafoam/annotators.rb
119
- - lib/seafoam/annotators/fallback.rb
120
- - lib/seafoam/annotators/graal.rb
121
98
  - lib/seafoam/bgv/bgv_parser.rb
122
99
  - lib/seafoam/binary/io_binary_reader.rb
123
100
  - lib/seafoam/cfg/cfg_parser.rb
124
101
  - lib/seafoam/cfg/disassembler.rb
125
102
  - lib/seafoam/colors.rb
126
103
  - lib/seafoam/commands.rb
127
- - lib/seafoam/config.rb
104
+ - lib/seafoam/graal/pi.rb
128
105
  - lib/seafoam/graal/source.rb
129
106
  - lib/seafoam/graph.rb
130
107
  - lib/seafoam/graphviz_writer.rb
131
108
  - lib/seafoam/isabelle_writer.rb
132
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
133
114
  - lib/seafoam/spotlight.rb
134
115
  - lib/seafoam/version.rb
135
- - seafoam.gemspec
136
- - spec/seafoam/annotators/fallback_spec.rb
137
- - spec/seafoam/annotators/graal_spec.rb
138
- - spec/seafoam/annotators_spec.rb
139
- - spec/seafoam/bgv/bgv_parser_spec.rb
140
- - spec/seafoam/binary/io_binary_reader_spec.rb
141
- - spec/seafoam/cfg/cfg_parser_spec.rb
142
- - spec/seafoam/cfg/disassembler_spec.rb
143
- - spec/seafoam/command_spec.rb
144
- - spec/seafoam/graph_spec.rb
145
- - spec/seafoam/graphviz_writer_spec.rb
146
- - spec/seafoam/json_writer_spec.rb
147
- - spec/seafoam/spec_helpers.rb
148
- - spec/seafoam/spotlight_spec.rb
149
- - tools/render-all
150
116
  homepage: https://github.com/Shopify/seafoam
151
117
  licenses:
152
118
  - MIT
153
119
  metadata: {}
154
- post_install_message:
120
+ post_install_message:
155
121
  rdoc_options: []
156
122
  require_paths:
157
123
  - lib
@@ -159,15 +125,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
159
125
  requirements:
160
126
  - - ">="
161
127
  - !ruby/object:Gem::Version
162
- version: 2.5.8
128
+ version: 2.5.9
163
129
  required_rubygems_version: !ruby/object:Gem::Requirement
164
130
  requirements:
165
131
  - - ">="
166
132
  - !ruby/object:Gem::Version
167
133
  version: '0'
168
134
  requirements: []
169
- rubygems_version: 3.0.3
170
- signing_key:
135
+ rubygems_version: 3.2.22
136
+ signing_key:
171
137
  specification_version: 4
172
138
  summary: A tool for working with compiler graphs
173
139
  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.