20110424 action scriptを使わないflash勉強会

1,602 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,602
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • 20110424 action scriptを使わないflash勉強会

    1. 1. 2011/04/23 ActionScript Flash #1ActionScriptVM2 mzp / 1
    2. 2. mzp / SE> ocaml-nagoya> ProofCafe> Scala 2
    3. 3. )Rails 3 + HTML5http://codefirst.github.com/AsakusaSatellite/ 3
    4. 4. 2/26 Reject PHP swf ! OCaml swf Twitter swf ! !! 4
    5. 5. 2/26 Reject PHP swf ! OCaml swf Twitter swf ! !! 4
    6. 6. !ActionScript Flash !!
    7. 7. ActionScript
    8. 8. ActionScript !!
    9. 9. As1,2 As3 v.s. → VM → !> As1,As2 → AVM1 Flash> As3 → AVM2 AVM2 7
    10. 10. AVM2AVM1> JIT !AS3> E4XFlash9 AVM2 8
    11. 11. HappyABCFlash9 Scheme( )As3 →OCaml>> 9
    12. 12. HelloWorld
    13. 13. Hello, World!As3> swf> swftrace("hello"); 11
    14. 14. Flex SDK[1] asc.jar > hello.abc > abc = Actionscript Byte Code $ java -jar asc.jar hello.as hello.abc, 79 bytes written[1]http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK 12
    15. 15. Tamarin[2] Flash Player AVM2 > Adobe Mozilla > Firefox $ shell hello.abc hello[2]http://www.mozilla.org/projects/tamarin/ 13
    16. 16. tamarin abcdump[3] $ shell abcdump.abc -- hello.abc // magic 2e0010 // Cpool numbers size 3 3 % // Cpool strings count 5 size 25 31 % // Cpool namespaces count 3 size 5 6 % // Cpool nssets count 2 size 4 5 % ( )[3]http://d.hatena.ne.jp/nitoyon/20090123/abcdump_build 14
    17. 17. function script0$init():*{ // local_count=2 max_scope=1 max_stack=2code_len=15 0 getlocal0 1 pushscope 2 findpropstrict trace 4 pushstring "hello" 6 callproperty trace (1) 9 coerce_a 10 setlocal1 11 getlocal1 12 returnvalue 13 kill 1} 15
    18. 18. AVM2 push/pop 16
    19. 19. )1+2> pushbyte 1 pushbyte 2 ( ) add 17
    20. 20. )1+2> pushbyte 1: 1 pushbyte 1> pushbyte 2 add 18
    21. 21. )1+2> pushbyte 1: 1> pushbyte 2: 2 pushbyte 1 pushbyte 2> add 19
    22. 22. )1+2> pushbyte 1: 1> pushbyte 2: 2 pushbyte 1 pushbyte 2 add> 20
    23. 23. +αAVM2 2 21
    24. 24. ( )function script0$init():*{ // local_count=2 max_scope=1 max_stack=2code_len=15 0 getlocal0 1 pushscope 2 findpropstrict trace 4 pushstring "hello" 6 callproperty trace (1) 9 coerce_a 10 setlocal1 11 getlocal1 12 returnvalue 13 kill 1} 22
    25. 25. thisgetlocal0 // 0 pushpushscope // AVM2 >0 this >1 this ” ” push 23
    26. 26. ) this this 0 = this//addEventListener(MouseEvent.CLICK, function(e){ // this}); 24
    27. 27. ( )function script0$init():*{ // local_count=2 max_scope=1 max_stack=2code_len=15 0 getlocal0 1 pushscope 2 findpropstrict trace 4 pushstring "hello" 6 callproperty trace (1) 9 coerce_a 10 setlocal1 11 getlocal1 12 returnvalue 13 kill 1} 25
    28. 28. trace// tracefindpropstrict trace// pushpushstring "hello"// trace pushcallproperty trace (1) 26
    29. 29. tracefindpropstrict tracepushstring “hello”callproperty trace(1) 27
    30. 30. trace findpropstrict trace AVM2> findpropstrict trace pushstring “hello” callproperty trace(1) 28
    31. 31. trace findpropstrict trace AVM2> findpropstrict trace pushstring “hello” callproperty trace(1) 28
    32. 32. trace pushstring findpropstrict trace> pushstring “hello” callproperty trace(1) 29
    33. 33. trace pushstring findpropstrict trace> pushstring “hello” callproperty trace(1) 29
    34. 34. trace callpropery trace <obj>.trace(“hello”) findpropstrict trace pushstring “hello”> callproperty trace(1) 30
    35. 35. trace callpropery trace <obj>.trace(“hello”) findpropstrict trace pushstring “hello”> callproperty trace(1) 30
    36. 36. ( )function script0$init():*{ // local_count=2 max_scope=1 max_stack=2code_len=15 0 getlocal0 1 pushscope 2 findpropstrict trace 4 pushstring "hello" 6 callproperty trace (1) 9 coerce_a 10 setlocal1 11 getlocal1 12 returnvalue 13 kill 1} 31
    37. 37. return// *(any)coerce_a// 1setlocal1// 1 pushgetlocal1//returnvalue// 1kill 1 32
    38. 38. ?//pop//returnvoid 33
    39. 39. ABC s24 : 24 signed int u8, u16: n unsigned int u30, u32,s32 : (un)signed int > 5 > 1 d64 : (double) swf (u30 ) 35
    40. 40. getlocal_0 ABCopcode u8 36
    41. 41. function script0$init():*{ // local_count=2 max_scope=1 max_stack=2code_len=15 0 getlocal0 1 pushscope 2 findpropstrict trace 4 pushstring "hello" 6 callproperty trace (1) 9 coerce_a 10 setlocal1 11 getlocal1 12 returnvalue 13 kill 1} opcode 37
    42. 42. kill 1 1> opcode 0x08> u30u30 7 u8kill 1 => 0x08 0x01 38
    43. 43. function script0$init():*{ // local_count=2 max_scope=1 max_stack=2code_len=15 0 getlocal0 1 pushscope 2 findpropstrict trace 4 pushstring "hello" 6 callproperty trace (1) 9 coerce_a 10 setlocal1 11 getlocal1 12 returnvalue 13 kill 1} kill 39
    44. 44. pushstring> opcode 0x2c> u3030 !> 40
    45. 45. (constant pool; cpool)int 1, 42, ... pushstring “hello”string “foo”, “hello”, ...... ... 0x2c 0x02 41
    46. 46. ABC> int, uint, string, double> + (public ) => As ?> +> 42
    47. 47. function script0$init():*{ // local_count=2 max_scope=1 max_stack=2code_len=15 0 getlocal0 1 pushscope 2 findpropstrict trace 4 pushstring "hello" 6 callproperty trace (1) 9 coerce_a 10 setlocal1 11 getlocal1 12 returnvalue 13 kill 1} 43
    48. 48. AS1,2 AS3 VM →AVM2ABC TamarinAVM2> As3 1 1> GC swf 44
    49. 49. AVM2 Overview( )> http://www.adobe.com/content/dam/Adobe/en/devnet/actionscript/articles/ avm2overview.pdfswfmill(trunk)> http://swfmill.org> svn trunk ABCtamarin> verbose 45

    ×