php-src/ext/opcache/zend_persist_calc.c

438 lines
13 KiB
C
Raw Normal View History

2013-02-13 12:26:47 +00:00
/*
+----------------------------------------------------------------------+
| Zend OPcache |
2013-02-13 12:26:47 +00:00
+----------------------------------------------------------------------+
| Copyright (c) 1998-2016 The PHP Group |
2013-02-13 12:26:47 +00:00
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Stanislav Malyshev <stas@zend.com> |
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
#include "zend.h"
#include "ZendAccelerator.h"
#include "zend_persist.h"
#include "zend_extensions.h"
#include "zend_shared_alloc.h"
#include "zend_operators.h"
#define ADD_DUP_SIZE(m,s) ZCG(current_persistent_script)->size += zend_shared_memdup_size((void*)m, s)
#define ADD_SIZE(m) ZCG(current_persistent_script)->size += ZEND_ALIGNED_SIZE(m)
#define ADD_ARENA_SIZE(m) ZCG(current_persistent_script)->arena_size += ZEND_ALIGNED_SIZE(m)
2013-02-13 12:26:47 +00:00
# define ADD_STRING(str) ADD_DUP_SIZE((str), _ZSTR_STRUCT_SIZE(ZSTR_LEN(str)))
2014-03-28 19:34:49 +00:00
# define ADD_INTERNED_STRING(str, do_free) do { \
if (ZCG(current_persistent_script)->corrupted) { \
ADD_STRING(str); \
} else if (!IS_ACCEL_INTERNED(str)) { \
2014-12-13 22:06:14 +00:00
zend_string *tmp = accel_new_interned_string(str); \
if (tmp != (str)) { \
2014-03-28 19:34:49 +00:00
if (do_free) { \
2014-08-25 17:24:55 +00:00
/*zend_string_release(str);*/ \
2014-03-28 19:34:49 +00:00
} \
(str) = tmp; \
} else { \
2014-03-28 19:34:49 +00:00
ADD_STRING(str); \
} \
2013-02-13 12:26:47 +00:00
} \
} while (0)
2014-12-13 22:06:14 +00:00
static void zend_persist_zval_calc(zval *z);
2013-02-13 12:26:47 +00:00
2014-12-13 22:06:14 +00:00
static void zend_hash_persist_calc(HashTable *ht, void (*pPersistElement)(zval *pElement))
2013-02-13 12:26:47 +00:00
{
uint idx;
Bucket *p;
2013-02-13 12:26:47 +00:00
2015-08-31 10:56:42 +00:00
if (!(ht->u.flags & HASH_FLAG_INITIALIZED) || ht->nNumUsed == 0) {
return;
}
2015-04-20 21:27:21 +00:00
if (!(ht->u.flags & HASH_FLAG_PACKED) && ht->nNumUsed < -(int32_t)ht->nTableMask / 2) {
/* compact table */
int32_t hash_size;
2015-04-20 21:27:21 +00:00
if (ht->nNumUsed <= HT_MIN_SIZE) {
hash_size = HT_MIN_SIZE;
} else {
hash_size = -(int32_t)ht->nTableMask;
while (hash_size >> 1 > ht->nNumUsed) {
hash_size >>= 1;
}
2015-08-31 10:56:42 +00:00
}
2015-04-20 21:27:21 +00:00
ADD_SIZE(hash_size * sizeof(uint32_t) + ht->nNumUsed * sizeof(Bucket));
} else {
ADD_SIZE(HT_USED_SIZE(ht));
}
for (idx = 0; idx < ht->nNumUsed; idx++) {
p = ht->arData + idx;
2014-03-28 19:34:49 +00:00
if (Z_TYPE(p->val) == IS_UNDEF) continue;
2013-02-13 12:26:47 +00:00
/* persist bucket and key */
2014-03-28 19:34:49 +00:00
if (p->key) {
zend_uchar flags = GC_FLAGS(p->key) & ~ (IS_STR_PERSISTENT | IS_STR_INTERNED | IS_STR_PERMANENT);
2014-03-28 19:34:49 +00:00
ADD_INTERNED_STRING(p->key, 1);
GC_FLAGS(p->key) |= flags;
2013-02-13 12:26:47 +00:00
}
2014-12-13 22:06:14 +00:00
pPersistElement(&p->val);
2013-02-13 12:26:47 +00:00
}
}
2014-12-13 22:06:14 +00:00
static void zend_persist_ast_calc(zend_ast *ast)
2013-11-06 18:21:07 +00:00
{
uint32_t i;
2013-11-06 18:21:07 +00:00
2014-08-15 20:02:53 +00:00
if (ast->kind == ZEND_AST_ZVAL) {
ADD_SIZE(sizeof(zend_ast_zval));
2014-12-13 22:06:14 +00:00
zend_persist_zval_calc(zend_ast_get_zval(ast));
2014-08-15 20:02:53 +00:00
} else if (zend_ast_is_list(ast)) {
zend_ast_list *list = zend_ast_get_list(ast);
2014-08-26 11:57:19 +00:00
ADD_SIZE(sizeof(zend_ast_list) - sizeof(zend_ast *) + sizeof(zend_ast *) * list->children);
2014-08-15 20:02:53 +00:00
for (i = 0; i < list->children; i++) {
if (list->child[i]) {
2014-12-13 22:06:14 +00:00
zend_persist_ast_calc(list->child[i]);
2014-08-15 20:02:53 +00:00
}
}
2013-11-06 18:21:07 +00:00
} else {
uint32_t children = zend_ast_get_num_children(ast);
2014-08-26 11:57:19 +00:00
ADD_SIZE(sizeof(zend_ast) - sizeof(zend_ast *) + sizeof(zend_ast *) * children);
2014-08-15 20:02:53 +00:00
for (i = 0; i < children; i++) {
if (ast->child[i]) {
2014-12-13 22:06:14 +00:00
zend_persist_ast_calc(ast->child[i]);
2013-11-06 18:21:07 +00:00
}
}
}
}
2014-12-13 22:06:14 +00:00
static void zend_persist_zval_calc(zval *z)
2013-02-13 12:26:47 +00:00
{
2014-04-01 08:20:16 +00:00
zend_uchar flags;
2014-03-28 19:34:49 +00:00
uint size;
2013-02-13 12:26:47 +00:00
switch (Z_TYPE_P(z)) {
2013-02-13 12:26:47 +00:00
case IS_STRING:
case IS_CONSTANT:
flags = Z_GC_FLAGS_P(z) & ~ (IS_STR_PERSISTENT | IS_STR_INTERNED | IS_STR_PERMANENT);
2014-03-28 19:34:49 +00:00
ADD_INTERNED_STRING(Z_STR_P(z), 0);
if (ZSTR_IS_INTERNED(Z_STR_P(z))) {
Z_TYPE_FLAGS_P(z) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
}
Z_GC_FLAGS_P(z) |= flags;
2013-02-13 12:26:47 +00:00
break;
case IS_ARRAY:
2014-03-28 19:34:49 +00:00
size = zend_shared_memdup_size(Z_ARR_P(z), sizeof(zend_array));
if (size) {
ADD_SIZE(size);
2014-12-13 22:06:14 +00:00
zend_hash_persist_calc(Z_ARRVAL_P(z), zend_persist_zval_calc);
2014-03-28 19:34:49 +00:00
}
2013-02-13 12:26:47 +00:00
break;
2014-03-28 19:34:49 +00:00
case IS_REFERENCE:
size = zend_shared_memdup_size(Z_REF_P(z), sizeof(zend_reference));
if (size) {
ADD_SIZE(size);
2014-12-13 22:06:14 +00:00
zend_persist_zval_calc(Z_REFVAL_P(z));
2014-03-28 19:34:49 +00:00
}
break;
2013-11-06 18:21:07 +00:00
case IS_CONSTANT_AST:
2014-03-28 19:34:49 +00:00
size = zend_shared_memdup_size(Z_AST_P(z), sizeof(zend_ast_ref));
if (size) {
ADD_SIZE(size);
2014-12-13 22:06:14 +00:00
zend_persist_ast_calc(Z_ASTVAL_P(z));
2014-03-28 19:34:49 +00:00
}
2013-11-06 18:21:07 +00:00
break;
2013-02-13 12:26:47 +00:00
}
}
2014-12-13 22:06:14 +00:00
static void zend_persist_op_array_calc_ex(zend_op_array *op_array)
2013-02-13 12:26:47 +00:00
{
if (op_array->type != ZEND_USER_FUNCTION) {
return;
2013-02-13 12:26:47 +00:00
}
2014-04-16 09:36:38 +00:00
if (op_array->static_variables) {
if (!zend_shared_alloc_get_xlat_entry(op_array->static_variables)) {
HashTable *old = op_array->static_variables;
ADD_DUP_SIZE(op_array->static_variables, sizeof(HashTable));
zend_hash_persist_calc(op_array->static_variables, zend_persist_zval_calc);
zend_shared_alloc_register_xlat_entry(old, op_array->static_variables);
}
2014-04-16 09:36:38 +00:00
}
if (zend_shared_alloc_get_xlat_entry(op_array->opcodes)) {
/* already stored */
if (op_array->function_name) {
zend_string *new_name = zend_shared_alloc_get_xlat_entry(op_array->function_name);
if (IS_ACCEL_INTERNED(new_name)) {
op_array->function_name = new_name;
}
}
return;
2013-02-13 12:26:47 +00:00
}
2014-04-16 09:36:38 +00:00
if (op_array->literals) {
zval *p = op_array->literals;
zval *end = p + op_array->last_literal;
ADD_DUP_SIZE(op_array->literals, sizeof(zval) * op_array->last_literal);
2013-02-13 12:26:47 +00:00
while (p < end) {
2014-12-13 22:06:14 +00:00
zend_persist_zval_calc(p);
2013-02-13 12:26:47 +00:00
p++;
}
}
2014-04-16 09:36:38 +00:00
ADD_DUP_SIZE(op_array->opcodes, sizeof(zend_op) * op_array->last);
2013-02-13 12:26:47 +00:00
if (op_array->function_name) {
zend_string *old_name = op_array->function_name;
zend_string *new_name = zend_shared_alloc_get_xlat_entry(old_name);
if (new_name) {
op_array->function_name = new_name;
} else {
ADD_INTERNED_STRING(op_array->function_name, 0);
zend_shared_alloc_register_xlat_entry(old_name, op_array->function_name);
}
2013-02-13 12:26:47 +00:00
}
2014-04-16 09:36:38 +00:00
if (op_array->filename) {
ADD_STRING(op_array->filename);
}
if (op_array->arg_info) {
zend_arg_info *arg_info = op_array->arg_info;
uint32_t num_args = op_array->num_args;
uint32_t i;
2013-02-13 12:26:47 +00:00
num_args = op_array->num_args;
if (op_array->fn_flags & ZEND_ACC_VARIADIC) {
num_args++;
}
if (op_array->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
arg_info--;
num_args++;
}
ADD_DUP_SIZE(arg_info, sizeof(zend_arg_info) * num_args);
for (i = 0; i < num_args; i++) {
if (arg_info[i].name) {
ADD_INTERNED_STRING(arg_info[i].name, 1);
2013-02-13 12:26:47 +00:00
}
if (arg_info[i].class_name) {
ADD_INTERNED_STRING(arg_info[i].class_name, 1);
2013-02-13 12:26:47 +00:00
}
}
}
if (op_array->live_range) {
ADD_DUP_SIZE(op_array->live_range, sizeof(zend_live_range) * op_array->last_live_range);
Squashed commit of the following: commit 03cf871f1576f08b2348c141b209894a7bf17a86 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:31 2015 +0300 Revert "Fixed bug #62210 (Exceptions can leak temporary variables. As a part of the fix serious refactoring was done. op_array->brk_cont_array was removed, and replaced with more general and speed efficient op_array->T_liveliness. ZEND_GOTO opcode is always replaced by ZEND_JMP at compile time). (Bob, Dmitry, Laruence)" This reverts commit 5ee841325901a4b040cfea56292a24702fe224d9. commit 285a68227ce3d380e821a24fa389aa5239bd3fe1 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:26 2015 +0300 Revert "Tuned off dubugging of live ranges" This reverts commit 404dc93d35f7061fc4b1b41ad6cb0721b9b52bcc. commit 93d9d11157301ee2ec99afb6f5744b126d17f637 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:17 2015 +0300 Revert "Remove loop_var_stack" This reverts commit b3a4c05071c3786e27e1326fa1b4d5acad62fccd. commit ede68ebbc284aec79e3f719f2c8dbf9da6907752 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:12 2015 +0300 Revert "ZEND_SEPARATE reuses temporaries" This reverts commit 1852f538b9f8d5e7d67fe5a4f6080396d8b10034. commit 96d8995dc1f517fb01b481736273767509f76c47 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:10 2015 +0300 Revert "Add assertion in liveliness computation" This reverts commit ed14019e8c0c852480eebc6fc552d8c3d939dce1. commit 0649d7bfef152e6cc8e67b922534e9946c634d9c Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:07 2015 +0300 Revert "Fixed invalid live-range detection" This reverts commit 54f367ee2a2e4cb7c952b17915c226fdc56038ab. commit dfe8f3851f6b04595eb089323e3492115a59363e Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:04 2015 +0300 Revert "Add test guaranteeing that loop vars are only freed after potential return type exceptions" This reverts commit f5db5a558d550bf441373febebbb02f3884209d1. commit 52a94aad6f48a199358cc07f7e4f56bb73050504 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:01 2015 +0300 Revert "Fixed exception habdling on "return" statement." This reverts commit 17c5315bdf8f8087979aeb55f6d3a512ba197cf5. commit 6e90ad7331901711e89c2ceb2bcab5023e5cee60 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:44:58 2015 +0300 Revert "Fix too early terminated temporary range with break/cont/goto" This reverts commit cc876c04b420589cb1f62b650d0c0e24975dd4af. commit 7b766e44b1970e4031f75109c302c07ead2c05cb Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:44:55 2015 +0300 Revert "Fixed exception catching on break/continue" This reverts commit 8c3f701eebfa92d761bb368cfa8c2d1ccf821b9d.
2015-07-10 00:31:52 +00:00
}
2013-02-22 06:56:05 +00:00
if (ZCG(accel_directives).save_comments && op_array->doc_comment) {
2014-03-28 19:34:49 +00:00
ADD_STRING(op_array->doc_comment);
2013-02-13 12:26:47 +00:00
}
2013-02-22 06:56:05 +00:00
if (op_array->try_catch_array) {
2013-02-13 12:26:47 +00:00
ADD_DUP_SIZE(op_array->try_catch_array, sizeof(zend_try_catch_element) * op_array->last_try_catch);
}
2014-04-16 09:36:38 +00:00
if (op_array->vars) {
2013-02-13 12:26:47 +00:00
int i;
2014-03-28 19:34:49 +00:00
ADD_DUP_SIZE(op_array->vars, sizeof(zend_string*) * op_array->last_var);
2013-02-22 06:56:05 +00:00
for (i = 0; i < op_array->last_var; i++) {
2014-03-28 19:34:49 +00:00
ADD_INTERNED_STRING(op_array->vars[i], 0);
2013-02-13 12:26:47 +00:00
}
}
ADD_SIZE(ZEND_ALIGNED_SIZE(zend_extensions_op_array_persist_calc(op_array)));
2013-02-13 12:26:47 +00:00
}
2014-12-13 22:06:14 +00:00
static void zend_persist_op_array_calc(zval *zv)
2013-02-13 12:26:47 +00:00
{
2015-03-05 11:23:48 +00:00
zend_op_array *op_array = Z_PTR_P(zv);
if (op_array->type == ZEND_USER_FUNCTION/* &&
(!op_array->refcount || *(op_array->refcount) > 1)*/) {
zend_op_array *old_op_array = zend_shared_alloc_get_xlat_entry(op_array);
if (old_op_array) {
Z_PTR_P(zv) = old_op_array;
} else {
ADD_ARENA_SIZE(sizeof(zend_op_array));
zend_persist_op_array_calc_ex(Z_PTR_P(zv));
zend_shared_alloc_register_xlat_entry(op_array, Z_PTR_P(zv));
}
} else {
ADD_ARENA_SIZE(sizeof(zend_op_array));
zend_persist_op_array_calc_ex(Z_PTR_P(zv));
}
2014-03-28 19:34:49 +00:00
}
2014-12-13 22:06:14 +00:00
static void zend_persist_property_info_calc(zval *zv)
2014-03-28 19:34:49 +00:00
{
zend_property_info *prop = Z_PTR_P(zv);
if (!zend_shared_alloc_get_xlat_entry(prop)) {
zend_shared_alloc_register_xlat_entry(prop, prop);
ADD_ARENA_SIZE(sizeof(zend_property_info));
ADD_INTERNED_STRING(prop->name, 0);
if (ZCG(accel_directives).save_comments && prop->doc_comment) {
ADD_STRING(prop->doc_comment);
}
2013-02-13 12:26:47 +00:00
}
}
static void zend_persist_class_constant_calc(zval *zv)
{
zend_class_constant *c = Z_PTR_P(zv);
if (!zend_shared_alloc_get_xlat_entry(c)) {
zend_shared_alloc_register_xlat_entry(c, c);
ADD_ARENA_SIZE(sizeof(zend_class_constant));
zend_persist_zval_calc(&c->value);
if (ZCG(accel_directives).save_comments && c->doc_comment) {
ADD_STRING(c->doc_comment);
}
}
}
2014-12-13 22:06:14 +00:00
static void zend_persist_class_entry_calc(zval *zv)
2013-02-13 12:26:47 +00:00
{
2014-03-28 19:34:49 +00:00
zend_class_entry *ce = Z_PTR_P(zv);
2013-02-13 12:26:47 +00:00
if (ce->type == ZEND_USER_CLASS) {
ADD_ARENA_SIZE(sizeof(zend_class_entry));
2014-03-28 19:34:49 +00:00
ADD_INTERNED_STRING(ce->name, 0);
2014-12-13 22:06:14 +00:00
zend_hash_persist_calc(&ce->function_table, zend_persist_op_array_calc);
2013-02-13 12:26:47 +00:00
if (ce->default_properties_table) {
int i;
ADD_SIZE(sizeof(zval) * ce->default_properties_count);
2013-02-13 12:26:47 +00:00
for (i = 0; i < ce->default_properties_count; i++) {
2014-12-13 22:06:14 +00:00
zend_persist_zval_calc(&ce->default_properties_table[i]);
2013-02-13 12:26:47 +00:00
}
}
if (ce->default_static_members_table) {
int i;
ADD_SIZE(sizeof(zval) * ce->default_static_members_count);
2013-02-13 12:26:47 +00:00
for (i = 0; i < ce->default_static_members_count; i++) {
2014-12-13 22:06:14 +00:00
zend_persist_zval_calc(&ce->default_static_members_table[i]);
2013-02-13 12:26:47 +00:00
}
}
zend_hash_persist_calc(&ce->constants_table, zend_persist_class_constant_calc);
2013-02-13 12:26:47 +00:00
if (ce->info.user.filename) {
ADD_STRING(ce->info.user.filename);
2013-02-13 12:26:47 +00:00
}
if (ZCG(accel_directives).save_comments && ce->info.user.doc_comment) {
ADD_STRING(ce->info.user.doc_comment);
2013-02-13 12:26:47 +00:00
}
2014-12-13 22:06:14 +00:00
zend_hash_persist_calc(&ce->properties_info, zend_persist_property_info_calc);
2013-02-13 12:26:47 +00:00
if (ce->trait_aliases) {
int i = 0;
while (ce->trait_aliases[i]) {
if (ce->trait_aliases[i]->trait_method) {
if (ce->trait_aliases[i]->trait_method->method_name) {
2014-03-28 19:34:49 +00:00
ADD_INTERNED_STRING(ce->trait_aliases[i]->trait_method->method_name, 0);
2013-02-13 12:26:47 +00:00
}
if (ce->trait_aliases[i]->trait_method->class_name) {
2014-03-28 19:34:49 +00:00
ADD_INTERNED_STRING(ce->trait_aliases[i]->trait_method->class_name, 0);
2013-02-13 12:26:47 +00:00
}
ADD_SIZE(sizeof(zend_trait_method_reference));
}
if (ce->trait_aliases[i]->alias) {
2014-03-28 19:34:49 +00:00
ADD_INTERNED_STRING(ce->trait_aliases[i]->alias, 0);
2013-02-13 12:26:47 +00:00
}
ADD_SIZE(sizeof(zend_trait_alias));
i++;
}
ADD_SIZE(sizeof(zend_trait_alias*) * (i + 1));
}
if (ce->trait_precedences) {
int i = 0;
while (ce->trait_precedences[i]) {
2014-03-28 19:34:49 +00:00
ADD_INTERNED_STRING(ce->trait_precedences[i]->trait_method->method_name, 0);
ADD_INTERNED_STRING(ce->trait_precedences[i]->trait_method->class_name, 0);
2013-02-13 12:26:47 +00:00
ADD_SIZE(sizeof(zend_trait_method_reference));
if (ce->trait_precedences[i]->exclude_from_classes) {
int j = 0;
2014-03-28 19:34:49 +00:00
while (ce->trait_precedences[i]->exclude_from_classes[j].class_name) {
ADD_INTERNED_STRING(ce->trait_precedences[i]->exclude_from_classes[j].class_name, 0);
2013-02-13 12:26:47 +00:00
j++;
}
2013-02-22 06:56:05 +00:00
ADD_SIZE(sizeof(zend_class_entry*) * (j + 1));
2013-02-13 12:26:47 +00:00
}
ADD_SIZE(sizeof(zend_trait_precedence));
i++;
}
2013-02-22 06:56:05 +00:00
ADD_SIZE(sizeof(zend_trait_precedence*) * (i + 1));
2013-02-13 12:26:47 +00:00
}
}
}
2014-12-13 22:06:14 +00:00
static void zend_accel_persist_class_table_calc(HashTable *class_table)
2013-02-13 12:26:47 +00:00
{
2014-12-13 22:06:14 +00:00
zend_hash_persist_calc(class_table, zend_persist_class_entry_calc);
2013-02-13 12:26:47 +00:00
}
2014-12-13 22:06:14 +00:00
uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, char *key, unsigned int key_length)
2013-02-13 12:26:47 +00:00
{
new_persistent_script->mem = NULL;
new_persistent_script->size = 0;
new_persistent_script->arena_mem = NULL;
new_persistent_script->arena_size = 0;
new_persistent_script->corrupted = 0;
ZCG(current_persistent_script) = new_persistent_script;
2013-02-13 12:26:47 +00:00
ADD_DUP_SIZE(new_persistent_script, sizeof(zend_persistent_script));
2015-03-06 08:00:19 +00:00
if (key) {
ADD_DUP_SIZE(key, key_length + 1);
} else {
/* script is not going to be saved in SHM */
new_persistent_script->corrupted = 1;
2015-03-06 08:00:19 +00:00
}
ADD_STRING(new_persistent_script->script.filename);
2013-02-13 12:26:47 +00:00
#ifdef __SSE2__
/* Align size to 64-byte boundary */
new_persistent_script->size = (new_persistent_script->size + 63) & ~63;
#endif
zend_accel_persist_class_table_calc(&new_persistent_script->script.class_table);
zend_hash_persist_calc(&new_persistent_script->script.function_table, zend_persist_op_array_calc);
zend_persist_op_array_calc_ex(&new_persistent_script->script.main_op_array);
#ifdef __SSE2__
/* Align size to 64-byte boundary */
new_persistent_script->arena_size = (new_persistent_script->arena_size + 63) & ~63;
#endif
new_persistent_script->size += new_persistent_script->arena_size;
new_persistent_script->corrupted = 0;
ZCG(current_persistent_script) = NULL;
return new_persistent_script->size;
2013-02-13 12:26:47 +00:00
}