Releases: phpv8/php-v8
Add script compilation and caching
This release adds script compilation and caching. Also more new methods added and some internal logic refactored. See detailed changes below.
As of this release, V8 >= 5.8.168 required.
*
- BC-breaking or potentially BC-breaking changes
Changes to public API and other important changes which may affect end-user:
*
Add$is_wasm
and$is_module
options toV8\ScriptOriginOptions
andV8\ScriptOrigin
;*
Remove non-standardV8\Scrip::{getSource,getOrigin}
;*
RemoveV8\ObjectValue::{Get,Set,Has,Delete,CreateDataProperty}Indexed
methods;*
Remove non-workingV8\Context
extensions support;*
HandleV8\IntegerValue
sub-types when returning values from V8, fixes #19;- Add
V8\UnboundScript
class; - Add
V8\ScriptCompiler\CachedData
class; - Add
V8\ScriptCompiler\CompileOptions
class; - Add
V8\ScriptCompiler\Source
class; - Add
V8\ScriptCompiler
; - Add
V8\SymbolValue::GetToPrimitive()
method; - Add
V8\Value::IsNullOrUndefinedl()
method; - Add more
V8\Value::Is*()
methods; - Add
V8\MapObject
; - Add
V8\SetObject
; - Fix obj and func templates external memory adjusting.
Improvements and new methods
In this PR new methods added and some internal logic refactored.
As of this release, V8 >= 5.4.420 required.
Also, deprecated or soon to be deprecated API calls are removed in this release, see note on BC-breaking changes below.
- add
V8\Isolate::IsInUse()
method. - add
V8\AdjustableExternalMemoryInterface
interface; - add
V8\ObjectValue::AdjustExternalAllocatedMemory()
method; - add
V8\ObjectValue::GetExternalAllocatedMemory()
method; - add
V8\FunctionTemplate::AdjustExternalAllocatedMemory()
method; - add
V8\FunctionTemplate::GetExternalAllocatedMemory()
method; - add
V8\ObjectTemplate::AdjustExternalAllocatedMemory()
method; - add
V8\ObjectTemplate::GetExternalAllocatedMemory()
method; - rewrite callbacks structures to use std containers;
- use realistic external allocated memory value to notify isolate about based on callbacks structures size and optionally specified by user value.
- add
V8\Value::TypeOf()
method; - add
V8\ObjectValue::IsConstructor()
method; - add
V8\ObjectValue::SetIntegrityLevel()
method; - add
V8\CallbackInfo::InContext()
method; - add
V8\ReturnValue::InContext()
method; - add
V8\ReturnValue::Get()
method; - add
V8\HeapStatistics::malloced_memory()
method; - add
V8\HeapStatistics::peak_malloced_memory()
method; - properly shutdown in case of OOM;
- simplify
V8\ReturnValue
internals and integration with callbacks.
BC breaking changes:
- V8\ObjectValue::ForceSet() removed in a favor of V8\ObjectValue::DefineOwnProperty(), V8\ObjectValue::CreateDataProperty() and V8\ObjectValue::CreateDataPropertyIndex().
First release
This is a first public release.
PHP 7 only (>= 7.0), including PHP 7.1.
This release works best with V8 Google JavaScript engine version 5.2 installed. At this time extension tested using 5.2.371.
For Ubuntu there are pinepain/libv8-5.2 PPA. To install fresh libv8 do:
$ sudo add-apt-repository ppa:pinepain/libv8-5.2 -y
$ sudo apt-get update -q
$ sudo apt-get install -y libv8-5.2-dev
For OS X there are v8.rb homebrew formula. To install fresh libv8 do:
$ brew install https://raw.githubusercontent.com/pinepain/php-v8/v0.1.0/scripts/homebrew/v8.rb
No windows support at this time, though, there should be nothing preventing to add it except of getting how to properly package V8 itself for windows.