diff --git a/lib/components_guide/wasm/examples/podcast_feed/podcast_feed.ex b/lib/components_guide/wasm/examples/podcast_feed/podcast_feed.ex index f54d2f3..bc0808b 100644 --- a/lib/components_guide/wasm/examples/podcast_feed/podcast_feed.ex +++ b/lib/components_guide/wasm/examples/podcast_feed/podcast_feed.ex @@ -44,6 +44,12 @@ defmodule ComponentsGuide.Wasm.PodcastFeed do # Global.import() # wasm_import(:datasource, populate_episode_at_index: Orb.DSL.funcp(name: :datasource_populate_episode, params: I32)) + defmodule StdOut do + use Orb.Import + + defw(flush(read_ptr: I32.UnsafePointer, byte_count: I32), nil) + end + defmodule Datasource do use Orb.Import @@ -53,6 +59,10 @@ defmodule ComponentsGuide.Wasm.PodcastFeed do defw(write_episode_id(episode_id: EpisodeID, write_ptr: I32.UnsafePointer), I32) defw(write_episode_title(episode_id: EpisodeID, write_ptr: I32.UnsafePointer), I32) # defw(write_episode_author(episode_id: EpisodeID, write_ptr: I32.UnsafePointer), I32) + # TODO: what happens if it wants to write more than the memory available? + # Yet another reason to have arenas for title, description, etc. + # Or have to use a proper malloc approach. + # Or have to flush before each write, and rewind bump_offset to beginning. defw(write_episode_description(episode_id: EpisodeID, write_ptr: I32.UnsafePointer), I32) defw(write_episode_link_url(episode_id: EpisodeID, write_ptr: I32.UnsafePointer), I32) defw(write_episode_mp3_url(episode_id: EpisodeID, write_ptr: I32.UnsafePointer), I32) @@ -72,6 +82,10 @@ defmodule ComponentsGuide.Wasm.PodcastFeed do importw(Datasource, :datasource) # SilverOrb.Arena.def(DatasourceArena, pages: 1) + # Used by url attribute in + SilverOrb.Arena.def(WriteBuffer, pages: 1) + # Attributes must have <&" escaped. + SilverOrb.Arena.def(EscapeXMLBuffer, pages: byte_size("&")) # There are a few ways to implement this: # 1. Pass every episode in as some sort of data structure. e.g. @@ -134,7 +148,7 @@ defmodule ComponentsGuide.Wasm.PodcastFeed do build! do ~S[\n] - XML.open(:rss, + XML.open_newline(:rss, version: "2.0", "xmlns:itunes": "http://www.itunes.com/dtds/podcast-1.0.dtd", "xmlns:googleplay": "http://www.google.com/schemas/play-podcasts/1.0", @@ -146,7 +160,7 @@ defmodule ComponentsGuide.Wasm.PodcastFeed do # This then causes the module to clear its local memory, resetting the bump # offset to the very beginning again. - XML.open(:channel) + XML.open_newline(:channel) XML.element(:title, @title) XML.element(:description, @description) diff --git a/lib/components_guide/wasm/examples/podcast_feed/xml_formatter.ex b/lib/components_guide/wasm/examples/podcast_feed/xml_formatter.ex index 6952e77..b447517 100644 --- a/lib/components_guide/wasm/examples/podcast_feed/xml_formatter.ex +++ b/lib/components_guide/wasm/examples/podcast_feed/xml_formatter.ex @@ -29,6 +29,13 @@ defmodule ComponentsGuide.Wasm.PodcastFeed.XMLFormatter do ]) end + def open_newline(tag, attributes \\ []) when is_atom(tag) do + Orb.InstructionSequence.new(:memory_effect, [ + open(tag, attributes), + append!(ascii: ?\n) + ]) + end + def close_newline(tag) when is_atom(tag) do xml_close_newline(Orb.DSL.const(Atom.to_string(tag))) end diff --git a/test/components_guide/wasm/examples/podcast_feed_test.exs b/test/components_guide/wasm/examples/podcast_feed_test.exs index 35db822..574323c 100644 --- a/test/components_guide/wasm/examples/podcast_feed_test.exs +++ b/test/components_guide/wasm/examples/podcast_feed_test.exs @@ -101,6 +101,9 @@ defmodule ComponentsGuide.Wasm.PodcastFeed.Test do assert "Episode 2" = xml_text_content(item2, "//itunes:title[1]") assert "Description for 1" = xml_text_content(item1, "//description[1]") assert "Description for 2" = xml_text_content(item2, "//description[1]") + + # + assert "Description for 2" = xml_xpath(item1, "//enclosure[1]") end defp xml_parse(xml) do @@ -131,7 +134,7 @@ defmodule ComponentsGuide.Wasm.PodcastFeed.Test do defp do_xml_text_content(_, acc), do: acc - @tag :skip + # @tag :skip test "output optimized wasm" do path_wasm = Path.join(__DIR__, "podcast_feed_xml.wasm") path_wat = Path.join(__DIR__, "podcast_feed_xml.wat") @@ -142,10 +145,10 @@ defmodule ComponentsGuide.Wasm.PodcastFeed.Test do System.cmd("wasm-opt", [path_wasm, "-o", path_opt_wasm, "-O"]) %{size: size} = File.stat!(path_wasm) - assert size == 2419 + assert size == 2418 %{size: size} = File.stat!(path_opt_wasm) - assert size == 1868 + assert size == 1909 {wat, 0} = System.cmd("wasm2wat", [path_wasm]) File.write!(path_wat, wat) diff --git a/test/components_guide/wasm/examples/podcast_feed_xml.wasm b/test/components_guide/wasm/examples/podcast_feed_xml.wasm index 618dd3f..1e90339 100644 Binary files a/test/components_guide/wasm/examples/podcast_feed_xml.wasm and b/test/components_guide/wasm/examples/podcast_feed_xml.wasm differ diff --git a/test/components_guide/wasm/examples/podcast_feed_xml.wat b/test/components_guide/wasm/examples/podcast_feed_xml.wat index 6166936..1ad1f29 100644 --- a/test/components_guide/wasm/examples/podcast_feed_xml.wat +++ b/test/components_guide/wasm/examples/podcast_feed_xml.wat @@ -1,28 +1,28 @@ (module (type (;0;) (func (result i32))) - (type (;1;) (func (param i32 i32) (result i32))) + (type (;1;) (func (param i32) (result i64))) (type (;2;) (func (param i32) (result i32))) - (type (;3;) (func (param i32 i32 i32))) - (type (;4;) (func)) - (type (;5;) (func (param i32))) + (type (;3;) (func (param i32 i32) (result i32))) + (type (;4;) (func (param i32 i32 i32))) + (type (;5;) (func)) + (type (;6;) (func (param i32))) (import "datasource" "get_episodes_count" (func (;0;) (type 0))) - (import "datasource" "write_episode_id" (func (;1;) (type 1))) - (import "datasource" "get_episode_pub_date_utc" (func (;2;) (type 2))) - (import "datasource" "get_episode_duration_seconds" (func (;3;) (type 2))) - (import "datasource" "write_episode_title" (func (;4;) (type 1))) - (import "datasource" "write_episode_author" (func (;5;) (type 1))) - (import "datasource" "write_episode_description" (func (;6;) (type 1))) - (import "datasource" "write_episode_link_url" (func (;7;) (type 1))) - (import "datasource" "write_episode_mp3_url" (func (;8;) (type 1))) - (import "datasource" "get_episode_mp3_byte_count" (func (;9;) (type 2))) - (import "datasource" "write_episode_content_html" (func (;10;) (type 1))) - (func (;11;) (type 2) (param i32) (result i32) + (import "datasource" "get_episode_pub_date_utc" (func (;1;) (type 1))) + (import "datasource" "get_episode_duration_seconds" (func (;2;) (type 2))) + (import "datasource" "write_episode_id" (func (;3;) (type 3))) + (import "datasource" "write_episode_title" (func (;4;) (type 3))) + (import "datasource" "write_episode_description" (func (;5;) (type 3))) + (import "datasource" "write_episode_link_url" (func (;6;) (type 3))) + (import "datasource" "write_episode_mp3_url" (func (;7;) (type 3))) + (import "datasource" "get_episode_mp3_byte_count" (func (;8;) (type 2))) + (import "datasource" "write_episode_content_html" (func (;9;) (type 3))) + (func (;10;) (type 2) (param i32) (result i32) global.get 0 global.get 0 local.get 0 i32.add global.set 0) - (func (;12;) (type 3) (param i32 i32 i32) + (func (;11;) (type 4) (param i32 i32 i32) (local i32) loop ;; label = @1 local.get 3 @@ -45,7 +45,7 @@ local.set 3 br 0 (;@1;) end) - (func (;13;) (type 3) (param i32 i32 i32) + (func (;12;) (type 4) (param i32 i32 i32) (local i32) loop ;; label = @1 local.get 3 @@ -65,7 +65,7 @@ local.set 3 br 0 (;@1;) end) - (func (;14;) (type 1) (param i32 i32) (result i32) + (func (;13;) (type 3) (param i32 i32) (result i32) (local i32 i32 i32) loop (result i32) ;; label = @1 local.get 0 @@ -98,7 +98,7 @@ i32.const 0 return end) - (func (;15;) (type 2) (param i32) (result i32) + (func (;14;) (type 2) (param i32) (result i32) (local i32) loop ;; label = @1 local.get 0 @@ -114,7 +114,7 @@ end end local.get 1) - (func (;16;) (type 2) (param i32) (result i32) + (func (;15;) (type 2) (param i32) (result i32) (local i32 i32) loop ;; label = @1 local.get 1 @@ -135,11 +135,11 @@ br_if 0 (;@1;) end local.get 1) - (func (;17;) (type 1) (param i32 i32) (result i32) + (func (;16;) (type 3) (param i32 i32) (result i32) (local i32 i32 i32) local.get 1 local.get 0 - call 16 + call 15 i32.add local.set 3 local.get 3 @@ -168,7 +168,7 @@ br_if 0 (;@1;) end local.get 3) - (func (;18;) (type 4) + (func (;17;) (type 5) global.get 2 i32.eqz if ;; label = @1 @@ -179,7 +179,7 @@ i32.const 1 i32.add global.set 2) - (func (;19;) (type 0) (result i32) + (func (;18;) (type 0) (result i32) global.get 2 i32.const 0 i32.gt_u @@ -204,7 +204,7 @@ global.set 0 end global.get 1) - (func (;20;) (type 5) (param i32) + (func (;19;) (type 6) (param i32) (local i32) local.get 0 global.get 1 @@ -213,60 +213,60 @@ return end local.get 0 - call 15 + call 14 local.set 1 global.get 0 local.get 0 local.get 1 - call 12 + call 11 global.get 0 local.get 1 i32.add global.set 0) - (func (;21;) (type 0) (result i32) + (func (;20;) (type 0) (result i32) global.get 0 global.get 1 i32.gt_u) - (func (;22;) (type 2) (param i32) (result i32) - call 18 - i32.const 298 - call 20 + (func (;21;) (type 2) (param i32) (result i32) + call 17 + i32.const 270 + call 19 local.get 0 - call 20 - i32.const 308 - call 20 - call 19) - (func (;23;) (type 2) (param i32) (result i32) - call 18 - i32.const 760 - call 20 + call 19 + i32.const 307 + call 19 + call 18) + (func (;22;) (type 2) (param i32) (result i32) + call 17 + i32.const 759 + call 19 local.get 0 - call 20 - i32.const 763 - call 20 - call 19) - (func (;24;) (type 1) (param i32 i32) (result i32) - call 18 - i32.const 766 - call 20 + call 19 + i32.const 762 + call 19 + call 18) + (func (;23;) (type 3) (param i32 i32) (result i32) + call 17 + i32.const 765 + call 19 local.get 0 - call 20 - i32.const 768 - call 20 + call 19 + i32.const 767 + call 19 local.get 1 - call 22 - drop - i32.const 760 - call 20 + call 21 + call 19 + i32.const 759 + call 19 local.get 0 - call 20 - i32.const 770 - call 20 - call 19) - (func (;25;) (type 4) + call 19 + i32.const 769 + call 19 + call 18) + (func (;24;) (type 5) i32.const 65536 global.set 0) - (func (;26;) (type 4) + (func (;25;) (type 5) (local i32 i32) call 0 local.set 0 @@ -276,9 +276,9 @@ return end loop ;; label = @1 - call 18 - i32.const 265 - call 20 + call 17 + i32.const 264 + call 19 global.get 0 i32.const 62 i32.store8 @@ -286,12 +286,12 @@ i32.const 1 i32.add global.set 0 - i32.const 271 - call 20 - i32.const 277 - call 20 - i32.const 292 - call 20 + i32.const 280 + call 19 + i32.const 286 + call 19 + i32.const 301 + call 19 global.get 0 i32.const 34 i32.store8 @@ -306,21 +306,21 @@ i32.const 1 i32.add global.set 0 - i32.const 298 - call 20 + i32.const 270 + call 19 global.get 0 local.get 1 global.get 0 - call 1 + call 3 i32.add global.set 0 - i32.const 308 - call 20 - i32.const 312 - call 23 + i32.const 307 + call 19 + i32.const 311 + call 22 drop - i32.const 317 - call 20 + i32.const 316 + call 19 global.get 0 i32.const 62 i32.store8 @@ -328,21 +328,21 @@ i32.const 1 i32.add global.set 0 - i32.const 298 - call 20 + i32.const 270 + call 19 global.get 0 local.get 1 global.get 0 call 4 i32.add global.set 0 - i32.const 308 - call 20 - i32.const 324 - call 23 + i32.const 307 + call 19 + i32.const 323 + call 22 drop - i32.const 330 - call 20 + i32.const 329 + call 19 global.get 0 i32.const 62 i32.store8 @@ -350,21 +350,21 @@ i32.const 1 i32.add global.set 0 - i32.const 298 - call 20 + i32.const 270 + call 19 global.get 0 local.get 1 global.get 0 call 4 i32.add global.set 0 - i32.const 308 - call 20 - i32.const 344 - call 23 + i32.const 307 + call 19 + i32.const 343 + call 22 drop - i32.const 357 - call 20 + i32.const 356 + call 19 global.get 0 i32.const 62 i32.store8 @@ -372,21 +372,21 @@ i32.const 1 i32.add global.set 0 - i32.const 298 - call 20 + i32.const 270 + call 19 global.get 0 local.get 1 global.get 0 - call 6 + call 5 i32.add global.set 0 - i32.const 308 - call 20 - i32.const 370 - call 23 + i32.const 307 + call 19 + i32.const 369 + call 22 drop - i32.const 382 - call 20 + i32.const 381 + call 19 global.get 0 i32.const 62 i32.store8 @@ -394,23 +394,23 @@ i32.const 1 i32.add global.set 0 - i32.const 298 - call 20 + i32.const 270 + call 19 global.get 0 local.get 1 global.get 0 - call 6 + call 5 i32.add global.set 0 - i32.const 308 - call 20 - i32.const 399 - call 23 + i32.const 307 + call 19 + i32.const 398 + call 22 drop - i32.const 415 - call 23 + i32.const 414 + call 22 drop - call 19 + call 18 drop local.get 1 i32.const 1 @@ -421,16 +421,16 @@ i32.lt_s br_if 0 (;@1;) end) - (func (;27;) (type 0) (result i32) - call 18 - i32.const 420 - call 20 - i32.const 461 - call 20 - i32.const 466 - call 20 - i32.const 477 - call 20 + (func (;26;) (type 0) (result i32) + call 17 + i32.const 419 + call 19 + i32.const 460 + call 19 + i32.const 465 + call 19 + i32.const 476 + call 19 global.get 0 i32.const 34 i32.store8 @@ -438,10 +438,10 @@ i32.const 1 i32.add global.set 0 - i32.const 481 - call 20 - i32.const 497 - call 20 + i32.const 480 + call 19 + i32.const 496 + call 19 global.get 0 i32.const 34 i32.store8 @@ -449,10 +449,10 @@ i32.const 1 i32.add global.set 0 - i32.const 540 - call 20 - i32.const 560 - call 20 + i32.const 539 + call 19 + i32.const 559 + call 19 global.get 0 i32.const 34 i32.store8 @@ -460,10 +460,10 @@ i32.const 1 i32.add global.set 0 - i32.const 608 - call 20 - i32.const 620 - call 20 + i32.const 607 + call 19 + i32.const 619 + call 19 global.get 0 i32.const 34 i32.store8 @@ -471,10 +471,10 @@ i32.const 1 i32.add global.set 0 - i32.const 653 - call 20 - i32.const 670 - call 20 + i32.const 652 + call 19 + i32.const 669 + call 19 global.get 0 i32.const 34 i32.store8 @@ -489,8 +489,15 @@ i32.const 1 i32.add global.set 0 - i32.const 711 - call 20 + global.get 0 + i32.const 10 + i32.store8 + global.get 0 + i32.const 1 + i32.add + global.set 0 + i32.const 710 + call 19 global.get 0 i32.const 62 i32.store8 @@ -498,47 +505,54 @@ i32.const 1 i32.add global.set 0 - i32.const 324 + global.get 0 + i32.const 10 + i32.store8 + global.get 0 + i32.const 1 + i32.add + global.set 0 + i32.const 323 global.get 3 - call 24 - drop - i32.const 370 + call 23 + call 19 + i32.const 369 global.get 4 - call 24 - drop - i32.const 399 + call 23 + call 19 + i32.const 398 global.get 4 - call 24 - drop - i32.const 720 + call 23 + call 19 + i32.const 719 global.get 5 - call 24 - drop - i32.const 734 + call 23 + call 19 + i32.const 733 global.get 6 - call 24 - drop - i32.const 739 - global.get 7 - call 24 - drop - call 26 - i32.const 748 call 23 - drop - i32.const 756 + call 19 + i32.const 738 + global.get 7 call 23 - drop - call 19) + call 19 + call 25 + i32.const 747 + call 22 + call 19 + i32.const 755 + call 22 + call 19 + call 18) (memory (;0;) 2) (global (;0;) (mut i32) (i32.const 65536)) (global (;1;) (mut i32) (i32.const 0)) (global (;2;) (mut i32) (i32.const 0)) (global (;3;) (mut i32) (i32.const 255)) - (global (;4;) (mut i32) (i32.const 261)) - (global (;5;) (mut i32) (i32.const 261)) - (global (;6;) (mut i32) (i32.const 261)) - (global (;7;) (mut i32) (i32.const 262)) + (global (;4;) (mut i32) (i32.const 0)) + (global (;5;) (mut i32) (i32.const 0)) + (global (;6;) (mut i32) (i32.const 0)) + (global (;7;) (mut i32) (i32.const 261)) (global (;8;) (mut i32) (i32.const 0)) (global (;9;) (mut i32) (i32.const 0)) (global (;10;) (mut i32) (i32.const 0)) @@ -551,49 +565,48 @@ (export "author" (global 5)) (export "link" (global 6)) (export "language" (global 7)) - (export "free_all" (func 25)) - (export "alloc" (func 11)) - (export "write_episodes_xml" (func 26)) - (export "text_xml" (func 27)) - (data (;0;) (i32.const 720) "itunes:author") - (data (;1;) (i32.const 466) " version=\22") - (data (;2;) (i32.const 357) "\0a") - (data (;12;) (i32.const 748) "channel") - (data (;13;) (i32.const 292) "false") - (data (;14;) (i32.const 415) "item") - (data (;15;) (i32.const 560) "http://www.google.com/schemas/play-podcasts/1.0") - (data (;16;) (i32.const 324) "title") - (data (;17;) (i32.const 317) "") - (data (;19;) (i32.const 330) "\0a") - (data (;37;) (i32.const 271) "\0a") - (data (;41;) (i32.const 308) "]]>")) + (export "free_all" (func 24)) + (export "alloc" (func 10)) + (export "write_episodes_xml" (func 25)) + (export "text_xml" (func 26)) + (data (;0;) (i32.const 719) "itunes:author") + (data (;1;) (i32.const 465) " version=\22") + (data (;2;) (i32.const 356) "\0a") + (data (;11;) (i32.const 747) "channel") + (data (;12;) (i32.const 301) "false") + (data (;13;) (i32.const 414) "item") + (data (;14;) (i32.const 559) "http://www.google.com/schemas/play-podcasts/1.0") + (data (;15;) (i32.const 323) "title") + (data (;16;) (i32.const 316) "") + (data (;18;) (i32.const 329) "\0a") + (data (;36;) (i32.const 280) "\0a") + (data (;40;) (i32.const 307) "]]>")) diff --git a/test/components_guide/wasm/examples/podcast_feed_xml_OPT.wasm b/test/components_guide/wasm/examples/podcast_feed_xml_OPT.wasm index 0add004..a7770a2 100644 Binary files a/test/components_guide/wasm/examples/podcast_feed_xml_OPT.wasm and b/test/components_guide/wasm/examples/podcast_feed_xml_OPT.wasm differ diff --git a/test/components_guide/wasm/examples/podcast_feed_xml_OPT.wat b/test/components_guide/wasm/examples/podcast_feed_xml_OPT.wat index a95ca1a..f440ae3 100644 --- a/test/components_guide/wasm/examples/podcast_feed_xml_OPT.wat +++ b/test/components_guide/wasm/examples/podcast_feed_xml_OPT.wat @@ -1,15 +1,14 @@ (module - (type (;0;) (func (result i32))) - (type (;1;) (func (param i32 i32) (result i32))) + (type (;0;) (func (param i32 i32) (result i32))) + (type (;1;) (func (result i32))) (type (;2;) (func)) - (type (;3;) (func (param i32))) - (type (;4;) (func (param i32) (result i32))) - (type (;5;) (func (param i32 i32))) - (import "datasource" "get_episodes_count" (func (;0;) (type 0))) - (import "datasource" "write_episode_id" (func (;1;) (type 1))) - (import "datasource" "write_episode_title" (func (;2;) (type 1))) - (import "datasource" "write_episode_description" (func (;3;) (type 1))) - (func (;4;) (type 4) (param i32) (result i32) + (type (;3;) (func (param i32) (result i32))) + (type (;4;) (func (param i32))) + (import "datasource" "get_episodes_count" (func (;0;) (type 1))) + (import "datasource" "write_episode_id" (func (;1;) (type 0))) + (import "datasource" "write_episode_title" (func (;2;) (type 0))) + (import "datasource" "write_episode_description" (func (;3;) (type 0))) + (func (;4;) (type 3) (param i32) (result i32) (local i32) global.get 0 global.get 0 @@ -27,7 +26,7 @@ i32.const 1 i32.add global.set 2) - (func (;6;) (type 0) (result i32) + (func (;6;) (type 1) (result i32) global.get 2 i32.eqz if ;; label = @1 @@ -49,7 +48,7 @@ global.set 0 end global.get 1) - (func (;7;) (type 3) (param i32) + (func (;7;) (type 4) (param i32) (local i32 i32 i32) local.get 0 global.get 1 @@ -100,41 +99,39 @@ local.get 2 i32.add global.set 0) - (func (;8;) (type 3) (param i32) + (func (;8;) (type 3) (param i32) (result i32) call 5 - i32.const 760 + i32.const 759 call 7 local.get 0 call 7 - i32.const 763 + i32.const 762 call 7 - call 6 - drop) - (func (;9;) (type 5) (param i32 i32) + call 6) + (func (;9;) (type 0) (param i32 i32) (result i32) call 5 - i32.const 766 + i32.const 765 call 7 local.get 0 call 7 - i32.const 768 + i32.const 767 call 7 call 5 - i32.const 298 + i32.const 270 call 7 local.get 1 call 7 - i32.const 308 + i32.const 307 call 7 call 6 - drop - i32.const 760 + call 7 + i32.const 759 call 7 local.get 0 call 7 - i32.const 770 + i32.const 769 call 7 - call 6 - drop) + call 6) (func (;10;) (type 2) i32.const 65536 global.set 0) @@ -148,7 +145,7 @@ end loop ;; label = @1 call 5 - i32.const 265 + i32.const 264 call 7 global.get 0 i32.const 62 @@ -157,11 +154,11 @@ i32.const 1 i32.add global.set 0 - i32.const 271 + i32.const 280 call 7 - i32.const 277 + i32.const 286 call 7 - i32.const 292 + i32.const 301 call 7 global.get 0 i32.const 34 @@ -177,7 +174,7 @@ i32.const 1 i32.add global.set 0 - i32.const 298 + i32.const 270 call 7 global.get 0 local.get 0 @@ -185,11 +182,12 @@ call 1 i32.add global.set 0 - i32.const 308 + i32.const 307 call 7 - i32.const 312 + i32.const 311 call 8 - i32.const 317 + drop + i32.const 316 call 7 global.get 0 i32.const 62 @@ -198,7 +196,7 @@ i32.const 1 i32.add global.set 0 - i32.const 298 + i32.const 270 call 7 global.get 0 local.get 0 @@ -206,11 +204,12 @@ call 2 i32.add global.set 0 - i32.const 308 + i32.const 307 call 7 - i32.const 324 + i32.const 323 call 8 - i32.const 330 + drop + i32.const 329 call 7 global.get 0 i32.const 62 @@ -219,7 +218,7 @@ i32.const 1 i32.add global.set 0 - i32.const 298 + i32.const 270 call 7 global.get 0 local.get 0 @@ -227,11 +226,12 @@ call 2 i32.add global.set 0 - i32.const 308 + i32.const 307 call 7 - i32.const 344 + i32.const 343 call 8 - i32.const 357 + drop + i32.const 356 call 7 global.get 0 i32.const 62 @@ -240,7 +240,7 @@ i32.const 1 i32.add global.set 0 - i32.const 298 + i32.const 270 call 7 global.get 0 local.get 0 @@ -248,11 +248,12 @@ call 3 i32.add global.set 0 - i32.const 308 + i32.const 307 call 7 - i32.const 370 + i32.const 369 call 8 - i32.const 382 + drop + i32.const 381 call 7 global.get 0 i32.const 62 @@ -261,7 +262,7 @@ i32.const 1 i32.add global.set 0 - i32.const 298 + i32.const 270 call 7 global.get 0 local.get 0 @@ -269,12 +270,14 @@ call 3 i32.add global.set 0 - i32.const 308 + i32.const 307 call 7 - i32.const 399 + i32.const 398 call 8 - i32.const 415 + drop + i32.const 414 call 8 + drop call 6 drop local.get 0 @@ -285,15 +288,15 @@ i32.lt_s br_if 0 (;@1;) end) - (func (;12;) (type 0) (result i32) + (func (;12;) (type 1) (result i32) call 5 - i32.const 420 + i32.const 419 call 7 - i32.const 461 + i32.const 460 call 7 - i32.const 466 + i32.const 465 call 7 - i32.const 477 + i32.const 476 call 7 global.get 0 i32.const 34 @@ -302,9 +305,9 @@ i32.const 1 i32.add global.set 0 - i32.const 481 + i32.const 480 call 7 - i32.const 497 + i32.const 496 call 7 global.get 0 i32.const 34 @@ -313,9 +316,9 @@ i32.const 1 i32.add global.set 0 - i32.const 540 + i32.const 539 call 7 - i32.const 560 + i32.const 559 call 7 global.get 0 i32.const 34 @@ -324,9 +327,9 @@ i32.const 1 i32.add global.set 0 - i32.const 608 + i32.const 607 call 7 - i32.const 620 + i32.const 619 call 7 global.get 0 i32.const 34 @@ -335,9 +338,9 @@ i32.const 1 i32.add global.set 0 - i32.const 653 + i32.const 652 call 7 - i32.const 670 + i32.const 669 call 7 global.get 0 i32.const 34 @@ -353,7 +356,14 @@ i32.const 1 i32.add global.set 0 - i32.const 711 + global.get 0 + i32.const 10 + i32.store8 + global.get 0 + i32.const 1 + i32.add + global.set 0 + i32.const 710 call 7 global.get 0 i32.const 62 @@ -362,39 +372,54 @@ i32.const 1 i32.add global.set 0 - i32.const 324 + global.get 0 + i32.const 10 + i32.store8 + global.get 0 + i32.const 1 + i32.add + global.set 0 + i32.const 323 global.get 3 call 9 - i32.const 370 + call 7 + i32.const 369 global.get 4 call 9 - i32.const 399 + call 7 + i32.const 398 global.get 4 call 9 - i32.const 720 + call 7 + i32.const 719 global.get 5 call 9 - i32.const 734 + call 7 + i32.const 733 global.get 6 call 9 - i32.const 739 + call 7 + i32.const 738 global.get 7 call 9 + call 7 call 11 - i32.const 748 + i32.const 747 call 8 - i32.const 756 + call 7 + i32.const 755 call 8 + call 7 call 6) (memory (;0;) 2) (global (;0;) (mut i32) (i32.const 65536)) (global (;1;) (mut i32) (i32.const 0)) (global (;2;) (mut i32) (i32.const 0)) (global (;3;) (mut i32) (i32.const 255)) - (global (;4;) (mut i32) (i32.const 261)) - (global (;5;) (mut i32) (i32.const 261)) - (global (;6;) (mut i32) (i32.const 261)) - (global (;7;) (mut i32) (i32.const 262)) + (global (;4;) (mut i32) (i32.const 0)) + (global (;5;) (mut i32) (i32.const 0)) + (global (;6;) (mut i32) (i32.const 0)) + (global (;7;) (mut i32) (i32.const 261)) (export "memory" (memory 0)) (export "title" (global 3)) (export "description" (global 4)) @@ -405,44 +430,44 @@ (export "alloc" (func 4)) (export "write_episodes_xml" (func 11)) (export "text_xml" (func 12)) - (data (;0;) (i32.const 720) "itunes:author") - (data (;1;) (i32.const 466) " version=\22") - (data (;2;) (i32.const 357) "\0a") - (data (;11;) (i32.const 748) "channel") - (data (;12;) (i32.const 292) "false") - (data (;13;) (i32.const 415) "item") - (data (;14;) (i32.const 560) "http://www.google.com/schemas/play-podcasts/1.0") - (data (;15;) (i32.const 324) "title") - (data (;16;) (i32.const 317) "") - (data (;18;) (i32.const 330) "\0a") - (data (;36;) (i32.const 271) "\0a") - (data (;40;) (i32.const 308) "]]>")) + (data (;10;) (i32.const 769) ">\0a") + (data (;11;) (i32.const 747) "channel") + (data (;12;) (i32.const 301) "false") + (data (;13;) (i32.const 414) "item") + (data (;14;) (i32.const 559) "http://www.google.com/schemas/play-podcasts/1.0") + (data (;15;) (i32.const 323) "title") + (data (;16;) (i32.const 316) "") + (data (;18;) (i32.const 329) "\0a") + (data (;36;) (i32.const 280) "\0a") + (data (;40;) (i32.const 307) "]]>"))