JP6193151B2 - 多分岐判断構文の最適化処理装置 - Google Patents
多分岐判断構文の最適化処理装置 Download PDFInfo
- Publication number
- JP6193151B2 JP6193151B2 JP2014037149A JP2014037149A JP6193151B2 JP 6193151 B2 JP6193151 B2 JP 6193151B2 JP 2014037149 A JP2014037149 A JP 2014037149A JP 2014037149 A JP2014037149 A JP 2014037149A JP 6193151 B2 JP6193151 B2 JP 6193151B2
- Authority
- JP
- Japan
- Prior art keywords
- branch
- syntax
- determination
- lexical
- appearance frequency
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/42—Syntactic analysis
- G06F8/425—Lexical analysis
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/443—Optimisation
- G06F8/4441—Reducing the execution time required by the program code
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/443—Optimisation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Devices For Executing Special Programs (AREA)
Description
一例として、次のSQLクエリで説明する。頻出字句表は、予めソースコードを読み込んで静的に分析した結果を受けて作成する。
予約語の出現回数:4回 (SELECT, FROM, WHERE, AND)
IDの出現回数:6回 (FUNC, TABLE, COND, P, X, Y)
スペースの出現回数: 7回
()の出現回数: 合わせて4回
数字の出現回数:2回 (1が2回)
=の出現回数:2回
+の出現回数:1回
*の出現回数:1回
したがって、この例では、トークンの総数は27となる。
スペースの出現率: 26% ( 7/27)
( )の出現率: 15% ( 4/27)
数字の出現率: 7%( 2/27)
= の出現率: 7% ( 2/27)
+の出現率: 3% ( 1/27)
*の出現率: 3% ( 1/27)
したがって、出現頻度順は、アルファベット、スペース、( )、数字、=、+、*となる。
次に、以上のように構成された多分岐判断構文の最適化処理装置100における字句解析処理の流れについて説明する。
本実施形態による最適化の効果を、SQLite の字句解析ルーチンと比較した。SQLite の字句解析では、演算子、特殊記号の判定に switch 文を使用しており、分岐のcase が43個である。default 部で予約語とID名を判定し、文脈判定は構文解析器に任せている。
字句解析は、アルファベット、スペース、数字、 ( )、 =、*、+ を先に判定し、その他をジャンプテーブルで判定した。CPUは、Intel Core i7(登録商標)で、n=16とした。
11・・・入力部
12・・・メモリ
13・・・データベース
14・・・変換部
Claims (4)
- トークンを含む多分岐判断構文を保持するメモリと、
前記多分岐判断構文の最適化処理装置内に組み込まれるCPUに依存するパラメータであって、多分岐判断処理に要する時間に基づいて設定するCPUの能力情報と、
予めソースコードを静的に分析し、字句解析するクエリの中で、出現頻度順に並び替えたトークンの種別と出現率を表した頻出字句表を保持するデータベース部と、
前記CPUの能力情報と頻出字句表を参照して前記多分岐判断構文に対して判定を実行し、出現頻度の高いトークン種別では投機的実行可能な分岐をさせ、出現頻度の低いトークン種別ではジャンプテーブルを使用した分岐をさせるように変換した分岐コードを生成する変換部を備える多分岐判断構文の最適化処理装置。 - 前記多分岐判断構文は、switch 文であり、前記投機的実行可能な分岐は、if−else型のswitch 文による分岐である請求項1記載の多分岐判断構文の最適化処理装置。
- 前記分岐コードは、コンパイラが解釈する中間コードである請求項1又は請求項2に記載の多分岐判断構文の最適化処理装置。
- トークンを含む多分岐判断構文を蓄積した第1ファイルと、
CPUに依存するパラメータであって、多分岐判断処理に要する時間に基づいて設定するCPUの能力情報を蓄積した第2ファイルと、
予めソースコードを静的に分析し、字句解析するクエリの中で、出現頻度順に並び替えたトークンの種別と出現率を表した頻出字句表を蓄積したデータベースファイルとを含んでおり、
コンピュータに、前記CPUの能力情報と頻出字句表を参照して前記多分岐判断構文に対して判定を実行し、出現頻度の高いトークン種別では投機的実行可能な分岐をさせ、出現頻度の低いトークン種別ではジャンプテーブルを使用した分岐をさせるように変換した分岐コードを生成させるためのプログラムを記録したコンピュータ読み取り可能な記録媒体。
Priority Applications (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2014037149A JP6193151B2 (ja) | 2013-03-01 | 2014-02-27 | 多分岐判断構文の最適化処理装置 |
| US14/771,993 US9715374B2 (en) | 2013-03-01 | 2014-02-28 | Multi-branch determination syntax optimization apparatus |
| PCT/JP2014/001116 WO2014132668A1 (ja) | 2013-03-01 | 2014-02-28 | 多分岐判断構文の最適化処理装置 |
Applications Claiming Priority (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2013040932 | 2013-03-01 | ||
| JP2013040932 | 2013-03-01 | ||
| JP2014037149A JP6193151B2 (ja) | 2013-03-01 | 2014-02-27 | 多分岐判断構文の最適化処理装置 |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2014194759A JP2014194759A (ja) | 2014-10-09 |
| JP6193151B2 true JP6193151B2 (ja) | 2017-09-06 |
Family
ID=51427942
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2014037149A Active JP6193151B2 (ja) | 2013-03-01 | 2014-02-27 | 多分岐判断構文の最適化処理装置 |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US9715374B2 (ja) |
| JP (1) | JP6193151B2 (ja) |
| WO (1) | WO2014132668A1 (ja) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US11261894B2 (en) | 2016-04-27 | 2022-03-01 | Hilti Aktiengesellschaft | Anchor having a wave-shaped sleeve |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10248394B2 (en) | 2017-08-18 | 2019-04-02 | International Business Machines Corporation | Utilizing created character index for switch statements |
| CN110263223B (zh) * | 2019-06-25 | 2023-10-20 | 深圳市元征科技股份有限公司 | 一种数据类型转化方法、装置、设备及介质 |
| US11061652B1 (en) * | 2020-03-26 | 2021-07-13 | Cognizant Technology Solutions India Pvt. Ltd. | System and a method for moving legacy applications to cloud |
| US12487828B2 (en) * | 2023-05-23 | 2025-12-02 | Microchip Technology Inc. | Processor having switch instruction circuit |
Family Cites Families (15)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CA2010068C (en) | 1990-02-14 | 1993-10-26 | Steven Murray Hoxey | Partitioning case statements for optimal execution performance |
| JPH07160490A (ja) * | 1993-12-01 | 1995-06-23 | Nippondenso Co Ltd | コーディング支援装置 |
| JPH07160499A (ja) * | 1993-12-09 | 1995-06-23 | Nec Corp | 多方向分岐命令の最適化方式 |
| US6035123A (en) * | 1995-11-08 | 2000-03-07 | Digital Equipment Corporation | Determining hardware complexity of software operations |
| JP3599888B2 (ja) * | 1996-04-19 | 2004-12-08 | 株式会社東芝 | オブジェクト生成装置及びその方法 |
| US6381739B1 (en) * | 1996-05-15 | 2002-04-30 | Motorola Inc. | Method and apparatus for hierarchical restructuring of computer code |
| US6412105B1 (en) * | 1997-12-31 | 2002-06-25 | Elbrus International Limited | Computer method and apparatus for compilation of multi-way decisions |
| US7996827B2 (en) * | 2001-08-16 | 2011-08-09 | Martin Vorbach | Method for the translation of programs for reconfigurable architectures |
| US6986131B2 (en) * | 2002-06-18 | 2006-01-10 | Hewlett-Packard Development Company, L.P. | Method and apparatus for efficient code generation for modulo scheduled uncounted loops |
| US20060130016A1 (en) * | 2003-03-17 | 2006-06-15 | Wagner John R | Method of kernal-mode instruction interception and apparatus therefor |
| JP4973101B2 (ja) * | 2006-09-29 | 2012-07-11 | 日本電気株式会社 | 自動合成装置 |
| US8001510B1 (en) * | 2008-09-05 | 2011-08-16 | Xilinx, Inc. | Automated method of architecture mapping selection from constrained high level language description via element characterization |
| US8356165B2 (en) * | 2009-09-14 | 2013-01-15 | Advanced Micro Devices, Inc. | Selecting regions of hot code in a dynamic binary rewriter |
| US20110219357A1 (en) * | 2010-03-02 | 2011-09-08 | Microsoft Corporation | Compressing source code written in a scripting language |
| US9342303B2 (en) * | 2013-03-15 | 2016-05-17 | Intel Corporation | Modified execution using context sensitive auxiliary code |
-
2014
- 2014-02-27 JP JP2014037149A patent/JP6193151B2/ja active Active
- 2014-02-28 US US14/771,993 patent/US9715374B2/en active Active
- 2014-02-28 WO PCT/JP2014/001116 patent/WO2014132668A1/ja not_active Ceased
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US11261894B2 (en) | 2016-04-27 | 2022-03-01 | Hilti Aktiengesellschaft | Anchor having a wave-shaped sleeve |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2014194759A (ja) | 2014-10-09 |
| US20150363177A1 (en) | 2015-12-17 |
| US9715374B2 (en) | 2017-07-25 |
| WO2014132668A1 (ja) | 2014-09-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7711685B1 (en) | Method and system for an extensible macro language | |
| CN107844705B (zh) | 基于二进制代码特征的第三方组件漏洞检测方法 | |
| US9239710B2 (en) | Programming language transformations with abstract syntax tree extensions | |
| US20150268940A1 (en) | Automatic loop vectorization using hardware transactional memory | |
| JP2014194759A (ja) | 多分岐判断構文の最適化処理装置 | |
| US9495638B2 (en) | Scalable, rule-based processing | |
| Negrini et al. | Twinning automata and regular expressions for string static analysis | |
| JP7655397B2 (ja) | 不正検知装置、不正検知方法、および不正検知プログラム | |
| JP6309795B2 (ja) | 情報処理装置、情報処理方法およびプログラム | |
| US7228528B2 (en) | Building inter-block streams from a dynamic execution trace for a program | |
| KR102614967B1 (ko) | 자바스크립트의 중간 언어 기반 의미론 추출 자동화 시스템 및 방법 | |
| CN108563561B (zh) | 一种程序隐性约束提取方法及系统 | |
| CN112905232B (zh) | 一种基于语法分析树的程序代码平行语料挖掘方法及系统 | |
| CN109816038B (zh) | 一种物联网固件程序分类方法及其装置 | |
| US7917899B2 (en) | Program development apparatus, method for developing a program, and a computer program product for executing an application for a program development apparatus | |
| US7779049B1 (en) | Source level optimization of regular expressions | |
| JP5342407B2 (ja) | プログラム解析方法、プログラム解析プログラムおよびプログラム解析装置 | |
| CN111158691B (zh) | 实现规则引擎动态化的方法 | |
| Stanier et al. | A study of irreducibility in C programs | |
| Grigorev et al. | GLR-based abstract parsing | |
| JP6298785B2 (ja) | 自然言語解析装置、方法、及びプログラム | |
| Du et al. | Revisiting the markov property for machine translation | |
| JP2006031363A (ja) | バッファオーバーフロー脆弱性検出プログラム及びバッファオーバーフロー脆弱性検出方法 | |
| Nakasho | Development of a flexible Mizar tokenizer and parser for information retrieval system | |
| KR101559651B1 (ko) | 동적 분석 방법 및 장치 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20160923 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20170606 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20170619 |
|
| 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: 20170711 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20170809 |
|
| R151 | Written notification of patent or utility model registration |
Ref document number: 6193151 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
| S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313114 Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |