Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JellyBrick committed Oct 21, 2019
1 parent fdc4bd8 commit f2d6db2
Show file tree
Hide file tree
Showing 31 changed files with 1,113 additions and 739 deletions.
Binary file modified .ci/zephir.phar
Binary file not shown.
32 changes: 11 additions & 21 deletions ext/kernel/array.c
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@

/*
+------------------------------------------------------------------------+
| Zephir Language |
+------------------------------------------------------------------------+
| Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file docs/LICENSE.txt. |
| |
| If you did not receive a copy of the license and are unable to |
| obtain it through the world-wide-web, please send an email |
| to [email protected] so we can send you a copy immediately. |
+------------------------------------------------------------------------+
| Authors: Andres Gutierrez <[email protected]> |
| Eduar Carvajal <[email protected]> |
| Vladimir Kolesnikov <[email protected]> |
+------------------------------------------------------------------------+
*/
* This file is part of the Zephir.
*
* (c) Zephir Team <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code. If you did not receive
* a copy of the license it is available through the world-wide-web at the
* following url: https://docs.zephir-lang.com/en/latest/license
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
Expand Down Expand Up @@ -205,7 +196,7 @@ int zephir_array_isset_string_fetch(zval *fetched, const zval *arr, char *index,
int zephir_array_isset_long_fetch(zval *fetched, const zval *arr, unsigned long index, int readonly)
{
zval *zv;

if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev((zval *)arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
zend_long ZEPHIR_LAST_CALL_STATUS;
zval exist, offset;
Expand Down Expand Up @@ -620,14 +611,13 @@ int zephir_array_fetch_long(zval *return_value, zval *arr, unsigned long index,
*/
void zephir_merge_append(zval *left, zval *values)
{
zval *tmp;

if (Z_TYPE_P(left) != IS_ARRAY) {
zend_error(E_NOTICE, "First parameter of zephir_merge_append must be an array");
return;
}

if (Z_TYPE_P(values) == IS_ARRAY) {
zval *tmp;

ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(values), tmp) {

Expand Down
27 changes: 9 additions & 18 deletions ext/kernel/array.h
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@

/*
+------------------------------------------------------------------------+
| Zephir Language |
+------------------------------------------------------------------------+
| Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file docs/LICENSE.txt. |
| |
| If you did not receive a copy of the license and are unable to |
| obtain it through the world-wide-web, please send an email |
| to [email protected] so we can send you a copy immediately. |
+------------------------------------------------------------------------+
| Authors: Andres Gutierrez <[email protected]> |
| Eduar Carvajal <[email protected]> |
| Vladimir Kolesnikov <[email protected]> |
+------------------------------------------------------------------------+
*/
* This file is part of the Zephir.
*
* (c) Zephir Team <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code. If you did not receive
* a copy of the license it is available through the world-wide-web at the
* following url: https://docs.zephir-lang.com/en/latest/license
*/

#ifndef ZEPHIR_KERNEL_ARRAY_H
#define ZEPHIR_KERNEL_ARRAY_H
Expand Down
6 changes: 6 additions & 0 deletions ext/kernel/fcall_internal.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* This file was generated automatically by Zephir.
* DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
*/

#ifndef ZEPHIR_KERNEL_FCALL_INTERNAL_H
#define ZEPHIR_KERNEL_FCALL_INTERNAL_H

#endif
18 changes: 12 additions & 6 deletions ext/kernel/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,26 @@ int zephir_fetch_parameters(int num_args, int required_args, int optional_args,
*/
int zephir_get_global(zval *arr, const char *global, unsigned int global_length)
{
zval *gv;
zend_array *symbol_table;
zend_bool jit_initialization = PG(auto_globals_jit);
zend_string *str = zend_string_init(global, global_length, 0);

if (jit_initialization) {
if (PG(auto_globals_jit)) {
zend_is_auto_global(str);
}

if (&EG(symbol_table)) {
zval *gv;

if ((gv = zend_hash_find_ind(&EG(symbol_table), str)) != NULL) {
ZVAL_DEREF(gv);
if (Z_TYPE_P(gv) == IS_ARRAY) {
ZVAL_DUP(arr, gv);
zend_hash_update(&EG(symbol_table), str, arr);
if (Z_REFCOUNTED_P(gv) && Z_REFCOUNT_P(gv) <= 1) {
ZVAL_COPY_VALUE(arr, gv);
} else {
ZVAL_DUP(arr, gv);
zend_hash_update(&EG(symbol_table), str, arr);
}

zend_string_release(str);
return SUCCESS;
}
Expand All @@ -114,9 +119,10 @@ int zephir_get_global(zval *arr, const char *global, unsigned int global_length)
} else {
symbol_table = &EG(symbol_table);
}
zend_hash_update(symbol_table, str, arr);

zend_hash_update(symbol_table, str, arr);
zend_string_release(str);

return FAILURE;
}

Expand Down
9 changes: 3 additions & 6 deletions ext/kernel/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,13 @@ static zend_always_inline zend_execute_data* find_symbol_table(zend_execute_data
*/
void ZEPHIR_FASTCALL zephir_memory_grow_stack(zephir_method_globals *g, const char *func)
{
zephir_memory_entry *entry;
if (g->active_memory == NULL) {
zephir_memory_entry *active_memory;
size_t i;

active_memory = (zephir_memory_entry *) pecalloc(1, sizeof(zephir_memory_entry), 0);

active_memory->addresses = pecalloc(24, sizeof(zval*), 0);
active_memory->capacity = 24;
active_memory->addresses = pecalloc(24, sizeof(zval*), 0);
active_memory->capacity = 24;

g->active_memory = active_memory;
}
Expand All @@ -74,7 +72,7 @@ void ZEPHIR_FASTCALL zephir_memory_grow_stack(zephir_method_globals *g, const ch
void ZEPHIR_FASTCALL zephir_memory_restore_stack(zephir_method_globals *g, const char *func)
{
size_t i;
zephir_memory_entry *prev, *active_memory;
zephir_memory_entry *active_memory;
zephir_symbol_table *active_symbol_table;
zval *ptr;
#ifndef ZEPHIR_RELEASE
Expand Down Expand Up @@ -200,7 +198,6 @@ void zephir_initialize_memory(zend_zephir_globals_def *zephir_globals_ptr)
*/
void zephir_deinitialize_memory()
{
size_t i;
zend_zephir_globals_def *zephir_globals_ptr = ZEPHIR_VGLOBAL;

if (zephir_globals_ptr->initialized != 1) {
Expand Down
2 changes: 1 addition & 1 deletion ext/kernel/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ int zephir_set_symbol_str(char *key_name, unsigned int key_length, zval *value);

#define ZEPHIR_SEPARATE_PARAM(z) \
do { \
zval *orig_ptr = z;\
zval *orig_ptr = z; \
ZEPHIR_SEPARATE(orig_ptr); \
/*zephir_memory_observe(orig_ptr);*/ \
} while (0)
Expand Down
2 changes: 1 addition & 1 deletion ext/php_rapidpm.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#define PHP_RAPIDPM_VERSION "0.0.5"
#define PHP_RAPIDPM_EXTNAME "rapidpm"
#define PHP_RAPIDPM_AUTHOR "Organization"
#define PHP_RAPIDPM_ZEPVERSION "0.12.9-$Id$"
#define PHP_RAPIDPM_ZEPVERSION "0.12.10-$Id$"
#define PHP_RAPIDPM_DESCRIPTION "Extension that implements parts of PocketMine-MP"


Expand Down
30 changes: 15 additions & 15 deletions ext/pocketmine/math/axisalignedbb.zep.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions ext/pocketmine/math/facing.zep.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f2d6db2

Please sign in to comment.