Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

Commit fb3482c

Browse files
authored
Merge pull request #50 from pinepain/update-to-v8-63
Upgrade to libv8-6.3
2 parents 67fa362 + 74ce3ed commit fb3482c

File tree

162 files changed

+413
-232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+413
-232
lines changed

.travis.yml

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,22 @@
1-
sudo: required
21
dist: trusty
2+
sudo: required
33

4-
language: php
5-
6-
php:
7-
- 7.1
8-
- nightly
9-
10-
matrix:
11-
allow_failures:
12-
- php: nightly
4+
services:
5+
- docker
136

147
env:
158
global:
16-
- NO_INTERACTION=1
17-
- TEST_TIMEOUT=120
9+
- V8=6.3
1810
matrix:
19-
- V8=6.2
20-
- V8=6.2 TEST_PHP_ARGS=-m
11+
- TAG=xenial-v8-63-php-71
12+
- TAG=xenial-v8-63-php-71 TEST_PHP_ARGS=-m
13+
- TAG=xenial-v8-63-php-72
14+
- TAG=xenial-v8-63-php-72 TEST_PHP_ARGS=-m
2115

2216
before_install:
23-
- sudo add-apt-repository ppa:pinepain/libv8-${V8} -y
24-
- sudo apt-get update -q
25-
- sudo apt-get install -y libv8-${V8}-dev
26-
- php -i
27-
- php-config || true
28-
29-
before_script:
30-
- echo 'variables_order = "EGPCS"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
31-
- phpize && ./configure && make
17+
# docker on travis doesn't allow anything before FROM, let's fix that
18+
- sed -i -e "s/\${TAG}/$TAG/g" Dockerfile && sed -i -e '1,2d' Dockerfile
19+
- docker build -t ${TRAVIS_REPO_SLUG}:${V8}-${PHP} --build-arg TAG=${TAG} .
3220

3321
script:
34-
- sh -c "make test | tee result.txt"
35-
- sh test-report.sh
36-
37-
addons:
38-
apt:
39-
packages:
40-
- valgrind
22+
- docker run -e TEST_PHP_ARGS ${TRAVIS_REPO_SLUG}:${V8}-${PHP} bash -c "make test | tee result.txt; ./test-report.sh"

.valgrind-docker.supp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
<docker_specific_report>
3+
Memcheck:Free
4+
fun:free
5+
fun:deallocate
6+
fun:deallocate
7+
fun:_M_destroy
8+
fun:_M_dispose
9+
fun:~basic_string
10+
...
11+
}

.valgrind-v8.supp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
<suppress_false_positive_warning_see_v8_issue_6566>
3+
Memcheck:Cond
4+
fun:_ZN2v88internal20MarkCompactCollector20EmptyMarkingWorklistEv
5+
...
6+
}

.valgrindrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--gen-suppressions=all
2+
--suppressions=./.valgrind-v8.supp
3+
--suppressions=./.valgrind-docker.supp

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ project(php-v8)
33

44
# NOTE: This CMake file is just for syntax highlighting in CLion
55

6-
include_directories(/usr/local/opt/v8@6.2/include)
7-
include_directories(/usr/local/opt/v8@6.2/include/libplatform)
6+
include_directories(/usr/local/opt/v8@6.3/include)
7+
include_directories(/usr/local/opt/v8@6.3/include/libplatform)
88

99
include_directories(/usr/local/include/php)
1010
include_directories(/usr/local/include/php/TSRM)

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
ARG TAG=xenial-v8-63-php-72
2+
3+
FROM pinepain/php-v8-docker:${TAG}
4+
5+
COPY . /root/php-v8
6+
COPY ./scripts/provision/.bashrc /root/.bashrc
7+
8+
WORKDIR /root/php-v8
9+
10+
RUN php -i && php-config || true
11+
12+
RUN phpize && ./configure && make

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ $source = new \V8\StringValue($isolate, "'Hello' + ', World!'");
4848
$script = new \V8\Script($context, $source);
4949
$result = $script->run($context);
5050

51-
echo $result->toString($context)->value(), PHP_EOL;
51+
echo $result->value(), PHP_EOL;
5252
```
5353

5454
which will output `Hello, World!`. See how it's shorter and more readable than [that C++ version][v8-hello-world]?
@@ -69,7 +69,7 @@ in your IDE and other code-analysis tools.
6969
### Requirements
7070

7171
#### V8
72-
You will need a recent v8 Google JavaScript engine version installed. At this time the extension is tested on 6.2.2.
72+
You will need a recent v8 Google JavaScript engine version installed. At this time v8 >= 6.3.2 required.
7373

7474
#### PHP
7575
This extension is PHP7-only. It works and tested with both PHP 7.0 and PHP 7.1.
@@ -92,7 +92,7 @@ $ php --ri v8
9292

9393
While [pinepain/php](https://launchpad.net/~pinepain/+archive/ubuntu/php) PPA targets to contain all necessary
9494
extensions with dependencies, you may find
95-
[pinepain/libv8-6.2](https://launchpad.net/~pinepain/+archive/ubuntu/libv8-6.2),
95+
[pinepain/libv8-6.3](https://launchpad.net/~pinepain/+archive/ubuntu/libv8-6.3),
9696
[pinepain/libv8-experimental](https://launchpad.net/~pinepain/+archive/ubuntu/libv8-experimental) and
9797
[pinepain/php-v8](https://launchpad.net/~pinepain/+archive/ubuntu/php-v8) standalone PPAs useful.
9898

config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if test "$PHP_V8" != "no"; then
1919
SEARCH_PATH="/usr/local /usr"
2020
SEARCH_FOR="include/v8.h"
2121

22-
V8_MIN_API_VERSION_STR=6.2.2
22+
V8_MIN_API_VERSION_STR=6.3.2
2323

2424
DESIRED_V8_VERSION=`echo "${V8_MIN_API_VERSION_STR}" | $AWK 'BEGIN { FS = "."; } { printf "%s.%s", [$]1, [$]2;}'`
2525

scripts/provision/provision.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ echo Provisioning...
55
# Add Ondřej Surý's PPA with co-installable PHP versions:
66
sudo add-apt-repository -y ppa:ondrej/php
77
# Add libv8 PPA:
8-
sudo add-apt-repository ppa:pinepain/libv8-6.2
8+
sudo add-apt-repository ppa:pinepain/libv8-6.3
99

1010
# Let's update packages list:
1111
sudo apt-get update
@@ -19,7 +19,7 @@ sudo apt-get install -y git htop curl pkgconf
1919

2020

2121
# Build and development requirements
22-
sudo apt-get install -y libv8-6.2 libv8-6.2-dev libv8-6.2-dbg
22+
sudo apt-get install -y libv8-6.3 libv8-6.3-dev libv8-6.3-dbg
2323
sudo apt-get install -y dh-make valgrind
2424
sudo apt-get install -y libssl-dev openssl
2525
sudo apt-get install -y php7.1 php7.1-cli php7.1-dev php7.1-fpm

scripts/test_v8/hello_world.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ int main(int argc, char* argv[]) {
7878
Local<Value> result = script->Run();
7979

8080
// Convert the result to an UTF8 string and print it.
81-
String::Utf8Value utf8(result);
81+
String::Utf8Value utf8(isolate, result);
8282
printf("%s\n", *utf8);
8383
}
8484

0 commit comments

Comments
 (0)