Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

Commit eaf692f

Browse files
committed
Add ScriptCompiler::OPTION_EAGER_COMPILE option
v8/v8@c5eb79e
1 parent 950991f commit eaf692f

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

‎src/php_v8_script_compiler.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ PHP_MINIT_FUNCTION(php_v8_script_compiler)
354354
zend_declare_class_constant_long(this_ce, ZEND_STRL("OPTION_PRODUCE_CODE_CACHE"), static_cast<zend_long>(v8::ScriptCompiler::CompileOptions::kProduceCodeCache));
355355
zend_declare_class_constant_long(this_ce, ZEND_STRL("OPTION_PRODUCE_FULL_CODE_CACHE"), static_cast<zend_long>(v8::ScriptCompiler::CompileOptions::kProduceFullCodeCache));
356356
zend_declare_class_constant_long(this_ce, ZEND_STRL("OPTION_CONSUME_CODE_CACHE"), static_cast<zend_long>(v8::ScriptCompiler::CompileOptions::kConsumeCodeCache));
357+
zend_declare_class_constant_long(this_ce, ZEND_STRL("OPTION_EAGER_COMPILE"), static_cast<zend_long>(v8::ScriptCompiler::CompileOptions::kEagerCompile));
357358

358359
return SUCCESS;
359360
}

‎src/php_v8_script_compiler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ extern "C" {
2727
extern zend_class_entry *php_v8_script_compiler_class_entry;
2828

2929
#define PHP_V8_CHECK_COMPILER_OPTIONS_RANGE(options, message) \
30-
if (options < static_cast<zend_long>(v8::ScriptCompiler::CompileOptions::kNoCompileOptions) \
31-
|| options > static_cast<zend_long>(v8::ScriptCompiler::CompileOptions::kConsumeCodeCache)) { \
30+
if ((options) < static_cast<zend_long>(v8::ScriptCompiler::CompileOptions::kNoCompileOptions) \
31+
|| (options) > static_cast<zend_long>(v8::ScriptCompiler::CompileOptions::kEagerCompile)) { \
3232
PHP_V8_THROW_VALUE_EXCEPTION(message); \
3333
return; \
3434
}

‎stubs/src/ScriptCompiler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class ScriptCompiler
3131
const OPTION_PRODUCE_CODE_CACHE = 3;
3232
const OPTION_PRODUCE_FULL_CODE_CACHE = 4;
3333
const OPTION_CONSUME_CODE_CACHE = 5;
34+
const OPTION_EAGER_COMPILE = 6;
3435

3536
private function __construct()
3637
{

‎tests/001-verify_extension_entities.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ class V8\ScriptCompiler
411411
const OPTION_PRODUCE_CODE_CACHE = 3
412412
const OPTION_PRODUCE_FULL_CODE_CACHE = 4
413413
const OPTION_CONSUME_CODE_CACHE = 5
414+
const OPTION_EAGER_COMPILE = 6
414415
public static function getCachedDataVersionTag(): float
415416
public static function compileUnboundScript(V8\Context $context, V8\ScriptCompiler\Source $source, int $options): V8\UnboundScript
416417
public static function compile(V8\Context $context, V8\ScriptCompiler\Source $source, int $options): V8\Script

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /