Skip to content

Commit 0346dee

Browse files
committed
Remove preload option
1 parent eab06ef commit 0346dee

4 files changed

Lines changed: 3 additions & 17 deletions

File tree

README-ja.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ $javaClass = new JavaClass(
301301
| max_stack_exceeded | integer | 9999 | オペレーションを最大何回実行できるかを指定します。 | JavaClass |
302302
| max_execution_time | integer | 30 | 最大実行時間を指定します。 | JavaClass |
303303
| strict | boolean | true | このオプションが `true` の場合、 PHPJava はメソッド、変数などを厳格に評価し実行します。 `false` の場合は、曖昧に評価して実行します。. | Both |
304-
| preload | boolean | false | このオプションが `true` の場合、 Jar 実行時に定義されている JavaClass を予めメモリ上にマッピング(プリロード)させることにより、処理速度が向上させます。ただし、この機能が有効である場合、 Jar が巨大であると メモリを多く消費します。また、それ以外の場合は、必要に応じてクラスを遅延ロードします。 | JavaArchive |
305304
| validation.method.arguments_count_only | boolean | false | このオプションが `true` の場合、 クラス解決をして、メソッドを呼び出す際に、引数の数のみを比較します。 | JavaClass |
306305
| operations.enable_trace | boolean | false | このオプションが `true` の場合、 PHPJava はオペレーションの実行ログを記録します。 | JavaClass |
307306
| operations.temporary_code_stream | string | php://memory | 実行用のバイトコードの一時保存先を指定します。 | JavaClass |

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ $javaClass = new JavaClass(
303303
| max_stack_exceeded | integer | 9999 | Execute more than the specified number of times be stopped the operation. | JavaClass |
304304
| max_execution_time | integer | 30 | Maximum execution time. | JavaClass |
305305
| strict | boolean | true | When `true`, PHPJava calls a method, variables, and so on strictly; otherwise, it calls them ambiguously. | Both |
306-
| preload | boolean | false | When `true`, PHPJava pre-reads JavaClasses when emulating JAR. This may consume larger size of memory depending on the size of the JAR file; otherwise, JavaArchive defers loading. | JavaArchive |
307306
| validation.method.arguments_count_only | boolean | false | When `true`, ClassResolver validates arguments by their number only. | JavaClass |
308307
| operations.enable_trace | boolean | false | When `true`, PHPJava stores the operation history. | JavaClass |
309308
| operations.temporary_code_stream | string | php://memory | Operation code will be output to temporary stream. Change this if your code is heavy so you'll be happy. | JavaClass |

src/Core/JVM/Parameters/Runtime.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ final class Runtime
1010
const MAX_STACK_EXCEEDED = 9999;
1111
const MAX_EXECUTION_TIME = 5;
1212
const STRICT = true;
13-
const PRELOAD = false;
1413
const DRY_RUN_ATTRIBUTE = false;
1514

1615
const OPERATIONS_ENABLE_TRACE = false;

src/Core/JavaArchive.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,9 @@ function ($fileName) {
102102
continue;
103103
}
104104
$classPath = str_replace('/', '.', $className);
105-
if (!($this->options['preload'] ?? GlobalOptions::get('preload') ?? Runtime::PRELOAD)) {
106-
$this->classes[$classPath] = new JavaClassDeferredLoader(
107-
InlineReader::class,
108-
[$className, $code],
109-
$this->options
110-
);
111-
continue;
112-
}
113-
114-
$this->classes[$classPath] = new JavaClass(
115-
new InlineReader(
116-
$className,
117-
$code
118-
),
105+
$this->classes[$classPath] = new JavaClassDeferredLoader(
106+
InlineReader::class,
107+
[$className, $code],
119108
$this->options
120109
);
121110
}

0 commit comments

Comments
 (0)