JP6223002B2 - METHOD, PROGRAM, AND SYSTEM FOR PROCESSING OBJECT IN COMPUTER - Google Patents

METHOD, PROGRAM, AND SYSTEM FOR PROCESSING OBJECT IN COMPUTER Download PDF

Info

Publication number
JP6223002B2
JP6223002B2 JP2013121979A JP2013121979A JP6223002B2 JP 6223002 B2 JP6223002 B2 JP 6223002B2 JP 2013121979 A JP2013121979 A JP 2013121979A JP 2013121979 A JP2013121979 A JP 2013121979A JP 6223002 B2 JP6223002 B2 JP 6223002B2
Authority
JP
Japan
Prior art keywords
map
return value
node
context
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2013121979A
Other languages
Japanese (ja)
Other versions
JP2014238770A (en
Inventor
洋 堀井
洋 堀井
拓 井上
拓 井上
倫大 堀江
倫大 堀江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
International Business Machines Corp
Original Assignee
International Business Machines Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by International Business Machines Corp filed Critical International Business Machines Corp
Priority to JP2013121979A priority Critical patent/JP6223002B2/en
Publication of JP2014238770A publication Critical patent/JP2014238770A/en
Application granted granted Critical
Publication of JP6223002B2 publication Critical patent/JP6223002B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Description

この発明は、コンピュータにおけるオブジェクトの処理技法に関し、より詳しくは、連想配列(マップ、Map)に格納されたオブジェクトの取得処理(Map.get処理、Keyを指定してオブジェクトを取得する)を最適化する技法に関する。   The present invention relates to an object processing technique in a computer, and more specifically, optimization of acquisition processing of an object stored in an associative array (map, Map) (Map.get processing, acquisition of an object by specifying a key). Related techniques.

従来より、インターナショナル・ビジネス・マシーンズ・コーポレーションにより提供されているWebSphere(R)などの大規模なソフトウェアでは、呼び出しコンテキスト(Calling Context)によって一意的にKeyの値が決定されるMap.getが頻繁に処理されている。   Conventionally, in large-scale software such as WebSphere (R) provided by International Business Machines Corporation, Map.get in which the value of Key is uniquely determined by Calling Context is frequently used. It has been processed.

特に、eコーマス向けのあるアプリケーションでは、数%のCPU能力が、Map.get処理に費やされ、その数十%が呼び出しコンテキストによって一意的にKeyの値が決定されることが分かっている。   In particular, in an application for e-commerce, it is known that several percent of CPU power is spent for Map.get processing, and several tens of percent of the application context uniquely determines the value of Key.

このようなMap.get処理は、呼び出しコンテキストから返す値を決定する処理を最適化することが可能である。この処理は、例えば、特定の呼び出しコンテキストには、特定の値を返す、などである。   Such Map.get processing can optimize the processing to determine the value to be returned from the calling context. This processing is, for example, returning a specific value to a specific calling context, and so on.

しかし、このような最適化処理は、JITなどのコンパイラでは、対応できない。というのは、バイトコード・レベルでは、Mapセマンティックスが認識できないからである。   However, such optimization processing can not be handled by a compiler such as JIT. Because at the byte code level, Map semantics can not be recognized.

また、一般的なJITコンパイラでは、最適化の対象はメソッド単位であり、多段のメソッド呼び出しから特定の値が導くことが可能な呼び出しコンテキストには対応できない。通常、JITコンパイラでは、インライン可能なメソッド呼び出しの段数が制限されている。上記eコマース向けのアプリケーションの場合は、10段以上のメソッドをインラインする必要があり、制限によりインラインされることはない。   Also, in a general JIT compiler, the object of optimization is method-based, and it can not cope with a call context in which a specific value can be derived from multi-step method calls. In general, the number of stages of method calls that can be inlined is limited in the JIT compiler. In the case of the above-mentioned application for e-commerce, it is necessary to inline ten or more stages of methods, and they are not inlined due to limitations.

これに関する従来技術として、特開2010−205170号公報は、マルチスレッド上で動作するプログラムのプログラム・コードをロック衝突が少ないプログラム・コードに変換する技法を開示する。   As a prior art related to this, Japanese Patent Laid-Open No. 2010-205170 discloses a technique for converting program code of a program operating on multithread into program code with less lock collision.

特開2011−253437号公報は、PHPのプロパティ名pから一意に決まるJavaのインターフェース・クラスI(p)を必要に応じて生成してロードするJavaのクラスローダを用意し、PHPのクラスの階層に対応してJavaのクラスを生成してキャッシュすることにより、動的に作られるPHP上のクラス階層と同じJava上のクラス階層が準備するステップを実行し、上記インターフェース・クラスI(p)を実装するようにJavaのクラスを宣言して、当該インターフェースに備わったメソッドの実装として、Javaのフィールドへのアクセスとしてプロパティ・アクセスのコードを備えさせることにより、インターフェースを通じたプロパティアクセスを可能にするステップを開示する。   JP 2011-253437 A prepares a Java class loader that generates and loads a Java interface class I (p) uniquely determined from PHP property name p, as needed, and a hierarchy of PHP classes By creating and caching Java classes in response to the above, the step of preparing the same class hierarchy on Java as the dynamically generated class hierarchy on PHP is executed, and the above interface class I (p) Steps to enable property access through the interface by declaring a Java class to implement and providing the property access code as an access to the Java field as an implementation of the methods provided in the interface Disclose.

しかし、これら従来技術は、Map.get処理の最適化には適用できない。なお、背景技術として、http://www.ibm.com/developerworks/jp/java/library/j-jtp07233/あるいは、http://docs.oracle.com/javase/jp/6/api/java/util/concurrent/ConcurrentHashMap.htmlに、ConcurrentHashMapに関する解説がある。   However, these conventional techniques can not be applied to optimization of Map.get processing. As background technology, http://www.ibm.com/developerworks/jp/java/library/j-jtp07233/ or http://docs.oracle.com/javase/jp/6/api/java/ There is a comment on ConcurrentHashMap in util / concurrent / ConcurrentHashMap.html.

特開2010−205170号公報Unexamined-Japanese-Patent No. 2010-205170 特開2011−253437号公報JP, 2011-253437, A

http://www.ibm.com/developerworks/jp/java/library/j-jtp07233/http://www.ibm.com/developerworks/jp/java/library/j-jtp07233/ http://docs.oracle.com/javase/jp/6/api/java/util/concurrent/ConcurrentHashMap.htmlhttp://docs.oracle.com/javase/jp/6/api/java/util/concurrent/ConcurrentHashMap.html

この発明の目的は、JVMなどの処理系の許容する範囲で、呼び出しコンテキストによって一意にKeyの値が決定されるMap.get処理を最適化する技法を提供することにある。   An object of the present invention is to provide a technique for optimizing Map.get processing in which the value of a Key is uniquely determined by a call context within the range of an implementation such as a JVM.

本発明は、上記課題を、
(1) サンプリング結果から呼び出しコンテキストの起点メソッドを特定し、
(2) 特定したメソッドのクラスのフィールドにget返値情報を保持し、
(3) 呼び出しコンテキスト内のメソッド引数にget返値情報を追加し、
(4) Mapのget処理内にget処理内にget返値情報の妥当性を検証後、値を返す、
という処理を、ソフトウェアで実行することにより自動的に達成する。
The present invention addresses the above-mentioned problems,
(1) Identify the calling context origin method from the sampling result,
(2) Hold get return value information in the field of the specified method class,
(3) Add get return value information to the method argument in the calling context,
(4) Return the value after verifying the validity of get return value information in get processing in get processing of Map
The processing is automatically achieved by executing it in software.

起点クラスの特定方法は、頻繁にgetが呼ばれているMapに対して、スタック・トレースのサンプルを取得し、ノードと値のマッピングをとり、ノードと値のマッピングをとり、一対一対応となっているメソッドを起点と特定する処理を行う。なお、1コンテキスト内で複数のノードが起点となる場合は、一方を選択する。   The method of specifying the origin class is to obtain a sample of stack trace for Map where get is called frequently, map nodes to values, map nodes to values, and have one-to-one correspondence Process to identify the target method as the starting point. When a plurality of nodes serve as starting points in one context, one is selected.

get返値情報には、Map.Entryとして、Map、Key、Valueを格納する。なお、Map.Entryは、Mapを構成する要素である。一般的なMap.get処理では、Map.Entry中のKeyの値を比較して要求されたKeyを持つMap.Entryを特定し、そのValueを返す処理がなされる。   In the get return value information, Map, Key, and Value are stored as Map.Entry. Map.Entry is an element that configures Map. In general Map.get processing, the value of Key in Map.Entry is compared to specify Map.Entry having the requested Key, and processing for returning that Value is performed.

get処理においては、get返値の妥当性のチェックが成功した場合は、get返値情報のValueを返し、それ以外の場合は通常のget処理を行い、get返値情報の初期化を行う。   In the get processing, when the validity check of the get return value is successful, the Value of the get return value information is returned, and otherwise normal get processing is performed to initialize the get return value information.

この発明によれば、呼び出しコンテキストによって一意にKeyの値が決定されるMap.get処理を最適化する技法が提供される。   According to the present invention, a technique is provided to optimize Map.get processing in which the value of Key is uniquely determined by the call context.

本発明を実施するための一例のハードウェア構成のブロック図である。It is a block diagram of an example hardware configuration for carrying out the present invention. 本発明を実施するための一例のソフトウェア構成の階層を示す図である。FIG. 5 is a diagram illustrating an example software configuration hierarchy for implementing the present invention. 本発明の処理のフローチャートを示す図である。It is a figure which shows the flowchart of a process of this invention. 複数のプログラム間のMap.getの呼び出しを示す図である。It is a figure which shows the call of Map.get between several programs. Map.getの呼び出しの階層を示す図である。It is a figure which shows the hierarchy of a call of Map.get. 本発明により修正された複数のプログラム間のMap.getの呼び出しを示す図である。It is a figure which shows the call of Map.get between several programs corrected by this invention.

以下、図面に従って、本発明の実施例を説明する。これらの実施例は、本発明の好適な態様を説明するためのものであり、発明の範囲をここで示すものに限定する意図はないことを理解されたい。また、以下の図を通して、特に断わらない限り、同一符号は、同一の対象を指すものとする。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. It is to be understood that these examples are intended to illustrate preferred embodiments of the present invention and are not intended to limit the scope of the invention to what is set forth herein. Further, throughout the following drawings, the same reference numerals indicate the same objects unless otherwise specified.

図1を参照すると、本発明の一実施例に係るシステム構成及び処理を実現するためのコンピュータ・ハードウェアのブロック図が示されている。図1において、システム・バス102には、CPU104と、主記憶(RAM)106と、ハードディスク・ドライブ(HDD)108と、キーボード110と、マウス112と、ディスプレイ114が接続されている。CPU104は、好適には、32ビットまたは64ビットのアーキテクチャに基づくものであり、例えば、インテル社のCore(商標) i3、Core(商標) i5、Core(商標) i7、Xeon(R)、AMD社のAthlon(商標)、Phenom(商標)、Sempron(商標)などを使用することができる。主記憶106は、好適には、8GB以上の容量、より好ましくは、32GB以上の容量をもつものである。   Referring to FIG. 1, a block diagram of computer hardware for implementing the system configuration and processing according to one embodiment of the present invention is shown. In FIG. 1, a CPU 104, a main storage (RAM) 106, a hard disk drive (HDD) 108, a keyboard 110, a mouse 112, and a display 114 are connected to the system bus 102. The CPU 104 is preferably based on a 32-bit or 64-bit architecture, for example, Intel's CoreTM i3, CoreTM i5, CoreTM i7, Xeon®, AMD. Athlon (TM), Phenom (TM), Sempron (TM) etc. can be used. The main memory 106 preferably has a capacity of 8 GB or more, more preferably 32 GB or more.

ハードディスク・ドライブ108には、オペレーティング・システム(OS)が格納されている。オペレーティング・システムは、Linux(商標)、マイクロソフト社のWindows(商標) 7、Windows(商標)2008サーバなどの、CPU104に適合する任意のものでよい。オペレーティング・システム(OS)は、後述する図2では、参照番号202で示される。   The hard disk drive 108 stores an operating system (OS). The operating system may be anything that is compatible with CPU 104, such as Linux (TM), Microsoft's Windows (TM) 7, Windows (TM) 2008 server, and the like. The operating system (OS) is indicated by reference numeral 202 in FIG. 2 described below.

ハードディスク・ドライブ108にはさらに、Java(R)仮想マシン(JVM)204(図2)を実現するためのJava(R) Runtime Environmentプログラムが格納されている。   The hard disk drive 108 further stores a Java (R) Runtime Environment program for realizing the Java (R) virtual machine (JVM) 204 (FIG. 2).

ハードディスク・ドライブ108にはさらに、JVM上で動作する、インターナショナル・ビジネス・マシーンズ・コーポレーションから提供されるミドルウェアである、WebSphere(R) Commerceが導入されている。ミドルウェアは、後述する図2では、参照番号206で示される。   The hard disk drive 108 further incorporates WebSphere (R) Commerce, which is middleware provided by International Business Machines Corporation, which runs on the JVM. The middleware is indicated by reference numeral 206 in FIG. 2 described later.

ハードディスク・ドライブ108にはさらに、ミドルウェア上で動作する、プログラム群208が導入されている。プログラム群には、この発明に従い、バイトコード・レベルでプログラムを変更する変換プログラムが含まれる。変換プログラムは、後述する図2では、参照番号210で示される。   The hard disk drive 108 further includes a program group 208 operating on middleware. The program group includes a conversion program for changing the program at the byte code level according to the present invention. The conversion program is indicated by reference numeral 210 in FIG. 2 described later.

ハードディスク・ドライブ108にはまた、Apacheなどの、Webサーバとしてシステムを動作させるためのプログラムが保存されている。   The hard disk drive 108 also stores programs for operating the system as a Web server, such as Apache.

キーボード110及びマウス112は、オペレーティング・システムが提供するグラフィック・ユーザ・インターフェースに従い、ディスプレイ114に表示されたアイコン、タスクバー、テキストボックスなどのグラフィック・オブジェクトを操作するために使用される。   The keyboard 110 and the mouse 112 are used to operate graphic objects such as an icon, a task bar, and a text box displayed on the display 114 according to a graphic user interface provided by the operating system.

ディスプレイ114は、これには限定されないが、好適には、1024×768以上の解像度をもち、32ビットtrue colorのLCDモニタである。ディスプレイ114は例えば、JVM上で実行されるアプリケーション・プログラムによる動作の結果を表示するために使用される。   The display 114 is preferably, but not limited to, a 32-bit true color LCD monitor with a resolution of 1024 × 768 or higher. The display 114 is used, for example, to display the result of an operation by an application program running on the JVM.

通信インターフェース116は、好適には、イーサネット(R)プロトコルにより、ネットワークと接続されている。通信インターフェース116は、クライアント・コンピュータ(図示しない)からApacheが提供する機能により、TCP/IPなどの通信プロトコルに従い、処理リクエストを受け取り、その処理結果を、クライアント・コンピュータ(図示しない)に返す。   The communication interface 116 is preferably connected to the network by the Ethernet (R) protocol. The communication interface 116 receives a processing request according to a communication protocol such as TCP / IP by the function provided by Apache from a client computer (not shown), and returns the processing result to the client computer (not shown).

次に図2を参照して、本発明を実施するためのソフトウェアの階層を説明する。図2において、オペレーティング・システム202上でJVM204が動作し、JVM204上で、WebSphere(R) Commerceであるミドルウェア206が動作し、ミドルウェア206の管理の下に、Map.get処理を含むようなプログラム群208が配置され、変換プログラム210は、本発明の特徴に従い、バイトコード・レベルでプログラム群208のMap.get処理を最適化する処理を実行する。   Referring now to FIG. 2, the hierarchy of software for practicing the invention will be described. In FIG. 2, a program group in which a JVM 204 operates on an operating system 202, middleware 206 which is a WebSphere (R) commerce operates on the JVM 204, and includes Map.get processing under the management of the middleware 206. 208 is located, and the conversion program 210 executes processing for optimizing Map.get processing of the program group 208 at the byte code level according to the feature of the present invention.

次に、図3を参照して、変換プログラム210の処理について説明する。図3において、ステップ302では、変換プログラム210は、jprofあるいは、IBM(R) Health Centerなどのプロファイラ・ツールを使って、Mapのgetメソッドを頻繁に呼んでいる呼び出し元(caller)プログラムを特定する。図4に、複数のプログラム間の呼び出し関係の例を示す。   Next, processing of the conversion program 210 will be described with reference to FIG. In FIG. 3, in step 302, the conversion program 210 identifies a caller program that frequently calls Map's get method using a profiler tool such as jprof or IBM (R) Health Center. . FIG. 4 shows an example of a calling relationship between a plurality of programs.

呼び出し元プログラムを特定すると、変換プログラム210はステップ304で、呼び出し元プログラムの呼び出し後に、Key、Value、スタック・トレース(StackTrace)をサンプリングするコードを挿入する。そのコードは例えば、次のようなものである。このコードは、ソースコード・レベルで挿入してもよいし、バイトコード・レベルで挿入してもよい。
String value = map.get(key);
try {
throw new Exception();
} catch (Exception ex) {
StackTraceElement[] cc = ex.getStackTrace();
profile(cc, key, value);
}
Once the calling program is identified, the conversion program 210 inserts code for sampling Key, Value, Stack Trace (StackTrace) in step 304 after calling the calling program. The code is, for example, as follows. This code may be inserted at the source code level or at the byte code level.
String value = map.get (key);
try {
throw new Exception ();
} catch (Exception ex) {
StackTraceElement [] cc = ex.getStackTrace ();
profile (cc, key, value);
}

そのようにしてサンプリングした結果の例の一部を以下に示す。
X.m0 → A.m1 → B.m2→ Cache.get:“AAA”,“VA”
Y.m0 → C.m1 → B.m2 → Cache.get:“CCC”,“CA”
X.m0 → A.m1 → B.m2 → Cache.get:“AAA”,“VA”
AA.m1 → B.m2 → Cache.get:“AAA”,“VA”
X.m0 → A.m1 → B.m2 → Cache.get:“AAA”,“VA”
X.m0 → A.m1 → B.m2 → Cache.get:“AAA”,“VA”
AA.m1 → B.m2 → Cache.get “AAA”,“VA”
Y.m0 → C.m1 → B.m2 → Cache.get:“CCC”,“CA”
Some examples of such sampled results are shown below.
X.m0->A.m1->B.m2-> Cache.get: "AAA", "VA"
Y.m0 → C.m1 → B.m2 → Cache.get: “CCC”, “CA”
X.m0 → A.m1 → B.m2 → Cache.get: “AAA”, “VA”
AA.m1 → B.m2 → Cache.get: “AAA”, “VA”
X.m0 → A.m1 → B.m2 → Cache.get: “AAA”, “VA”
X.m0 → A.m1 → B.m2 → Cache.get: “AAA”, “VA”
AA.m1 → B.m2 → Cache.get “AAA”, “VA”
Y.m0 → C.m1 → B.m2 → Cache.get: “CCC”, “CA”

次に、変換プログラム210はステップ306で、上記サンプリングした結果から、同一のサンプルを特定する。それは以下のとおりである。
X.m0 → A.m1 → B.m2→ Cache.get:“AAA”,“VA”
AA.m1 → B.m2 → Cache.get:“AAA”,“VA”
Y.m0 → C.m1 → B.m2 → Cache.get:“CCC”,“CA”
Next, at step 306, the conversion program 210 identifies the same sample from the sampled result. It is as follows.
X.m0->A.m1->B.m2-> Cache.get: "AAA", "VA"
AA.m1 → B.m2 → Cache.get: “AAA”, “VA”
Y.m0 → C.m1 → B.m2 → Cache.get: “CCC”, “CA”

次に、変換プログラム210はステップ308で、各メソッドと、そのメソッドがgetする値の対応をつける。それは以下の表のようになる。

Figure 0006223002
Next, at step 308, the conversion program 210 associates each method with the value acquired by that method. It looks like the following table.
Figure 0006223002

次に、変換プログラム210はステップ310で、1対1で対応されているメソッドを特定する。それは以下の表の陰をつけた部分である。

Figure 0006223002
Next, at step 310, the conversion program 210 specifies a one-to-one corresponding method. It is the shaded part of the table below.
Figure 0006223002

次に、変換プログラム210はステップ312で、特定したメソッドのうち、最もMapのgetに近いメソッドのクラスを、get返値情報を保持するクラスと特定する。それは、図5の例では、太線で囲ったクラスである。なお、このようなクラスの階層関係は、上記スタック・トレースから呼び出しコンテキストを取得し、呼び出しコンテキストを利用することで知ることができる。   Next, in step 312, the conversion program 210 specifies the class of the method closest to the Map get among the specified methods as the class holding the get return value information. It is a class surrounded by a thick line in the example of FIG. Note that the hierarchical relationship of such classes can be known by obtaining the call context from the stack trace and using the call context.

次に、変換プログラム210はステップ314で、特定したメソッドからgetまでの全メソッドに対し、get返値情報を引数として追加されたメソッドを生成する。これは例えば、Memを引数にとることであり、
B.m2(A.class.GetName(),...); を
B.m2(A.class.GetName(),...,mem); に修正することである。
Next, at step 314, the conversion program 210 generates a method added with get return value information as an argument for all methods from the specified method to the get. This is, for example, taking Mem as an argument,
B.m2 (A.class.GetName (), ...);
B. m2 (A.class.GetName (), ..., mem);

次に、変換プログラム210はステップ316で、特定したメソッドからgetまで、get返値情報を引数として追加されたメソッドを呼び出すように修正する。図6は、修正されたコードの呼び出しを示す。   Next, at step 316, the conversion program 210 modifies the specified method to get to call a method added with get return value information as an argument. FIG. 6 shows the calling of the modified code.

特に図6において、class ConcurrentHashMap<K,V> {...}における、
Object m = mem.validate(map,key,mem);
return m != null ? m : mem.initialize(map.getEntry(key));
というコードは、get返値memの妥当性をvalidate(map,key,mem)でチェックし、妥当であればmを返し、そうでないなら、get返値情報の初期化を行うことを示す。
Especially in FIG. 6, in class ConcurrentHashMap <K, V> {.
Object m = mem.validate (map, key, mem);
return m! = null? m: mem.initialize (map.getEntry (key));
The following code checks the validity of the get return value mem with validate (map, key, mem), returns m if it is correct, and otherwise indicates initialization of get return value information.

下記はConcurrentHashMap.getのコードのより具体的な実装例を示す。
public V get(Object key, Mem<K, V> memo) {
HashEntry<K, V> memoEntry =
memo.validate(this, key);
if (memoEntry != null)
return memoEntry.value;
int hash = hash(key);
HashEntry<K, V> ret =
segmentFor(hash).getEntry(key, hash);
memo.initialize(ret);
if (ret == null)
return null;
else
return ret.value;
}
The following shows a more concrete implementation example of the code of ConcurrentHashMap.get.
public V get (Object key, Mem <K, V> memo) {
HashEntry <K, V> memoEntry =
memo.validate (this, key);
if (memoEntry! = null)
return memoEntry.value;
int hash = hash (key);
HashEntry <K, V> ret =
segmentFor (hash) .getEntry (key, hash);
memo.initialize (ret);
if (ret == null)
return null;
else
return ret. value;
}

また、上記ConcurrentHashMap.getのコードの中で使用されているMemというクラスのコードの例を示す。ここには、initialize()とvalidate()というメソッドの実装も示されている。
public static class Mem<K, V> {
ConcurrentHashMap.HashEntry<K, V> value;
V initialize(HashEntry<K, V> value) {
this.value = value;
return value.value;
}
V validate(
ConcurrentHashMap<K, V> map,
Object key) {
HashEntry<K, V> memoEntry = value;
if (memoEntry != null //
// 1. HashEntry.delete is volatile
&& !memoEntry.delete
// 2. HashEntry.parent is final
&& memoEntry.parent == map
// 3. HashEntry.key is final
&& key.equals(memoEntry.key))
return memoEntry.value;
else
return null;
}
}
Also, an example of code of class Mem used in the above code of ConcurrentHashMap.get is shown. Also shown here is the implementation of the initialize () and validate () methods.
public static class Mem <K, V> {
ConcurrentHashMap.HashEntry <K, V>value;
V initialize (HashEntry <K, V> value) {
this.value = value;
return value.value;
}
V validate (
ConcurrentHashMap <K, V> map,
Object key) {
HashEntry <K, V> memoEntry = value;
if (memoEntry! = null //
// 1. HashEntry.delete is volatile
&&! memoEntry.delete
// 2. HashEntry.parent is final
&& memoEntry.parent == map
// 3. HashEntry.key is final
&& key.equals (memoEntry.key))
return memoEntry.value;
else
return null;
}
}

以上、本発明を、JVM上に導入したミドルウェアであるWebSphere(R) Commerce上でMap.getを実装する例において説明したきたが、このような構成は一例に過ぎず、Map.getの実装を可能ならしめる任意の構成において本発明を実施可能であることを理解されたい。   The present invention has been described above in the example of implementing Map.get on WebSphere (R) Commerce, which is middleware introduced on the JVM, but such a configuration is only an example, and the implementation of Map.get is It should be understood that the present invention can be practiced in any configuration that makes it possible.

104 CPU
106 RAM
108 ハードディスク・ドライブ
202 OS
204 JVM
206 ミドルウェア
210 変換プログラム
104 CPU
106 RAM
108 Hard Disk Drive 202 OS
204 JVM
206 middleware 210 conversion program

Claims (12)

コンピュータの処理によって、呼び出しコンテキストに従って、Mapからデータを取り出す処理(以下getと称する)によってメソッド中で返されるオブジェクトを処理する方法であって、
前記呼び出しコンテキストの起点メソッドを特定するステップと、
前記特定した起点メソッドのクラスのフィールドにget返り値、および、get返り値の妥当性検証に必要な情報を保持するステップと、
前記呼び出しコンテキスト内のメソッド引数にget返り値を追加するステップと、
Mapのget返り値情報の妥当性を検証するステップと、
前記Mapのget返り値情報が妥当であるとの判定に応答して、前記Mapのget返り値を返すステップと、
前記Mapのget返り値情報が妥当でないとの判定に応答して、前記Mapのget返り値を最新に更新するステップを有する、
方法。
A method of processing an object returned in a method by a process of retrieving data from a map (hereinafter referred to as get) according to a calling context by computer processing,
Identifying an origin method of the invocation context;
Holding a get return value in a field of the specified origin method class and information necessary for validation of the get return value;
Adding a get return value to the method argument in the calling context;
Verifying the validity of Map's get return value information;
Returning the map's get return value in response to determining that the map's get return value information is valid;
Updating the get return value of the map to the latest in response to the determination that the get return value information of the map is not valid;
Method.
前記起点メソッドを特定するステップが、
Mapのget返り値のサンプルを取得するステップと、
前記Mapのget返り値のサンプルに基づき、コンテキスト中のメソッドをノードとし、各ノードを経由してMapのgetが返し得る値とノードをマッピングするステップと、
前記マッピングにおいて、Mapのgetの返り値と一対一対応となっているノードに該当するメソッドを起点メソッド特定するステップを有する、
請求項1に記載の方法。
The step of identifying the origin method is
Getting a sample of map's get return value,
Taking a method in context as a node based on a sample of a return value of the Map, mapping the node to a value that can be returned by the Map get via each node;
In the mapping, comprising the step of identifying a method corresponding to the node that is the return value and the one-to-one correspondence get the Map originating method,
The method of claim 1.
前記一連のステップがJVM上で実行される、請求項1に記載の方法。   The method of claim 1, wherein the sequence of steps is performed on a JVM. 前記Mapのget返り値情報の妥当性を検証するステップが、ConcurrentHashMapのクラスで実装される、請求項3に記載の方法。   The method according to claim 3, wherein the step of verifying the validity of get return value information of the Map is implemented in a class of ConcurrentHashMap. コンピュータの処理によって、呼び出しコンテキストに従って、Mapからデータを取り出す処理(以下getと称する)によってメソッド中で返されるオブジェクトを処理するプログラムであって、
前記コンピュータに、
前記呼び出しコンテキストの起点メソッドを特定するステップと、
前記特定した起点メソッドのクラスのフィールドにget返り値、および、get返り値の妥当性検証に必要な情報を保持するステップと、
前記呼び出しコンテキスト内のメソッド引数にget返り値を追加するステップと、
Mapのget返り値情報の妥当性を検証するステップと、
前記Mapのget返り値情報が妥当であるとの判定に応答して、前記Mapのget返り値を返すステップと、
前記Mapのget返り値情報が妥当でないとの判定に応答して、前記Mapのget返り値を最新に更新するステップを実行させる、
プログラム。
A program for processing an object returned in a method by a process of retrieving data from a map (hereinafter referred to as "get") according to a calling context by computer processing,
On the computer
Identifying an origin method of the invocation context;
Holding a get return value in a field of the specified origin method class and information necessary for validation of the get return value;
Adding a get return value to the method argument in the calling context;
Verifying the validity of Map's get return value information;
Returning the map's get return value in response to determining that the map's get return value information is valid;
Causing the step of updating the get return value of the map to be updated in response to the determination that the get return value information of the map is not valid;
program.
前記起点メソッドを特定するステップが、
Mapのget返り値のサンプルを取得するステップと、
前記Mapのget返り値のサンプルに基づき、コンテキスト中のメソッドをノードとし、各ノードを経由してMapのgetが返し得る値とノードをマッピングするステップと、
前記マッピングにおいて、Mapのgetの返り値と一対一対応となっているノードに該当するメソッドを起点メソッド特定するステップを有する、
請求項5に記載のプログラム。
The step of identifying the origin method is
Getting a sample of map's get return value,
Taking a method in context as a node based on a sample of a return value of the Map, mapping the node to a value that can be returned by the Map get via each node;
In the mapping, comprising the step of identifying a method corresponding to the node that is the return value and the one-to-one correspondence get the Map originating method,
The program according to claim 5.
前記一連のステップがJVM上で実行される、請求項5に記載のプログラム。   The program according to claim 5, wherein the series of steps are executed on a JVM. 前記Mapのget返り値情報の妥当性を検証するステップが、ConcurrentHashMapのクラスで実装される、請求項7に記載のプログラム。   The program according to claim 7, wherein the step of verifying the validity of the get return value information of the Map is implemented by a class of ConcurrentHashMap. コンピュータの処理によって、呼び出しコンテキストに従って、Mapからデータを取り出す処理(以下getと称する)によってメソッド中で返されるオブジェクトを処理するシステムであって、
前記呼び出しコンテキストの起点メソッドを特定する手段と、
前記特定した起点メソッドのクラスのフィールドにget返り値、および、get返り値の妥当性検証に必要な情報を保持する手段と、
前記呼び出しコンテキスト内のメソッド引数にget返り値を追加する手段と、
Mapのget返り値情報の妥当性を検証する手段と、
前記Mapのget返り値情報が妥当であるとの判定に応答して、前記Mapのget返り値を返す手段と、
前記Mapのget返り値情報が妥当でないとの判定に応答して、前記Mapのget返り値を最新に更新する手段を有する、
システム。
A system for processing an object returned in a method by a process of retrieving data from a map (hereinafter referred to as "get") according to a calling context by computer processing,
Means for identifying an origin method of the invocation context;
A means for holding a get return value in a field of the specified source method class and information necessary for validation of the get return value;
Means for adding a get return value to a method argument in said calling context;
A means for verifying the validity of Map's get return value information;
A means for returning the get return value of the map in response to the determination that the get return value information of the map is valid;
Having means for updating the Map return value to the latest in response to the determination that the Map return value information is not valid;
system.
前記起点メソッドを特定する手段が、
Mapのget返り値のサンプルを取得する処理と、
前記Mapのget返り値のサンプルに基づき、コンテキスト中のメソッドをノードとし、各ノードを経由してMapのgetが返し得る値とノードをマッピングする処理と、
前記マッピングにおいて、Mapのgetの返り値と一対一対応となっているノードに該当するメソッドを起点メソッド特定する処理を行う、
請求項9に記載のシステム。
The means for identifying the origin method is
Process to get a sample of Map's get return value,
A process of setting a method in a context as a node based on a sample of a get return value of the Map, and mapping the node to a value that can be returned by the Map get via each node;
In the mapping, processing is performed to specify a method corresponding to a node that has a one-to-one correspondence with the return value of get of Map as an origin method.
The system of claim 9.
前記システムは、JVM及びミドルウェア上で実装される、請求項9に記載のシステム。   The system of claim 9, wherein the system is implemented on a JVM and middleware. 前記Mapのget返り値情報の妥当性を検証する手段が、ConcurrentHashMapのクラスで実装される、請求項11に記載のシステム。   The system according to claim 11, wherein the means for verifying the validity of the get return value information of the Map is implemented in a class of ConcurrentHashMap.
JP2013121979A 2013-06-10 2013-06-10 METHOD, PROGRAM, AND SYSTEM FOR PROCESSING OBJECT IN COMPUTER Expired - Fee Related JP6223002B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013121979A JP6223002B2 (en) 2013-06-10 2013-06-10 METHOD, PROGRAM, AND SYSTEM FOR PROCESSING OBJECT IN COMPUTER

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013121979A JP6223002B2 (en) 2013-06-10 2013-06-10 METHOD, PROGRAM, AND SYSTEM FOR PROCESSING OBJECT IN COMPUTER

Publications (2)

Publication Number Publication Date
JP2014238770A JP2014238770A (en) 2014-12-18
JP6223002B2 true JP6223002B2 (en) 2017-11-01

Family

ID=52135865

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013121979A Expired - Fee Related JP6223002B2 (en) 2013-06-10 2013-06-10 METHOD, PROGRAM, AND SYSTEM FOR PROCESSING OBJECT IN COMPUTER

Country Status (1)

Country Link
JP (1) JP6223002B2 (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070073740A1 (en) * 2005-09-29 2007-03-29 Kirshenbaum Evan R Retrieving a value associated with a property based on a hierarchy of components
JP5425715B2 (en) * 2010-06-03 2014-02-26 インターナショナル・ビジネス・マシーンズ・コーポレーション Program execution method, system, and program

Also Published As

Publication number Publication date
JP2014238770A (en) 2014-12-18

Similar Documents

Publication Publication Date Title
US11106475B2 (en) Correlating class loader objects across execution environments
US8806432B2 (en) Method, system, and program for executing program
KR101669630B1 (en) Conditional dynamic instrumentation of software in a specified transaction context
US11733985B2 (en) Accessing a migrated member in an updated type
EP2671161B1 (en) System and method for determining an objects lifetime in an object oriented environment
US10684827B2 (en) Generating dynamic modular proxies
AU2012256399B2 (en) Registration and execution of highly concurrent processing tasks
US8984497B2 (en) Source code converting, method program, and systems for first programming language to a code in a second programming language
US20070256069A1 (en) Dependency-based grouping to establish class identity
US8037460B2 (en) Code persistence and dependency management for dynamic compilation in a database management system
US20080034352A1 (en) System and method for determining unimportant probe locations by examination of byte code to identify method by name pattern
US9442818B1 (en) System and method for dynamic data collection
KR102443171B1 (en) System and method for supporting data type conversion in a heterogeneous computing environment
US10802855B2 (en) Producing an internal representation of a type based on the type&#39;s source representation
US10922107B2 (en) Apparatus and method for realizing runtime system for programming language
JP6223002B2 (en) METHOD, PROGRAM, AND SYSTEM FOR PROCESSING OBJECT IN COMPUTER
US10521200B2 (en) Unambiguous proxying of interface methods
US9817680B1 (en) Application configuration tool
JP2014225077A (en) Method for managing object in computer, and program and system
JP6112978B2 (en) RDF expression generation method, program, and system
Chen et al. Heat: A combined approach for thread escape analysis

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160524

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170324

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170411

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170705

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20170912

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20171003

R150 Certificate of patent or registration of utility model

Ref document number: 6223002

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees