Download free for 30 days
Sign in
Upload
Language (EN)
Support
Business
Mobile
Social Media
Marketing
Technology
Art & Photos
Career
Design
Education
Presentations & Public Speaking
Government & Nonprofit
Healthcare
Internet
Law
Leadership & Management
Automotive
Engineering
Software
Recruiting & HR
Retail
Sales
Services
Science
Small Business & Entrepreneurship
Food
Environment
Economy & Finance
Data & Analytics
Investor Relations
Sports
Spiritual
News & Politics
Travel
Self Improvement
Real Estate
Entertainment & Humor
Health & Medicine
Devices & Hardware
Lifestyle
Change Language
Language
English
Español
Português
Français
Deutsche
Cancel
Save
EN
Uploaded by
Logico
PDF, PPTX
3,634 views
Nashorn in the future (Japanese)
Presentation on Nashorn at Java Day Tokyo 2015.
Technology
◦
Read more
4
Save
Share
Embed
Embed presentation
Download
Download as PDF, PPTX
1
/ 49
2
/ 49
3
/ 49
4
/ 49
5
/ 49
6
/ 49
7
/ 49
8
/ 49
9
/ 49
10
/ 49
11
/ 49
12
/ 49
13
/ 49
14
/ 49
15
/ 49
16
/ 49
17
/ 49
18
/ 49
19
/ 49
20
/ 49
21
/ 49
22
/ 49
23
/ 49
24
/ 49
25
/ 49
26
/ 49
27
/ 49
28
/ 49
29
/ 49
30
/ 49
31
/ 49
32
/ 49
33
/ 49
34
/ 49
35
/ 49
36
/ 49
37
/ 49
38
/ 49
39
/ 49
40
/ 49
41
/ 49
42
/ 49
43
/ 49
44
/ 49
45
/ 49
46
/ 49
47
/ 49
48
/ 49
49
/ 49
More Related Content
PDF
これからのNashorn
by
Logico
PPTX
JavaOne2015報告会 Java EE アップデート #j1jp
by
Norito Agetsuma
PDF
JavaOne 2015 JDK Update (Jigsaw) #j1jp
by
Yuji Kubota
PDF
JavaOne 2015 報告会 @ 東京 「About MVC 1.0 & JSON-P」
by
Hiroyuki Ohnaka
PPTX
Java EE パフォーマンスTips #glassfish_jp
by
Norito Agetsuma
PPTX
Java EE8 Report
by
Norito Agetsuma
PDF
HeapStats @ Seasar Conference 2015 LT
by
Yuji Kubota
PDF
Webアプリに低レイテンシ・高可用性を求めるのは間違っているのだろうか
by
Chihiro Ito
これからのNashorn
by
Logico
JavaOne2015報告会 Java EE アップデート #j1jp
by
Norito Agetsuma
JavaOne 2015 JDK Update (Jigsaw) #j1jp
by
Yuji Kubota
JavaOne 2015 報告会 @ 東京 「About MVC 1.0 & JSON-P」
by
Hiroyuki Ohnaka
Java EE パフォーマンスTips #glassfish_jp
by
Norito Agetsuma
Java EE8 Report
by
Norito Agetsuma
HeapStats @ Seasar Conference 2015 LT
by
Yuji Kubota
Webアプリに低レイテンシ・高可用性を求めるのは間違っているのだろうか
by
Chihiro Ito
What's hot
PDF
Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]
by
David Buck
PDF
Advanced database monitoring in modern java
by
Chihiro Ito
PDF
CDI2.0アップデート&クックブック #JavaDayTokyo #jdt2016_4c
by
Norito Agetsuma
PPT
Java9新機能概要
by
HonMarkHunt
PDF
(Tech DeepDive #1) Java Flight Recorder を活用した問題解決
by
オラクルエンジニア通信
PPTX
Java トラブル解析支援ツール HeapStats のご紹介
by
Shinya Takebayashi
PDF
HeapStats: Introduction and Technical Preview
by
Yuji Kubota
PPTX
Panamaを先取り!? JVMCIでJITと遊ぶ
by
Yasumasa Suenaga
PDF
Javaアプリケーションサーバ 構築・運用の勘所
by
Takahiro YAMADA
PDF
10のJava9で変わるJava8の嫌なとこ!
by
bitter_fox
PDF
Javaヂカラ #Java最新動向 -Java 11 の新機能やOracle Code One 2018 発の最新技術トレンドを一気にキャッチアップ-
by
PE-BANK
PDF
Lt agetsuma 拡大するcdi
by
Norito Agetsuma
PDF
Introduction to JShell: the Java REPL Tool #jjug_ccc #ccc_ab4
by
bitter_fox
PDF
Introduction to JShell #JavaDayTokyo #jdt_jshell
by
bitter_fox
PDF
JJUG 11月ナイトセミナー CDIをはじめよう
by
Norito Agetsuma
PDF
MySQLのNoSQL機能 - MySQL JSON & HTTP Plugin for MySQL
by
Ryusuke Kajiyama
PDF
WildFly Swarmではじめる「パーツとしてのJavaEE」
by
Hiroaki NAKADA
PPTX
Java 9で進化する診断ツール
by
Yasumasa Suenaga
PDF
Logicadの秒間16万リクエストをさばく広告入札システムにおける、gRPCの活用事例
by
Hironobu Isoda
PDF
Head toward Java 16 (Night Seminar Edition)
by
Yuji Kubota
Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]
by
David Buck
Advanced database monitoring in modern java
by
Chihiro Ito
CDI2.0アップデート&クックブック #JavaDayTokyo #jdt2016_4c
by
Norito Agetsuma
Java9新機能概要
by
HonMarkHunt
(Tech DeepDive #1) Java Flight Recorder を活用した問題解決
by
オラクルエンジニア通信
Java トラブル解析支援ツール HeapStats のご紹介
by
Shinya Takebayashi
HeapStats: Introduction and Technical Preview
by
Yuji Kubota
Panamaを先取り!? JVMCIでJITと遊ぶ
by
Yasumasa Suenaga
Javaアプリケーションサーバ 構築・運用の勘所
by
Takahiro YAMADA
10のJava9で変わるJava8の嫌なとこ!
by
bitter_fox
Javaヂカラ #Java最新動向 -Java 11 の新機能やOracle Code One 2018 発の最新技術トレンドを一気にキャッチアップ-
by
PE-BANK
Lt agetsuma 拡大するcdi
by
Norito Agetsuma
Introduction to JShell: the Java REPL Tool #jjug_ccc #ccc_ab4
by
bitter_fox
Introduction to JShell #JavaDayTokyo #jdt_jshell
by
bitter_fox
JJUG 11月ナイトセミナー CDIをはじめよう
by
Norito Agetsuma
MySQLのNoSQL機能 - MySQL JSON & HTTP Plugin for MySQL
by
Ryusuke Kajiyama
WildFly Swarmではじめる「パーツとしてのJavaEE」
by
Hiroaki NAKADA
Java 9で進化する診断ツール
by
Yasumasa Suenaga
Logicadの秒間16万リクエストをさばく広告入札システムにおける、gRPCの活用事例
by
Hironobu Isoda
Head toward Java 16 (Night Seminar Edition)
by
Yuji Kubota
Viewers also liked
PDF
Nashorn in the future (English)
by
Logico
PDF
Nashorn in the future (English)
by
Logico
PDF
CDI 2.0 is coming
by
Antoine Sabot-Durand
PDF
Nashorn: JavaScript Running on Java VM (English)
by
Logico
PDF
Adopt a JSR: CDI 2.0 at Devoxx UK
by
Antoine Sabot-Durand
KEY
Netty 入門 - 「Netty ベース」の何かに着手する前に
by
Takuma SHIRAISHI
PDF
利用者本位のAPI提供に向けたアイデンティティ (ID) 標準仕様の動向
by
Tatsuo Kudo
PDF
CDI 2.0 is upon us Devoxx
by
Antoine Sabot-Durand
KEY
Nettyらへん
by
Go Tanaka
PPTX
SORACOM Bootcamp Rec1 - SORACOM Air (1)
by
SORACOM,INC
PDF
Node-v0.12の新機能について
by
shigeki_ohtsu
PDF
FXML for Structure, CSS for Styling and JavaFX as Standard GUI Library
by
Yuichi Sakuraba
PPTX
Seven Points for Applying Java EE 7
by
Hirofumi Iwasaki
PPTX
JavaDayTokyo2015 [3-1]
by
Kenji Kazumura
PDF
JDK9 新機能 (日本語&ショートバージョン) #jjug
by
Yuji Kubota
PDF
APIdays Australia 2017 TOI #APIdaysAU
by
Tatsuo Kudo
PPTX
HotSpotコトハジメ
by
Yasumasa Suenaga
PPTX
【講演資料】激変する自動車業界におけるクルマ屋の戦略
by
naoto kyo
Nashorn in the future (English)
by
Logico
Nashorn in the future (English)
by
Logico
CDI 2.0 is coming
by
Antoine Sabot-Durand
Nashorn: JavaScript Running on Java VM (English)
by
Logico
Adopt a JSR: CDI 2.0 at Devoxx UK
by
Antoine Sabot-Durand
Netty 入門 - 「Netty ベース」の何かに着手する前に
by
Takuma SHIRAISHI
利用者本位のAPI提供に向けたアイデンティティ (ID) 標準仕様の動向
by
Tatsuo Kudo
CDI 2.0 is upon us Devoxx
by
Antoine Sabot-Durand
Nettyらへん
by
Go Tanaka
SORACOM Bootcamp Rec1 - SORACOM Air (1)
by
SORACOM,INC
Node-v0.12の新機能について
by
shigeki_ohtsu
FXML for Structure, CSS for Styling and JavaFX as Standard GUI Library
by
Yuichi Sakuraba
Seven Points for Applying Java EE 7
by
Hirofumi Iwasaki
JavaDayTokyo2015 [3-1]
by
Kenji Kazumura
JDK9 新機能 (日本語&ショートバージョン) #jjug
by
Yuji Kubota
APIdays Australia 2017 TOI #APIdaysAU
by
Tatsuo Kudo
HotSpotコトハジメ
by
Yasumasa Suenaga
【講演資料】激変する自動車業界におけるクルマ屋の戦略
by
naoto kyo
Similar to Nashorn in the future (Japanese)
KEY
関ジャバ JavaOne Tokyo 2012報告会
by
Koichi Sakata
PDF
20161111 java one2016-feedback
by
Takashi Ito
PDF
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]
by
David Buck
PPTX
キャッチアップJavaScriptビルド -ビルドから見るJSの今/2016春
by
Kondo Hitoshi
PDF
JavaOne2015報告またはこれからのJava
by
なおき きしだ
PDF
Java scriptの進化
by
maruyama097
PDF
20161119 java one-feedback_osaka
by
Takashi Ito
PDF
OpenJDKのコミッタってどんなことしたらなったの?解決してきた技術課題の事例から見えてくる必要な知識と技術(JJUG CCC 2023 Spring)
by
NTT DATA Technology & Innovation
PDF
今年はJava進化の年!今知っておくべき新しいJava
by
Takashi Ito
KEY
Inside frogc in Dart
by
Goro Fuji
PDF
JavaScript.Next Returns
by
dynamis
PDF
OpenJDK コミュニティに参加してみよう #jjug
by
Yuji Kubota
PDF
JavaScript ライブラリーを使い倒そう #buildinsider
by
Tsuyoshi Yasunishi
PDF
JavaScriptおよびXPages Vote技術解説
by
賢次 海老原
PDF
Adaptive optimization of JIT compiler
by
nothingcosmos
PPTX
Cve 2013-0422
by
abend_cve_9999_0001
PDF
20190202 jdk new_release_model_sendai
by
オラクルエンジニア通信
PDF
実践 NestJS
by
Ayumi Goto
PDF
JavaScript.Next
by
dynamis
PDF
JDK:新しいリリースモデル解説 @ 富山 BuriKaigi 2019
by
Takashi Ito
関ジャバ JavaOne Tokyo 2012報告会
by
Koichi Sakata
20161111 java one2016-feedback
by
Takashi Ito
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]
by
David Buck
キャッチアップJavaScriptビルド -ビルドから見るJSの今/2016春
by
Kondo Hitoshi
JavaOne2015報告またはこれからのJava
by
なおき きしだ
Java scriptの進化
by
maruyama097
20161119 java one-feedback_osaka
by
Takashi Ito
OpenJDKのコミッタってどんなことしたらなったの?解決してきた技術課題の事例から見えてくる必要な知識と技術(JJUG CCC 2023 Spring)
by
NTT DATA Technology & Innovation
今年はJava進化の年!今知っておくべき新しいJava
by
Takashi Ito
Inside frogc in Dart
by
Goro Fuji
JavaScript.Next Returns
by
dynamis
OpenJDK コミュニティに参加してみよう #jjug
by
Yuji Kubota
JavaScript ライブラリーを使い倒そう #buildinsider
by
Tsuyoshi Yasunishi
JavaScriptおよびXPages Vote技術解説
by
賢次 海老原
Adaptive optimization of JIT compiler
by
nothingcosmos
Cve 2013-0422
by
abend_cve_9999_0001
20190202 jdk new_release_model_sendai
by
オラクルエンジニア通信
実践 NestJS
by
Ayumi Goto
JavaScript.Next
by
dynamis
JDK:新しいリリースモデル解説 @ 富山 BuriKaigi 2019
by
Takashi Ito
More from Logico
PDF
Welcome, Java 15! (Japanese)
by
Logico
PDF
Look into Project Valhalla from CLR viewpoint
by
Logico
PDF
Jvmls 2019 feedback valhalla update
by
Logico
PDF
Project Helidon Overview (Japanese)
by
Logico
PDF
Oracle Code One 2018 Feedback (Server Side / Japanese)
by
Logico
PDF
ADBA (Asynchronous Database Access)
by
Logico
PDF
Java EE 8 Overview (Japanese)
by
Logico
PDF
Another compilation method in java - AOT (Ahead of Time) compilation
by
Logico
PDF
Polyglot on the JVM with Graal (English)
by
Logico
PDF
CDI 2.0 (JSR 365) - Java Day Tokyo 2017 (English)
by
Logico
PDF
Polyglot on the JVM with Graal (Japanese)
by
Logico
PDF
Nashorn : JavaScript Running on Java VM (Japanese)
by
Logico
Welcome, Java 15! (Japanese)
by
Logico
Look into Project Valhalla from CLR viewpoint
by
Logico
Jvmls 2019 feedback valhalla update
by
Logico
Project Helidon Overview (Japanese)
by
Logico
Oracle Code One 2018 Feedback (Server Side / Japanese)
by
Logico
ADBA (Asynchronous Database Access)
by
Logico
Java EE 8 Overview (Japanese)
by
Logico
Another compilation method in java - AOT (Ahead of Time) compilation
by
Logico
Polyglot on the JVM with Graal (English)
by
Logico
CDI 2.0 (JSR 365) - Java Day Tokyo 2017 (English)
by
Logico
Polyglot on the JVM with Graal (Japanese)
by
Logico
Nashorn : JavaScript Running on Java VM (Japanese)
by
Logico
Nashorn in the future (Japanese)
1.
Nashorn in the
Future Oracle Corporation Japan Fusion Middleware Business Unit NISHIKAWA, Akihiro 2015年年4⽉月8⽇日 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
2.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The following is intended to outline our general product direcIon. It is intended for informaIon purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or funcIonality, and should not be relied upon in making purchasing decisions. The development, release, and Iming of any features or funcIonality described for Oracle’s products remains at the sole discreIon of Oracle. 2
3.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | Agenda What's Nashorn? 8u20 8u40 In the future... 1 2 3 4 3
4.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | What’s Nashorn? 4
5.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | Nashorn • Rhinoの置き換え – セキュリティ、パフォーマンスの向上 • InvokeDynamic (JSR-‐292) のProof of Concept 5 Java 8から導⼊入されたJavaScript Engine (JEP 174)
6.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | Nashorn • ECMAScript-‐262 EdiIon 5.1 • javax.script (JSR 223) API • JavaóJavaScript間での相互呼び出し • コマンドラインツールは jjs Java 8から導⼊入されたJavaScript Engine (JEP 174) 6
7.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | 使ってみよう • jjs – Hello World – Lambda Expression, Stream • jjs –scripting – Web APIを呼び出してみる • jjs –fx – WebView 7
8.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | Lambda ExpressionはFuncIonで // Java array.stream().sorted(Comparator.naturalOrder()) .forEach( t -‐> sortedArray.add(t) ); // Nashorn array.stream().sorted(Comparator.naturalOrder()) .forEach(function(t) sortedArray.add(t)); 8
9.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | Javaから呼び出す(1) ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = manager.getEngineByName("nashorn"); // 評価 engine.eval("print('hello world')"); // hello world engine.eval(new FileReader(“hello.js”)); // hello.js 9
10.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | Javaから呼び出す(2) engine.eval("function hello(name){ print('Hello, ' + name); }"); Invocable inv=(Invocable)engine; // Hello, Taro Object obj= inv.invokeFunction("hello","Taro"); 10 JavaScriptのfunc:onを呼び出す
11.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | Javaから呼び出す(3) engine.eval("function run(){ print('run() called'); }"); Invocable inv =(Invocable)engine; Runnable r=inv.getInterface(Runnable.class); Thread th=new Threads(r); th.start(); th.join(); 11 Script func:onでInterfaceを実装する
12.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | 8u20 12
13.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | 8u20 • セキュリティ⾯面の強化 • 基礎部分のJIT/JDKの強化 13 2014年年8⽉月リリース
14.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | constを varで置き換え • デフォルトはfalse • 8u40でconstをサポートしたので、今後使えなくなる予定 14 -‐-‐const-‐as-‐var=true|false
15.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | ScriptからJava PackageやClassへのアクセスを禁⽌止 • デフォルトはfalse 15 -‐-‐no-‐java=true|false (-‐nj)
16.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | ECMAScript標準に反する構⽂文の使⽤用を禁⽌止 • Java.typeなどのExtensionは利利⽤用可 • -‐scripting 併⽤用時には⾃自動的に無効化 16 -‐-‐no-‐syntax-‐extensions (-‐nse)
17.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | #sourceURLと@sourceURL • Evalソースに名前を付ける //# sourceURL=myScript.js @sourceURL=myScript.js 17 JDK-‐8032068 : implement @sourceURL and #sourceURL direc:ves
18.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | クラスキャッシュ • 当初は内部にキャッシュを保持せず、逐⼀一コンパイル • 8u20から、内部にキャッシュを持ち、コードを再利利⽤用するように • 例例:Javaから – engine.eval(new URLReader(myScriptURL)); • JavaScriptから – load(url); 18 JDK-‐8021350 : Share script classes between threads/globals within context
19.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | 8u40 19
20.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | 8u40 • パフォーマンス改善 – OpImisIc typing (JEP 196) – Code Persistence (JEP 194) • セキュリティ – Class Filter (JEP 202) • ECMAScript 6仕様の段階的なサポート – Lexical-‐scoped variables and constant definiIon (JEP 203) 20 実装されたJEP
21.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | JEP 196: OpImisIc Typing • できるだけ実⾏行行時に型推論論せずに パフォーマンス向上をはかる – 演算および配列列のインデックス操作 で使⽤用する特定の型(type)を仮定 – 仮定した型推論論が正しくない場合、 仮定を取り消してフォールバック • -‐-‐optimistic-‐types=true|false (-‐ot) – デフォルトはfalse 21 楽観的型推論論 – Javaのようなバイトコードを⽣生成するために int long double Object
22.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | JEP 196: OpImisIc Typing • nashorn.typeInfo.maxFiles – 型情報をキャッシュするためのファイルの最⼤大個数 – 0でキャッシュを保持しない設定 • nashorn.typeInfo.cacheDir – 型情報をキャッシュするファイルが存在するディレクトリ • Windows: ${java.io.tmpdir}com.oracle.java.NashornTypeInfo • LinuxとSolaris: ~/.cache/com.oracle.java.NashornTypeInfo • Mac OS X: ~/Library/Caches/com.oracle.java.NashornTypeInfo 22 型推論論結果のキャッシュ
23.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | JEP 194: Code Persistence • 同じプロセス内で再利利⽤用できるようコードをキャッシュ • メモリ使⽤用量量の削減ならびに起動時間短縮に寄与 23 コードキャッシュによる⾼高速化
24.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | JEP 194: Code Persistence • -‐-‐class-‐cache-‐size=50 (-‐ccs) – グローバル・スコープ毎のクラス・キャッシュサイズ – デフォルトサイズは50 (個) • -‐-‐persistent-‐code-‐cache=true|false (-‐pcc) – 楽観的型推論論情報(OpImisIc type informaIon)も含め、ディスクにコンパイ ル済みスクリプトを永続化 – デフォルトはfalse 24 コードキャッシュによる⾼高速化
25.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | JEP 194: Code Persistence • -‐pccを指定した場合の情報の永続先 – デフォルトは実⾏行行ディレクトリのnashorn_code_cache – フォルダ名は変更更可能 • nashorn.persistent.code.cache システムプロパティ • クラスのバイトコードだけでなく様々なメタデータを保持 25 コードキャッシュによる⾼高速化
26.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | 遅延コンパイル • On Demandでメソッドをコンパイル • デフォルトは true – 8u31までは試験的オプションのためfalse 26 -‐-‐lazy-‐compilation=true|false
27.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | JEP 202: Class Filter • JEP 202: Nashorn Class Filter hjps://bugs.openjdk.java.net/browse/JDK-‐8043717 • JavaScriptを使うJavaアプリケーション側で実装 – jdk.nashorn.api.scripting.ClassFilter 27 JavaScriptからJavaクラスへのアクセスを抑⽌止
28.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | ClassFilter実装例例 import jdk.nashorn.api.scripting.ClassFilter; class MyFilter implements ClassFilter { @Override public boolean exposeToScripts(String s) { if (s.compareTo("java.io.File") == 0) return false; return true; } } 28 java.io.Fileを制限したい場合
29.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | ECMAScript 6の段階的なサポート 29
30.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | JEP 203: Lexically-‐scoped variable and constant declaraIons • -‐-‐language=es5|es6 – デフォルトはes5 – const、letを使う場合は-‐-‐language=es6が必須 • let – ブロックに含まれるスコープ内変数の宣⾔言に利利⽤用 • const – letと同様、constを使って宣⾔言した定数はブロック内に⽣生存範囲を限定 30 スコープ内変数(let)や定数(const)の宣⾔言
31.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | // let let a=2; function f(x) { // ここではaは2 if(x) { let a=42; } // aは2のまま } // var var a=2; function f(x) { // ここではaは未定義 if(x) { var a=42; } // x次第でaは42もしくは未定義 } 31 letとvar
32.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | // 1) 構⽂文エラー function f(x) { const b=1; // 代⼊入不不可 b = 99; } // 2) スコープその1 function f(x) { const b=1; var z=b+1; //z=2 } //bは未定義 var y=b+1; 32 // 3) スコープその2 function f(x) { const b=1; var z =b+1; //z=2 } //bは定義可能 const b = 10; const
33.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | Server Side JavaScript 33
34.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | Server Side JavaScript… • JVMで動作するNode.js互換フレームワーク – Nodyn • Vert.x + Dyn.JS + Nejy – Trieme • apigeeによるNode.js互換フレームワーク • 最近はやりのReacIve Programming – RxJS – React.JS などなど 34
35.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | 35 hVps://blogs.oracle.com/theaquarium/entry/project_avatar_update そんな時代もあったね...
36.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | In the future... 36
37.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | In the Future • 地道な改善 – ウォームアップ時間短縮のための改善 – OpImisIc Typing、Code Persistenceの改善 • Java 9 – ECMAScript 6の完全サポート – Parser API for Nashorn (JEP 236) – Java Flight Recorder • JavaScript Profiler • Nashorn⽤用のタグ ...などなど 37 Java 8u60、9、その先
38.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | 地道な改善 • JSONパース時の性能向上のために – プロパティ情報などの⼩小さなJSONオブジェクトを取り扱う場合、 PropertyHashMap#findElement を使うと遅かった。 jdk.nashorn.internal.parser.JSONParserを書き換え 38 例例えば8u60では
39.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | Java Flight Recorder 39 JavaScript Profilerの可能性
40.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | JEP 236: Parser API for Nashorn • ⽬目的 – ECMAScriptのコードをASTとして表現するためのParser API – Visitorパターン – 内部実装パッケージ (jdk.nashorn.internal.ir) を使わせない • 注意 – Java API(スクリプトレベルのAPIではない) – 可能な限りECMAScriptの仕様に基づいてASTノードを表現 40 ECMAScript ASTのための公開API
41.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | JEP 236: Parser API for Nashorn • JDK9 b55以後で試すことが できる • JavaDoc – hjps://bugs.openjdk.java.net/ browse/JDK-‐8048176 41 jdk.nashorn.api.tree
42.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | まとめ 42
43.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | まとめ • 8u20、8u40でパフォーマンス向上の ための機能が追加されました • 今後もNashornの開発は続⾏行行します • 是⾮非フィードバックをお願いします 43
44.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | Nashorn Project • Nashorn Mailing List – nashorn-‐dev@openjdk.java.net • Nashorn Wiki – hjps://wiki.openjdk.java.net/display/Nashorn/Main • DEVELOPER_README – hjp://hg.openjdk.java.net/jdk8u/jdk8u-‐dev/nashorn/file/Ip/docs/ DEVELOPER_README • Nashorn -‐ JavaScript for the JVM – hjp://blogs.oracle.com/nashorn/ 44 hjp://openjdk.java.net/projects/nashorn/
45.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The preceding is intended to outline our general product direcIon. It is intended for informaIon purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or funcIonality, and should not be relied upon in making purchasing decisions. The development, release, and Iming of any features or funcIonality described for Oracle’s products remains at the sole discreIon of Oracle. 45
46.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. | 46
48.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. |
Download