千呼萬喚始出來的     Java SE 7●   林信良●   caterpillar@openhome.cc●   http://openhome.cc
議程•   Java 進化史•   JSR334 / Coin 專案•   Unicode 6.0.0、JDBC 4.1•   JSR203 / NIO.2•   JSR166y / Concurrency Updates•   JSR292 ...
Java 進化史    2002/02/13
Java 進化史    2004/09/29
Java 進化史    ?    2006/12/11
Java 進化史    2011/07/28    ?
A / B 計畫• JDK 7 Features updated ! Plan B has  apparently been approved  – http://www.baptiste-wicht.com/2010/09/jdk-7-   ...
JDK7 ...  λ                  JigsawLanguage support for collections           Annotations on Java types
JDK7 有...• JDK 7 Features  – http://openjdk.java.net/projects/jdk7/features/                            Concurrency       ...
JSR334 / Coin 專案
Small language enhancements• Strings in switch• Binary integral literals and underscores in  numeric literals• Multi-catch...
Strings in if-else
Strings in switch
反組譯...   先用 hashCode()再用 equals()
Binary integral literals andunderscores in numeric literals • Binary literal • With underscores for clarity
Multi-catch略...                  都作一樣的事           略...
Multi-catch• It is a compile-time error if a disjunctive  type contains two alternatives Di, Dj where  Di is a subtype of ...
Multi-catch• An exception parameter whose type is a  disjunctive type is implicitly considered to  be final.  try { /* thr...
More precise rethrow• JDK6...      ...         沒有宣告 Exception            ... // 作一些事
More precise rethrow• JDK7...      ...            ...
Inferring Types with <>• 沒有 Generics 前• 有了 Generics 後• 有了 Inferring Types 後
Inferring Types with <>• 僅使用 <> 表示推斷類型• 不過別什麼都交給編譯器判斷....
Inferring Types with <>• 如果...• 推斷出來是 Integer 或 Number?
Inferring Types with <>• 這有什麼問題?
Try-with-resources• 讓這段程式碼更耐用一些...
Try-with-resources• 讓這段程式碼更簡潔一些...
Try-with-resources• 讓這段程式碼更簡潔一些...
Try-with-resourcestry ResourceSpecification  Block⇒{  final VariableModifiers_minus_final R #resource = Expression;  Throw...
Try-with-resources• 如果要處理例外...
Try-with-resources• 如果要處理例外...               try-with-resources
Try-with-resources• API 支援 – java.lang.AutoClosable – java.io.Closeable 繼承 AutoCloseable
Try-with-resources• API 支援  –   java.beans.XMLDecoder  –   java.beans.XMLEncoder  –   java.io.Closeable  –   java.io.Objec...
Try-with-resources• a 與 b 關閉的順序?
Heap pollution• JDK6....          要求編譯器檢查傳入引數是不是都是 T 型態• OK...
Heap pollution • 希望編譯器檢查都是 List<String>.........: warning: [unchecked] unchecked generic array creation of type java.util....
Heap pollution• 執行時期無法具體確認(reified)引數或變  數型態 – http://en.wikipedia.org/wiki/Heap_pollution• Java 的 Generics 是編譯時期檢查• Gener...
Simplified Varargs Method               Invocation    • JDK7... 提醒設計 doSome() 保證不會發生 Heap Pollution....: warning: [uncheck...
Simplified Varargs Method          Invocation• @SuppressWarnings(“unchecked”)?   – 連同其它的警訊也抑制了...   – 對 API 使用者也是有警訊...• @...
Simplified Varargs Method         Invocation• JDK7...
Unicode 6.0.0• 2010-10-11 正式發佈       繪文字(emoji)
Unicode 6.0.0• 2010-10-11 正式發佈       繪文字(emoji)
Unicode 6.0.0• Java SE 7  – Unicode 5.1.0  Unicode 6.0.0• Java Tutorial  – http://download.oracle.com/javase/tutorial/i18...
JDBC 4.1• 繼承 AutoCloseable – Connection – ResultSet – Statement
JDBC 4.1
JDBC 4.1
JDBC 4.1• RowSetProviderjava -Djavax.sql.rowset.RowSetFactory=com.sun.rowset.RowSetFactoryImpl• RowSetFactory
JSR203 / NIO.2
NIO2                    NIO• File System API• Channels API  – Updates to socket channel API  – Asynchronous I/O• java.nio ...
File System API• java.io.File 怎麼了? – Not initially written to be extended – Many of the methods without exceptions – Metho...
File System API• 新套件  – java.nio.file  – java.nio.file.attribute• Java Tutorials: File I/O (Featuring NIO.2)  – http://dow...
關於 Path•   Methods to access components•   Methods to test and compare•   Methods to combine paths•   File operations•   A...
關於 Path• 建立 Path• 囉嗦點的話...
關於 Path• Path 操作                       同一階層• 實作 equals() path.equals(otherPath)• 實作 Iterable Path path = ...; for (Path na...
檔案移動與複製• 支援選項設定 – copyTo(target, option...) – moveTo(target, option...)
檔案屬性(Metadata)• BasicFileAttributes
檔案屬性(Metadata)• DosFileAttributes• PosixFileAttributes
檔案屬性(Metadata)• 設定群組、擁有者...• 建立 Symbolic link、Hard link...• 尋找 Link 的 Target...
檔案讀寫• 針對 java.io 的 API
檔案讀寫• 針對 Channels 與 ByteBuffers
目錄讀取• 使用 Glob 過濾目錄• What is Glob  – http://download.oracle.com/javase/tutorial/essential/io    /fileOps.html#glob
FileVisitor
FileVisitor                        啟始目錄preVisitDirectory                    postVisitDirectory       檔案                目錄 ...
監看目錄修改• WatchService
新舊之間• Legacy File I/O Code  – http://download.oracle.com/javase/tutorial/    essential/io/legacy.html
Asynchronous Channel API• java.nio.channels – AsynchronousSocketChannel – AsynchronousServerSocketChannel – AsynchronousFi...
Asynchronous Channel API• 建立AsychronousServerSocketChannel  – 類似建立ServerSocketChannel並綁定位址• 接受連結
Asynchronous Channel API• Future 模式
Asynchronous Channel API• Future 模式
Asynchronous Channel API• 客戶端建立AsynchronousSocketChannel• 開啟連結      Future<Void>
Asynchronous Channel API• 客戶端傳送訊息• 伺服端讀取訊息
Asynchronous Channel API• The asynchronous channel APIs  – http://www.ibm.com/developerworks/java/libra    ry/j-nio2-1/ind...
JSR166y / Concurrency Updates
Concurrency Updates• JDK5  – JSR 166: Concurrency Utilities• JDK7  – JSR166y: Concurrency and collections updates  – java....
Divide and conquer
Fork / Join 模式• Divide and conquer 的一種實現策略• 著重在如何切割任務與組合子任務結果
Fork / Join 框架不需傳回值的子動作 透過泛型傳回值的子任務
Fork / Join 框架• ForkJoinTask:類似執行緒的輕量級實體• 有別於 ExecutorService 的 ForkJoinPool  – 採用 Work-stealing 演算,讓空閒的執行緒從執行    較慢的執行緒中偷...
Fibonacci
Fibonacci結果 1134903170耗時 24608
Fibonacci
Fibonacci結果 1134903170耗時 199604
Fibonacci     結果 1134903170     耗時 pick some.... youd 199604 minimum granularitysize for which you always sequentiallysolv...
搜尋檔案
搜尋檔案結果 665耗時 12813
搜尋檔案
搜尋檔案結果 665耗時 7596
JSR292 / Da Vinci Machine 專案
靜態定型語言• 根據資料的型態資訊,將變數及運算式進  行分類,型態資訊是在宣告變數上• 在執行時期變數的型態資訊無法改變,資  料只能被指定至同一種型態的變數
靜態定型語言
靜態定型語言2: invokestatic #3     // Method doSome:(Ljava/lang/String;)Ljava/lang/Integer;17: invokevirtual #7   // Method Othe...
動態定型語言• 型態資訊在資料本身而不是變數• 變數本身的型態是在執行時期運算得知,  也同一變數可以參考至各種型態的資料function max(m, n) {    if(n.lessThan(m)) {        return m; ...
動態定型語言的挑戰•   參數與傳回值都沒有型態•   執行時才提供型態資訊•   無法提前得知呼叫的方法相關型態資訊•   如何成功編譯為位元碼(Byte code)?          function max(m, n) {       ...
動態定型語言的挑戰• 為參數與傳回值建立合成(synthetic)類型    – 可符合位元碼對型態的要求    – 需要為各種語言建立特定實作(Implementer),      以產生對應類型    – JVM 本身的類型(String、...
動態定型語言的挑戰• 運用反射呼叫(reflected invocation) – java.lang.reflect.Method 提供某類別   或介面的方法直接呼叫(正是特定語言實作器   所要求的) – 這些方法仍是執行時期從特定類別上...
動態定型語言的挑戰• 在 JVM 上執行特定語言直譯器(Interpreter) – 非常非常....慢...
JSR 292• 為JVM與位元碼中新增invokedynamic指令 invokedynamic <method-specification> <n>• 新的方法連結機制 – java.lang.invoke    • CallSite   ...
a = 40;  • 考慮有個語言...                        b = a + 2;  • 為這段程式碼產生位元碼...bipush      40           the invokedynamic call si...
JSR 292• + 對整數的方法實作
• An invokedynamic call site is linked to a  method by means of a bootstrap method                   類似 Reflection?
JSR 292• java.lang.reflect.Method – 非方法呼叫專用,執行時期有許多不必要資訊 – 重量級,速度慢• java.lang.invoke.MethodHandle – 主要目的就是在方法呼叫 – 輕量級,速度快
JSR 292• Java Virtual Machine Support for Non-  Java Languages  – http://download.java.net/jdk7/docs/technotes/    guides/...
JSR 292• If a programming language was a  boat…  – http://compsci.ca/blog/if-a-programming-    language-was-a-boat/
感謝 Orz...●   林信良●   caterpillar@openhome.cc●   http://openhome.cc                              Recently rediscovered diagr...
Upcoming SlideShare
Loading in …5
×

千呼萬喚始出來的 Java SE 7

1,701 views

Published on

2011 Java TWO

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,701
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
27
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

千呼萬喚始出來的 Java SE 7

  1. 1. 千呼萬喚始出來的 Java SE 7● 林信良● caterpillar@openhome.cc● http://openhome.cc
  2. 2. 議程• Java 進化史• JSR334 / Coin 專案• Unicode 6.0.0、JDBC 4.1• JSR203 / NIO.2• JSR166y / Concurrency Updates• JSR292 / Da Vinci Machine 專案
  3. 3. Java 進化史 2002/02/13
  4. 4. Java 進化史 2004/09/29
  5. 5. Java 進化史 ? 2006/12/11
  6. 6. Java 進化史 2011/07/28 ?
  7. 7. A / B 計畫• JDK 7 Features updated ! Plan B has apparently been approved – http://www.baptiste-wicht.com/2010/09/jdk-7- features-updated-plan-b-is-apparently-here/
  8. 8. JDK7 ... λ JigsawLanguage support for collections Annotations on Java types
  9. 9. JDK7 有...• JDK 7 Features – http://openjdk.java.net/projects/jdk7/features/ Concurrency UpdatesCoin Invoke Dynamic NIO.2
  10. 10. JSR334 / Coin 專案
  11. 11. Small language enhancements• Strings in switch• Binary integral literals and underscores in numeric literals• Multi-catch and more precise rethrow• Improved Type Inference for Generic Instance Creation (diamond)• try-with-resources statement• Simplified Varargs Method Invocation
  12. 12. Strings in if-else
  13. 13. Strings in switch
  14. 14. 反組譯... 先用 hashCode()再用 equals()
  15. 15. Binary integral literals andunderscores in numeric literals • Binary literal • With underscores for clarity
  16. 16. Multi-catch略... 都作一樣的事 略...
  17. 17. Multi-catch• It is a compile-time error if a disjunctive type contains two alternatives Di, Dj where Di is a subtype of Dj.
  18. 18. Multi-catch• An exception parameter whose type is a disjunctive type is implicitly considered to be final. try { /* throws some ReflectiveOperationException */ } catch (final ClassNotFoundException ex1) { /* body */ } catch (final IllegalAccessException ex2) { /* body */ }
  19. 19. More precise rethrow• JDK6... ... 沒有宣告 Exception ... // 作一些事
  20. 20. More precise rethrow• JDK7... ... ...
  21. 21. Inferring Types with <>• 沒有 Generics 前• 有了 Generics 後• 有了 Inferring Types 後
  22. 22. Inferring Types with <>• 僅使用 <> 表示推斷類型• 不過別什麼都交給編譯器判斷....
  23. 23. Inferring Types with <>• 如果...• 推斷出來是 Integer 或 Number?
  24. 24. Inferring Types with <>• 這有什麼問題?
  25. 25. Try-with-resources• 讓這段程式碼更耐用一些...
  26. 26. Try-with-resources• 讓這段程式碼更簡潔一些...
  27. 27. Try-with-resources• 讓這段程式碼更簡潔一些...
  28. 28. Try-with-resourcestry ResourceSpecification Block⇒{ final VariableModifiers_minus_final R #resource = Expression; Throwable #primaryException = null; try ResourceSpecificationtail Block catch (Throwable #t) { #primaryException = t; throw #t; } finally { if (#resource != null) { if (#primaryException != null) { try { #resource.close(); } catch(Throwable #suppressedException) { #primaryException.addSuppressed(#suppressedException); } } else { #resource.close(); } } }}
  29. 29. Try-with-resources• 如果要處理例外...
  30. 30. Try-with-resources• 如果要處理例外... try-with-resources
  31. 31. Try-with-resources• API 支援 – java.lang.AutoClosable – java.io.Closeable 繼承 AutoCloseable
  32. 32. Try-with-resources• API 支援 – java.beans.XMLDecoder – java.beans.XMLEncoder – java.io.Closeable – java.io.ObjectInput – java.io.ObjectOutput – java.sql.Connection – java.sql.ResultSet – java.sql.Statement – java.nio.channels.FileLock – javax.sound.midi.MidiDevice – javax.sound.midi.Receiver – javax.sound.midi.Transmitter – javax.sound.sampled.Line
  33. 33. Try-with-resources• a 與 b 關閉的順序?
  34. 34. Heap pollution• JDK6.... 要求編譯器檢查傳入引數是不是都是 T 型態• OK...
  35. 35. Heap pollution • 希望編譯器檢查都是 List<String>.........: warning: [unchecked] unchecked generic array creation of type java.util.List<java.lang.String>[] for varargs parameter Util.doSome(Arrays.asList("three", "four"), Arrays.asList(“five", “six")); ^1 warning • 編譯器提醒 doSome() 內部實作可能對每個引數, 只當作 List ...
  36. 36. Heap pollution• 執行時期無法具體確認(reified)引數或變 數型態 – http://en.wikipedia.org/wiki/Heap_pollution• Java 的 Generics 是編譯時期檢查• Generics 的物件相等性? – http://caterpillar.onlyfun.net/JavaEssence/Gen ericEquals.html
  37. 37. Simplified Varargs Method Invocation • JDK7... 提醒設計 doSome() 保證不會發生 Heap Pollution....: warning: [unchecked] Possible heap pollution from parameterized vararg type T public static <T> List<T> doSome(T... t) { ^ where T is a type-variable: T extends Object declared in method <T>doSome(T...)1 warning
  38. 38. Simplified Varargs Method Invocation• @SuppressWarnings(“unchecked”)? – 連同其它的警訊也抑制了... – 對 API 使用者也是有警訊...• @SafeVarargs• javac -Xlint:varargs;
  39. 39. Simplified Varargs Method Invocation• JDK7...
  40. 40. Unicode 6.0.0• 2010-10-11 正式發佈 繪文字(emoji)
  41. 41. Unicode 6.0.0• 2010-10-11 正式發佈 繪文字(emoji)
  42. 42. Unicode 6.0.0• Java SE 7 – Unicode 5.1.0  Unicode 6.0.0• Java Tutorial – http://download.oracle.com/javase/tutorial/i18 n/text/unicode.html• Internationalization Enhancements in Java SE 7 – http://download.java.net/jdk7/docs/technotes/ guides/intl/enhancements.7.html
  43. 43. JDBC 4.1• 繼承 AutoCloseable – Connection – ResultSet – Statement
  44. 44. JDBC 4.1
  45. 45. JDBC 4.1
  46. 46. JDBC 4.1• RowSetProviderjava -Djavax.sql.rowset.RowSetFactory=com.sun.rowset.RowSetFactoryImpl• RowSetFactory
  47. 47. JSR203 / NIO.2
  48. 48. NIO2 NIO• File System API• Channels API – Updates to socket channel API – Asynchronous I/O• java.nio – Buffer – Channel – Selector – Charset
  49. 49. File System API• java.io.File 怎麼了? – Not initially written to be extended – Many of the methods without exceptions – Methods behaved inconsistently across volumes and file systems – Methods for gaining simultaneous metadata about files were inefficient – Developers also requested the ability to develop their own file system implementations, for examples, zip files – ...
  50. 50. File System API• 新套件 – java.nio.file – java.nio.file.attribute• Java Tutorials: File I/O (Featuring NIO.2) – http://download.oracle.com/javase/tutorial/essential/io /fileio.html
  51. 51. 關於 Path• Methods to access components• Methods to test and compare• Methods to combine paths• File operations• All methods that access file system throw IOException• No other checked exceptions in API
  52. 52. 關於 Path• 建立 Path• 囉嗦點的話...
  53. 53. 關於 Path• Path 操作 同一階層• 實作 equals() path.equals(otherPath)• 實作 Iterable Path path = ...; for (Path name: path) { System.out.println(name); }
  54. 54. 檔案移動與複製• 支援選項設定 – copyTo(target, option...) – moveTo(target, option...)
  55. 55. 檔案屬性(Metadata)• BasicFileAttributes
  56. 56. 檔案屬性(Metadata)• DosFileAttributes• PosixFileAttributes
  57. 57. 檔案屬性(Metadata)• 設定群組、擁有者...• 建立 Symbolic link、Hard link...• 尋找 Link 的 Target...
  58. 58. 檔案讀寫• 針對 java.io 的 API
  59. 59. 檔案讀寫• 針對 Channels 與 ByteBuffers
  60. 60. 目錄讀取• 使用 Glob 過濾目錄• What is Glob – http://download.oracle.com/javase/tutorial/essential/io /fileOps.html#glob
  61. 61. FileVisitor
  62. 62. FileVisitor 啟始目錄preVisitDirectory postVisitDirectory 檔案 目錄 鏈結 visitFile visitFile preVisitDirectory postVisitDirectory 檔案 檔案 visitFile visitFile
  63. 63. 監看目錄修改• WatchService
  64. 64. 新舊之間• Legacy File I/O Code – http://download.oracle.com/javase/tutorial/ essential/io/legacy.html
  65. 65. Asynchronous Channel API• java.nio.channels – AsynchronousSocketChannel – AsynchronousServerSocketChannel – AsynchronousFileChannel – AsynchronousDatagramChannel
  66. 66. Asynchronous Channel API• 建立AsychronousServerSocketChannel – 類似建立ServerSocketChannel並綁定位址• 接受連結
  67. 67. Asynchronous Channel API• Future 模式
  68. 68. Asynchronous Channel API• Future 模式
  69. 69. Asynchronous Channel API• 客戶端建立AsynchronousSocketChannel• 開啟連結 Future<Void>
  70. 70. Asynchronous Channel API• 客戶端傳送訊息• 伺服端讀取訊息
  71. 71. Asynchronous Channel API• The asynchronous channel APIs – http://www.ibm.com/developerworks/java/libra ry/j-nio2-1/index.html
  72. 72. JSR166y / Concurrency Updates
  73. 73. Concurrency Updates• JDK5 – JSR 166: Concurrency Utilities• JDK7 – JSR166y: Concurrency and collections updates – java.util.concurrent • ForkJoinPool • Phaser • TransferQueue • ConcurrentLinkedDeque • ThreadLocalRandom • ...
  74. 74. Divide and conquer
  75. 75. Fork / Join 模式• Divide and conquer 的一種實現策略• 著重在如何切割任務與組合子任務結果
  76. 76. Fork / Join 框架不需傳回值的子動作 透過泛型傳回值的子任務
  77. 77. Fork / Join 框架• ForkJoinTask:類似執行緒的輕量級實體• 有別於 ExecutorService 的 ForkJoinPool – 採用 Work-stealing 演算,讓空閒的執行緒從執行 較慢的執行緒中偷取任務 – 建構與處理器數量相當執行緒,減少頻繁切換負擔
  78. 78. Fibonacci
  79. 79. Fibonacci結果 1134903170耗時 24608
  80. 80. Fibonacci
  81. 81. Fibonacci結果 1134903170耗時 199604
  82. 82. Fibonacci 結果 1134903170 耗時 pick some.... youd 199604 minimum granularitysize for which you always sequentiallysolve rather than subdividing.
  83. 83. 搜尋檔案
  84. 84. 搜尋檔案結果 665耗時 12813
  85. 85. 搜尋檔案
  86. 86. 搜尋檔案結果 665耗時 7596
  87. 87. JSR292 / Da Vinci Machine 專案
  88. 88. 靜態定型語言• 根據資料的型態資訊,將變數及運算式進 行分類,型態資訊是在宣告變數上• 在執行時期變數的型態資訊無法改變,資 料只能被指定至同一種型態的變數
  89. 89. 靜態定型語言
  90. 90. 靜態定型語言2: invokestatic #3 // Method doSome:(Ljava/lang/String;)Ljava/lang/Integer;17: invokevirtual #7 // Method Other.doOther:(Ljava/lang/String;)Ljava/lang/Integer;32: invokeinterface #9, 2 // InterfaceMethod Another.doAnother:(Ljava/lang/String;)Ljava/lang/Integer;
  91. 91. 動態定型語言• 型態資訊在資料本身而不是變數• 變數本身的型態是在執行時期運算得知, 也同一變數可以參考至各種型態的資料function max(m, n) { if(n.lessThan(m)) { return m; } JavaScript return n;}def max(m, n): return m if n.lessThan(m) else n Python
  92. 92. 動態定型語言的挑戰• 參數與傳回值都沒有型態• 執行時才提供型態資訊• 無法提前得知呼叫的方法相關型態資訊• 如何成功編譯為位元碼(Byte code)? function max(m, n) { if(n.lessThan(m)) { return m; } return n; }
  93. 93. 動態定型語言的挑戰• 為參數與傳回值建立合成(synthetic)類型 – 可符合位元碼對型態的要求 – 需要為各種語言建立特定實作(Implementer), 以產生對應類型 – JVM 本身的類型(String、Integer...)通常也 無法直接對應 MyObject max(MyObject x, MyObject y) { if(n.lessThan(m)) { return n;invokevirtual #9 // Method MyObject.lessThan:(Ljava/lang/MyObject;)Ljava/lang/Boolean; } return m; }
  94. 94. 動態定型語言的挑戰• 運用反射呼叫(reflected invocation) – java.lang.reflect.Method 提供某類別 或介面的方法直接呼叫(正是特定語言實作器 所要求的) – 這些方法仍是執行時期從特定類別上取得 – 執行時期的效能非常不彰
  95. 95. 動態定型語言的挑戰• 在 JVM 上執行特定語言直譯器(Interpreter) – 非常非常....慢...
  96. 96. JSR 292• 為JVM與位元碼中新增invokedynamic指令 invokedynamic <method-specification> <n>• 新的方法連結機制 – java.lang.invoke • CallSite • MethodHandle • ...
  97. 97. a = 40; • 考慮有個語言... b = a + 2; • 為這段程式碼產生位元碼...bipush 40 the invokedynamic call site is +istore_1iload_1invokestatic Method java/lang/Integer.valueOf:"(I)Ljava/lang/Integer;";bipush 2invokestatic Method java/lang/Integer.valueOf:"(I)Ljava/lang/Integer;";invokedynamic InvokeDynamic REF_invokeStatic: Example.mybsm: method implementation currently unknown "(Ljava/lang/invoke/MethodHandles/Lookup; Ljava/lang/String; Ljava/lang/invoke/MethodType;) Ljava/lang/invoke/CallSite;": +: "(Ljava/lang/Integer; bootstrap method Ljava/lang/Integer;) Ljava/lang/Integer;";
  98. 98. JSR 292• + 對整數的方法實作
  99. 99. • An invokedynamic call site is linked to a method by means of a bootstrap method 類似 Reflection?
  100. 100. JSR 292• java.lang.reflect.Method – 非方法呼叫專用,執行時期有許多不必要資訊 – 重量級,速度慢• java.lang.invoke.MethodHandle – 主要目的就是在方法呼叫 – 輕量級,速度快
  101. 101. JSR 292• Java Virtual Machine Support for Non- Java Languages – http://download.java.net/jdk7/docs/technotes/ guides/vm/multiple-language-support.html
  102. 102. JSR 292• If a programming language was a boat… – http://compsci.ca/blog/if-a-programming- language-was-a-boat/
  103. 103. 感謝 Orz...● 林信良● caterpillar@openhome.cc● http://openhome.cc Recently rediscovered diagrams prove Leonardo invented the first JVM? . http://openjdk.java.net/projects/mlvm/

×