JP2005293386A

Compiler, compiler program, recording medium, control method and central processor

Abstract

Problem to be solved.To provide a compiler, a compiler program, a recording medium, a control method and a central processor which realize optimized conversion of a character code system.

Solution.The compiler optimizes the conversion of the character code system of characters to be stored in a character variable in an object program to be optimized and is provided with: a conversion instruction generation part which reads characters of the character variable written by a first character code system, converts the characters from the first character code system into a second character code system and generates a conversion instructions to be stored in the character variable prior to each of a plurality of processings using the above read characters in the second character code system; and a conversion instruction removal part which removes the conversion instructions about each conversion instruction generated by the conversion instruction generation part when the characters in the second character code system are stored in the character variable in all execution paths to be executed prior to the conversion instructions.

Copyright (C)2006,JPO&NCIPI

JP2005293386A, drawing sheet 1
Sheet 1 of 23

Term

No projected expiry on record.

  1. Priority and filed
  2. Published
  3. Today

21 claims: 9 independent, 12 dependent

  1. 1
    A compiler that optimizes the conversion of the character code system of the characters stored in the character variable in the target program to be optimized. It reads the characters of the character variable written by the first character code system and reads the second character. Prior to each of a plurality of processes using the character in the code system, a conversion instruction for converting the character from the first character code system to the second character code system and storing it in the character variable is generated. For the conversion instruction generation unit and each conversion instruction generated by the conversion instruction generation unit, the characters of the second character code system are stored in the character variables in all the execution paths executed prior to the conversion instruction. A compiler including a conversion instruction removing unit that removes the conversion instruction when the conversion instruction is performed. 最適化対象の対象プログラムにおいて文字変数に格納される文字の文字コード体系の変換を最適化するコンパイラであって、 第1の文字コード体系により書き込まれた文字変数の文字を読み出して第2の文字コード体系において当該文字を使用する複数の処理の各々に先立って、当該文字を前記第1の文字コード体系から前記第2の文字コード体系に変換して当該文字変数に格納する変換命令を生成する変換命令生成部と、 前記変換命令生成部により生成された各変換命令について、当該変換命令に先立って実行される全ての実行パスにおいて、前記文字変数に前記第2の文字コード体系の文字が格納される場合に、当該変換命令を除去する変換命令除去部とを備えるコンパイラ。
  2. 8
    A compiler that optimizes the conversion of the character code system of the characters stored in the character variable in the target program to be optimized. It reads the characters of the character variable written by the first character code system and reads the second character. As each of a plurality of processes using the character in the code system, the process is executed when the character stored in the character variable is the second character code system, and the character is the first character code. A character operation processing generator that generates an instruction sequence with an exception that raises an exception when it is a system, and a character that is executed when the exception occurs and is stored in the character variable from the first character code system. A compiler including an exception handler generator that converts to the second character code system, stores it in the character variable, and generates an exception handler that returns to the process that caused the exception. 最適化対象の対象プログラムにおいて文字変数に格納される文字の文字コード体系の変換を最適化するコンパイラであって、 第1の文字コード体系により書き込まれた文字変数の文字を読み出して第2の文字コード体系において当該文字を使用する複数の処理の各々として、前記文字変数に格納される文字が前記第2の文字コード体系である場合に当該処理を実行し、当該文字が前記第1の文字コード体系である場合に例外を発生させる例外付命令列を生成する文字操作処理生成部と、 前記例外が発生した場合に実行され、前記文字変数に格納される文字を前記第1の文字コード体系から前記第2の文字コード体系に変換して当該文字変数に格納し、前記例外を発生させた当該処理に復帰させる例外ハンドラを生成する例外ハンドラ生成部とを備えるコンパイラ。
  3. 11
    A compiler that optimizes the conversion process that converts the characters stored in the character variables in the target program to be optimized from the first character code system to the second character code system, and converts the character code of the characters to be converted. The acquisition process generation unit that generates the instruction sequence of the process to be acquired, each of the plurality of conversion processes that should be selected and executed according to the range of the character code values, and the range of the character code values. Based on the detection result of the detection process, the conversion detection process generation unit that generates an instruction sequence that executes the detection process for detecting the above, and the process result of any one of the plurality of conversion processes. A compiler equipped with a selection processing generator that generates an instruction sequence to be selected and output. 最適化対象の対象プログラムにおいて文字変数に格納される文字を第1の文字コード体系から第2の文字コード体系に変換する変換処理を最適化するコンパイラであって、 変換対象の文字の文字コードを取得する処理の命令列を生成する取得処理生成部と、 前記文字コードの値の範囲に応じて何れかを選択して実行すべき複数の前記変換処理の各々と、前記文字コードの値の範囲を検出する検出処理とを並行して実行する命令列を生成する変換検出処理生成部と、 前記複数の変換処理のうち何れかの変換処理の処理結果を、前記検出処理の検出結果に基づいて選択して出力する命令列を生成する選択処理生成部とを備えるコンパイラ。
  4. 15
    It is a central processing device that executes a conversion process that converts characters in the first character code system, which have different data sizes according to the type of characters, into characters in the second character code system, and is the data size of the character code of the characters. Each time, in parallel with the conversion process to be executed when a plurality of character codes of the data size are continuously arranged in the register, a plurality of character codes of the data size are continuously arranged in the register. A central processing device having an instruction to execute a detection process for detecting whether or not a data is generated. 文字の種類に応じてデータサイズの異なる第1の文字コード体系の文字を第2の文字コード体系の文字に変換する変換処理を実行する中央処理装置であって、 前記文字の文字コードのデータサイズ毎に、当該データサイズの複数の文字コードがレジスタに連続して配列される場合に実行すべき前記変換処理と並行して、当該データサイズの複数の文字コードが前記レジスタに連続して配列されるか否かを検出する検出処理を実行する命令を有する中央処理装置。
  5. 16
    A compiler program that makes a computer function as a compiler that optimizes the conversion of the character code system of characters stored in character variables in the target program to be optimized. The computer is written by the first character code system. Prior to each of a plurality of processes in which the character of the character variable is read and the character is used in the second character code system, the character is converted from the first character code system to the second character code system. For the conversion instruction generation unit that generates the conversion instruction to be stored in the character variable and each conversion instruction generated by the conversion instruction generation unit, the character variable is set to the character variable in all the execution paths executed prior to the conversion instruction. A compiler program that functions as a conversion instruction removal unit that removes the conversion instruction when the characters of the second character code system are stored. 最適化対象の対象プログラムにおいて文字変数に格納される文字の文字コード体系の変換を最適化するコンパイラとしてコンピュータを機能させるコンパイラプログラムであって、 前記コンピュータを、 第1の文字コード体系により書き込まれた文字変数の文字を読み出して第2の文字コード体系において当該文字を使用する複数の処理の各々に先立って、当該文字を前記第1の文字コード体系から前記第2の文字コード体系に変換して当該文字変数に格納する変換命令を生成する変換命令生成部と、 前記変換命令生成部により生成された各変換命令について、当該変換命令に先立って実行される全ての実行パスにおいて、前記文字変数に前記第2の文字コード体系の文字が格納される場合に、当該変換命令を除去する変換命令除去部と して機能させるコンパイラプログラム。
  6. 17
    A compiler program that functions a computer as a compiler that optimizes the conversion of the character code system of characters stored in character variables in the target program to be optimized. The computer is written by the first character code system. As each of a plurality of processes for reading the character of the character variable and using the character in the second character code system, the process is performed when the character stored in the character variable is the second character code system. A character operation processing generator that executes and generates an instruction string with an exception that raises an exception when the character is the first character code system, and is executed when the exception occurs and stored in the character variable. Exception handler generator that converts the character to be executed from the first character code system to the second character code system, stores it in the character variable, and generates an exception handler that returns to the process that caused the exception. A compiler program that functions as. 最適化対象の対象プログラムにおいて文字変数に格納される文字の文字コード体系の変換を最適化するコンパイラとして、コンピュータを機能させるコンパイラプログラムであって、 前記コンピュータを、 第1の文字コード体系により書き込まれた文字変数の文字を読み出して第2の文字コード体系において当該文字を使用する複数の処理の各々として、前記文字変数に格納される文字が前記第2の文字コード体系である場合に当該処理を実行し、当該文字が前記第1の文字コード体系である場合に例外を発生させる例外付命令列を生成する文字操作処理生成部と、 前記例外が発生した場合に実行され、前記文字変数に格納される文字を前記第1の文字コード体系から前記第2の文字コード体系に変換して当該文字変数に格納し、前記例外を発生させた当該処理に復帰させる例外ハンドラを生成する例外ハンドラ生成部として機能させるコンパイラプログラム。
  7. 18
    A compiler program that makes a computer function as a compiler that optimizes the conversion process that converts the characters stored in character variables in the target program to be optimized from the first character code system to the second character code system. A plurality of the conversions to be executed by selecting and executing one of the acquisition processing generation unit for generating the instruction sequence of the processing for acquiring the character code of the character to be converted and the range of the value of the character code. A conversion detection processing generation unit that generates an instruction sequence that executes each of the processing and a detection processing that detects a range of the character code values in parallel, and a conversion processing process of any one of the plurality of conversion processes. A compiler program that functions as a selection process generator that generates an instruction sequence that selects and outputs the result based on the detection result of the detection process. 最適化対象の対象プログラムにおいて文字変数に格納される文字を第1の文字コード体系から第2の文字コード体系に変換する変換処理を最適化するコンパイラとして、コンピュータを機能させるコンパイラプログラムであって、 前記コンピュータを、 変換対象の文字の文字コードを取得する処理の命令列を生成する取得処理生成部と、 前記文字コードの値の範囲に応じて何れかを選択して実行すべき複数の前記変換処理の各々と、前記文字コードの値の範囲を検出する検出処理とを並行して実行する命令列を生成する変換検出処理生成部と、 前記複数の変換処理のうち何れかの変換処理の処理結果を、前記検出処理の検出結果に基づいて選択して出力する命令列を生成する選択処理生成部として機能させるコンパイラプログラム。
  8. 20
    This is a control method in which a computer controls a compiler that optimizes the conversion of the character code system of characters stored in character variables in the target program to be optimized, and is written by the computer by the first character code system. The character of the character variable is read out, and the character is converted from the first character code system to the second character code system prior to each of a plurality of processes using the character in the second character code system. In the conversion instruction generation stage for generating the conversion instruction to be stored in the character variable, and for each conversion instruction generated in the conversion instruction generation stage, the character variable is executed in all the execution paths prior to the conversion instruction. A control method including a conversion instruction removal step of removing the conversion instruction when the characters of the second character code system are stored in the second character code system. 最適化対象の対象プログラムにおいて文字変数に格納される文字の文字コード体系の変換を最適化するコンパイラを、コンピュータにより制御する制御方法であって、 前記コンピュータにより、 第1の文字コード体系により書き込まれた文字変数の文字を読み出して第2の文字コード体系において当該文字を使用する複数の処理の各々に先立って、当該文字を前記第1の文字コード体系から前記第2の文字コード体系に変換して当該文字変数に格納する変換命令を生成する変換命令生成段階と、 前記変換命令生成段階において生成された各変換命令について、当該変換命令に先立って実行される全ての実行パスにおいて、前記文字変数に前記第2の文字コード体系の文字が格納される場合に、当該変換命令を除去する変換命令除去段階と を備える制御方法。
  9. 21
    This is a control method in which a computer controls a compiler that optimizes the conversion process that converts the characters stored in the character variables in the target program to be optimized from the first character code system to the second character code system. The computer generates an instruction sequence for a process of acquiring the character code of the character to be converted, and a plurality of the conversions to be executed by selecting one according to the value range of the character code. A conversion detection process generation stage that generates an instruction sequence that executes each of the processes and a detection process that detects a range of the character code values in parallel, and a process of any of the plurality of conversion processes. A control method including a selection process generation step of generating an instruction sequence that selects and outputs a result based on the detection result of the detection process. 最適化対象の対象プログラムにおいて文字変数に格納される文字を第1の文字コード体系から第2の文字コード体系に変換する変換処理を最適化するコンパイラを、コンピュータにより制御する制御方法であって、 前記コンピュータにより、 変換対象の文字の文字コードを取得する処理の命令列を生成する取得処理生成段階と、 前記文字コードの値の範囲に応じて何れかを選択して実行すべき複数の前記変換処理の各々と、前記文字コードの値の範囲を検出する検出処理とを並行して実行する命令列を生成する変換検出処理生成段階と、 前記複数の変換処理のうち何れかの変換処理の処理結果を、前記検出処理の検出結果に基づいて選択して出力する命令列を生成する選択処理生成段階とを備える制御方法。