furnace-xray 1.1.0.pre1 → 1.1.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/furnace-xray/app/assets/javascripts/application.js.coffee +9 -9
  3. data/lib/furnace-xray/app/assets/javascripts/lib/graph.js.coffee +6 -5
  4. data/lib/furnace-xray/app/assets/javascripts/lib/input.js.coffee +43 -104
  5. data/lib/furnace-xray/app/assets/javascripts/lib/input_state.js.coffee +6 -4
  6. data/lib/furnace-xray/app/assets/javascripts/lib/node.js.coffee +39 -0
  7. data/lib/furnace-xray/app/assets/javascripts/lib/nodes/argument.js.coffee +9 -2
  8. data/lib/furnace-xray/app/assets/javascripts/lib/nodes/basic_block.js.coffee +82 -0
  9. data/lib/furnace-xray/app/assets/javascripts/lib/nodes/constant.js.coffee +9 -0
  10. data/lib/furnace-xray/app/assets/javascripts/lib/nodes/function.js.coffee +20 -5
  11. data/lib/furnace-xray/app/assets/javascripts/lib/nodes/instruction.js.coffee +43 -23
  12. data/lib/furnace-xray/app/assets/javascripts/lib/nodes/module.js.coffee +8 -0
  13. data/lib/furnace-xray/app/assets/javascripts/lib/nodes/phi.js.coffee +10 -0
  14. data/lib/furnace-xray/app/assets/javascripts/lib/nodes/type.js.coffee +6 -9
  15. data/lib/furnace-xray/app/assets/javascripts/lib/nodes/type_bottom.js.coffee +3 -0
  16. data/lib/furnace-xray/app/assets/javascripts/lib/nodes/type_variable.js.coffee +1 -0
  17. data/lib/furnace-xray/app/views/nodes/{instruction_typed.jst.mustache → instruction.jst.mustache} +0 -0
  18. data/lib/furnace-xray/app/views/nodes/{operand_argument.jst.mustache → operands/argument.jst.mustache} +0 -0
  19. data/lib/furnace-xray/app/views/nodes/{operand_basic_block.jst.mustache → operands/basic_block.jst.mustache} +0 -0
  20. data/lib/furnace-xray/app/views/nodes/{operand_constant.jst.mustache → operands/constant.jst.mustache} +0 -0
  21. data/lib/furnace-xray/app/views/nodes/{operand_instruction.jst.mustache → operands/instruction.jst.mustache} +0 -0
  22. data/lib/furnace-xray/app/views/nodes/{type_constant.jst.mustache → type.jst.mustache} +0 -0
  23. data/lib/furnace-xray/version.rb +1 -1
  24. data/sample.json +8909 -1
  25. metadata +15 -13
  26. data/lib/furnace-xray/app/assets/javascripts/lib/map.js.coffee +0 -48
  27. data/lib/furnace-xray/app/assets/javascripts/lib/nodes/block.js.coffee +0 -76
  28. data/lib/furnace-xray/app/assets/javascripts/lib/nodes/operand.js.coffee +0 -21
  29. data/lib/furnace-xray/app/views/nodes/operand_constant_function.jst.mustache +0 -1
  30. data/lib/furnace-xray/app/views/nodes/type_parametric.jst.mustache +0 -3
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: furnace-xray
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.pre1
4
+ version: 1.1.0.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boris Staal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-24 00:00:00.000000000 Z
11
+ date: 2013-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -191,13 +191,17 @@ files:
191
191
  - lib/furnace-xray/app/assets/javascripts/lib/graph.js.coffee
192
192
  - lib/furnace-xray/app/assets/javascripts/lib/input.js.coffee
193
193
  - lib/furnace-xray/app/assets/javascripts/lib/input_state.js.coffee
194
- - lib/furnace-xray/app/assets/javascripts/lib/map.js.coffee
194
+ - lib/furnace-xray/app/assets/javascripts/lib/node.js.coffee
195
195
  - lib/furnace-xray/app/assets/javascripts/lib/nodes/argument.js.coffee
196
- - lib/furnace-xray/app/assets/javascripts/lib/nodes/block.js.coffee
196
+ - lib/furnace-xray/app/assets/javascripts/lib/nodes/basic_block.js.coffee
197
+ - lib/furnace-xray/app/assets/javascripts/lib/nodes/constant.js.coffee
197
198
  - lib/furnace-xray/app/assets/javascripts/lib/nodes/function.js.coffee
198
199
  - lib/furnace-xray/app/assets/javascripts/lib/nodes/instruction.js.coffee
199
- - lib/furnace-xray/app/assets/javascripts/lib/nodes/operand.js.coffee
200
+ - lib/furnace-xray/app/assets/javascripts/lib/nodes/module.js.coffee
201
+ - lib/furnace-xray/app/assets/javascripts/lib/nodes/phi.js.coffee
200
202
  - lib/furnace-xray/app/assets/javascripts/lib/nodes/type.js.coffee
203
+ - lib/furnace-xray/app/assets/javascripts/lib/nodes/type_bottom.js.coffee
204
+ - lib/furnace-xray/app/assets/javascripts/lib/nodes/type_variable.js.coffee
201
205
  - lib/furnace-xray/app/assets/javascripts/vendor/chosen.jquery.js
202
206
  - lib/furnace-xray/app/assets/javascripts/vendor/d3.v3.js
203
207
  - lib/furnace-xray/app/assets/javascripts/vendor/dagre.js
@@ -228,15 +232,13 @@ files:
228
232
  - lib/furnace-xray/app/views/nodes/diff/unchanged_line.jst.mustache
229
233
  - lib/furnace-xray/app/views/nodes/function.jst.mustache
230
234
  - lib/furnace-xray/app/views/nodes/function_removed.jst.mustache
231
- - lib/furnace-xray/app/views/nodes/instruction_typed.jst.mustache
235
+ - lib/furnace-xray/app/views/nodes/instruction.jst.mustache
232
236
  - lib/furnace-xray/app/views/nodes/instruction_void.jst.mustache
233
- - lib/furnace-xray/app/views/nodes/operand_argument.jst.mustache
234
- - lib/furnace-xray/app/views/nodes/operand_basic_block.jst.mustache
235
- - lib/furnace-xray/app/views/nodes/operand_constant.jst.mustache
236
- - lib/furnace-xray/app/views/nodes/operand_constant_function.jst.mustache
237
- - lib/furnace-xray/app/views/nodes/operand_instruction.jst.mustache
238
- - lib/furnace-xray/app/views/nodes/type_constant.jst.mustache
239
- - lib/furnace-xray/app/views/nodes/type_parametric.jst.mustache
237
+ - lib/furnace-xray/app/views/nodes/operands/argument.jst.mustache
238
+ - lib/furnace-xray/app/views/nodes/operands/basic_block.jst.mustache
239
+ - lib/furnace-xray/app/views/nodes/operands/constant.jst.mustache
240
+ - lib/furnace-xray/app/views/nodes/operands/instruction.jst.mustache
241
+ - lib/furnace-xray/app/views/nodes/type.jst.mustache
240
242
  - lib/furnace-xray/lib/jst_pages.rb
241
243
  - lib/furnace-xray/version.rb
242
244
  - sample.json
@@ -1,48 +0,0 @@
1
- #
2
- # Failsafe Map container
3
- #
4
- class @Map
5
- constructor: (@title) ->
6
- @data = []
7
- @map = Object.extended()
8
-
9
- each: (block) -> @map.each block
10
-
11
- add: (name, block) ->
12
- id = @map[name]
13
-
14
- unless id?
15
- @data.add name
16
- id = @data.length-1
17
- block(id) if block
18
- @map[name] = id
19
-
20
- id
21
-
22
- find: (name) ->
23
- id = @map[name]
24
-
25
- unless id?
26
- error = "Map '#{@title}': '#{name}' element not found"
27
- throw error
28
-
29
- id
30
-
31
- remove: (name, block) ->
32
- id = @find(name)
33
- @data.splice id, 1
34
- block(id) if block
35
- delete @map[name]
36
-
37
- rename: (name, newName, block) ->
38
- id = @find(name)
39
- @data[id] = newName
40
- block(id) if block
41
- delete @map[name]
42
- @map[newName] = id
43
-
44
- locate: (name, block) ->
45
- block(@find(name))
46
-
47
- locateOrAdd: (name, block) ->
48
- block(@add(name))
@@ -1,76 +0,0 @@
1
- class @BlockNode
2
- constructor: (@name, @instructions) ->
3
- @instructions ||= []
4
-
5
- title: (previousState) ->
6
- JST['nodes/block']
7
- name: @name
8
- instructions: @titleizeInstructions(previousState)
9
-
10
- titleizeInstructions: (previousState) ->
11
- unless previousState
12
- result = ""
13
- result += JST['nodes/diff/unchanged_line'] line: x.title() for x in @instructions
14
- result
15
- else
16
- result = ""
17
- removed = Object.extended()
18
- added = Object.extended()
19
- changed = Object.extended()
20
- unchanged = Object.extended()
21
-
22
- for cs, i in @instructions
23
- previous = previousState.find (ps) -> ps.name == cs.name
24
- currentTitle = cs.title()
25
-
26
- if previous && previous.title == currentTitle
27
- unchanged[i] = previous.title
28
- previous.newPosition = i
29
- else if previous
30
- changed[i] = [previous.title, currentTitle]
31
- previous.newPosition = i
32
- else
33
- added[i] = currentTitle
34
-
35
- for ps, i in previousState
36
- if !ps.newPosition?
37
- position = 0
38
-
39
- while --i >= 0
40
- if previousState[i].newPosition?
41
- position = previousState[i].newPosition+1
42
- break
43
-
44
- removed[position] ||= []
45
- removed[position].push ps.title
46
-
47
- [@instructions.length, previousState.length].max().times (i) ->
48
- if removed[i]
49
- result += JST['nodes/diff/removed_line'](line: l) for l in removed[i]
50
-
51
- result += JST['nodes/diff/added_line'](line: added[i]) if added[i]
52
- result += JST['nodes/diff/changed_line'](before: changed[i][0], after:changed[i][1]) if changed[i]
53
- result += JST['nodes/diff/unchanged_line'](line: unchanged[i]) if unchanged[i]
54
-
55
- result
56
-
57
- previous: ->
58
- try
59
- previous = @input.previous.blocks[@input.previous.blocksMap.find(@name)]
60
- catch error
61
- console.log error
62
-
63
- previous
64
-
65
- setName: (name) ->
66
- @name = name
67
-
68
- addInstruction: (instruction, index) ->
69
- @instructions.splice index, 0, instruction
70
-
71
- removeInstruction: (instruction) ->
72
- index = @instructions.findIndex(instruction)
73
- @instructions.splice index, 1 unless index < 0
74
-
75
- references: ->
76
- @instructions.last()?.operands.findAll((x) -> x.kind == "basic_block").map((x) -> x.name) || []
@@ -1,21 +0,0 @@
1
- class @OperandNode
2
-
3
- constructor: (@kind, @type, @name, @value) ->
4
-
5
- title: ->
6
- switch @kind
7
- when 'argument' then JST['nodes/operand_argument'] name: @name
8
- when 'instruction' then JST['nodes/operand_instruction'] name: @name
9
- when 'basic_block' then JST['nodes/operand_basic_block'] name: @name
10
- when 'constant'
11
- data =
12
- type: @type.title()
13
- value: @value
14
-
15
- if @type.name == 'function'
16
- template = 'operand_constant_function'
17
- data.parsedValue = JSON.parse(@value)
18
- else
19
- template = 'operand_constant'
20
-
21
- JST["nodes/#{template}"] data
@@ -1 +0,0 @@
1
- <a href="javascript:app.jumpTo('{{parsedValue}}')">{{{type}}} {{value}}</a>
@@ -1,3 +0,0 @@
1
- <i class='type'>
2
- {{type}}&lt;<i class='parameters'>{{{parameters}}}</i>&gt;
3
- </i>