]> granicus.if.org Git - php/commitdiff
Use fastcall calling convention
authorDmitry Stogov <dmitry@zend.com>
Tue, 16 Jan 2018 07:33:41 +0000 (10:33 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 16 Jan 2018 07:33:41 +0000 (10:33 +0300)
Zend/zend_vm.h
Zend/zend_vm_execute.h
Zend/zend_vm_execute.skl
Zend/zend_vm_gen.php
Zend/zend_vm_opcodes.c
Zend/zend_vm_opcodes.h

index eed06a653ce331cbe85c960e57db552a5800cb63..ce0304e91016dc018d5503d9b4a8765a7e2eaec3 100644 (file)
 BEGIN_EXTERN_C()
 
 ZEND_API void zend_vm_use_old_executor(void);
-ZEND_API void zend_vm_set_opcode_handler(zend_op* opcode);
-ZEND_API void zend_vm_set_opcode_handler_ex(zend_op* opcode, uint32_t op1_info, uint32_t op2_info, uint32_t res_info);
-ZEND_API void zend_serialize_opcode_handler(zend_op *op);
-ZEND_API void zend_deserialize_opcode_handler(zend_op *op);
-ZEND_API const void *zend_get_opcode_handler_func(const zend_op *op);
+ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(zend_op* opcode);
+ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* opcode, uint32_t op1_info, uint32_t op2_info, uint32_t res_info);
+ZEND_API void ZEND_FASTCALL zend_serialize_opcode_handler(zend_op *op);
+ZEND_API void ZEND_FASTCALL zend_deserialize_opcode_handler(zend_op *op);
+ZEND_API const void* ZEND_FASTCALL zend_get_opcode_handler_func(const zend_op *op);
 ZEND_API const zend_op *zend_get_halt_op(void);
-ZEND_API int zend_vm_call_opcode_handler(zend_execute_data *ex);
+ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data *ex);
 ZEND_API int zend_vm_kind(void);
 
 END_EXTERN_C()
index 3845f454da182d4443e82551b4534bf0111c63de..18d10b0abff56a6d0d69174832b0add352749997 100644 (file)
@@ -66930,7 +66930,7 @@ static void init_opcode_serialiser(void)
        }
 }
 
-ZEND_API void zend_serialize_opcode_handler(zend_op *op)
+ZEND_API void ZEND_FASTCALL zend_serialize_opcode_handler(zend_op *op)
 {
        zval *zv;
 
@@ -66942,12 +66942,12 @@ ZEND_API void zend_serialize_opcode_handler(zend_op *op)
        op->handler = (const void *)(zend_uintptr_t)Z_LVAL_P(zv);
 }
 
-ZEND_API void zend_deserialize_opcode_handler(zend_op *op)
+ZEND_API void ZEND_FASTCALL zend_deserialize_opcode_handler(zend_op *op)
 {
        op->handler = zend_opcode_handlers[(zend_uintptr_t)op->handler];
 }
 
-ZEND_API const void *zend_get_opcode_handler_func(const zend_op *op)
+ZEND_API const void* ZEND_FASTCALL zend_get_opcode_handler_func(const zend_op *op)
 {
 #if ZEND_VM_KIND == ZEND_VM_KIND_CALL
        return op->handler;
@@ -67082,7 +67082,7 @@ static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend
 
 #endif
 
-ZEND_API void zend_vm_set_opcode_handler(zend_op* op)
+ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(zend_op* op)
 {
        uint32_t spec = zend_spec_handlers[op->opcode];
 
@@ -67094,7 +67094,7 @@ ZEND_API void zend_vm_set_opcode_handler(zend_op* op)
        op->handler = zend_vm_get_opcode_handler_ex(spec, op);
 }
 
-ZEND_API void zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t op1_info, uint32_t op2_info, uint32_t res_info)
+ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t op1_info, uint32_t op2_info, uint32_t res_info)
 {
        zend_uchar opcode = zend_user_opcodes[op->opcode];
        uint32_t spec = zend_spec_handlers[opcode];
@@ -67302,7 +67302,7 @@ ZEND_API void zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t op1_info, uint
        op->handler = zend_vm_get_opcode_handler_ex(spec, op);
 }
 
-ZEND_API int zend_vm_call_opcode_handler(zend_execute_data* ex)
+ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data* ex)
 {
 #if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)
        opcode_handler_t handler;
index 8eda5a48b042905f141a43ad1a3b1d654c0d4bb3..25809a90b30a56c790cbc41f1e36646ad4e06bf5 100644 (file)
@@ -66,7 +66,7 @@ static void init_opcode_serialiser(void)
        }
 }
 
-ZEND_API void zend_serialize_opcode_handler(zend_op *op)
+ZEND_API void ZEND_FASTCALL zend_serialize_opcode_handler(zend_op *op)
 {
        zval *zv;
 
@@ -78,12 +78,12 @@ ZEND_API void zend_serialize_opcode_handler(zend_op *op)
        op->handler = (const void *)(zend_uintptr_t)Z_LVAL_P(zv);
 }
 
-ZEND_API void zend_deserialize_opcode_handler(zend_op *op)
+ZEND_API void ZEND_FASTCALL zend_deserialize_opcode_handler(zend_op *op)
 {
        op->handler = zend_opcode_handlers[(zend_uintptr_t)op->handler];
 }
 
-ZEND_API const void *zend_get_opcode_handler_func(const zend_op *op)
+ZEND_API const void* ZEND_FASTCALL zend_get_opcode_handler_func(const zend_op *op)
 {
 #if ZEND_VM_KIND == ZEND_VM_KIND_CALL
        return op->handler;
index a5eb616ea465339d071a3d9d55e2a0a4984a9739..5d5f734a23ad964f575b3f3eff2890572ce61e48 100644 (file)
@@ -2348,8 +2348,8 @@ function gen_vm($def, $skel) {
        fputs($f, "#define ZEND_VM_OP2_FLAGS(flags) ((flags >> 8) & 0xff)\n");
        fputs($f, "\n");
        fputs($f, "BEGIN_EXTERN_C()\n\n");
-       fputs($f, "ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);\n");
-       fputs($f, "ZEND_API uint32_t zend_get_opcode_flags(zend_uchar opcode);\n\n");
+       fputs($f, "ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(zend_uchar opcode);\n");
+       fputs($f, "ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags(zend_uchar opcode);\n\n");
        fputs($f, "END_EXTERN_C()\n\n");
        
        foreach ($opcodes as $code => $dsc) {
@@ -2388,11 +2388,11 @@ function gen_vm($def, $skel) {
        }
        fputs($f, "};\n\n");
 
-       fputs($f, "ZEND_API const char* zend_get_opcode_name(zend_uchar opcode) {\n");
+       fputs($f, "ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(zend_uchar opcode) {\n");
        fputs($f, "\treturn zend_vm_opcodes_names[opcode];\n");
        fputs($f, "}\n");
 
-       fputs($f, "ZEND_API uint32_t zend_get_opcode_flags(zend_uchar opcode) {\n");
+       fputs($f, "ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags(zend_uchar opcode) {\n");
        fputs($f, "\treturn zend_vm_opcodes_flags[opcode];\n");
        fputs($f, "}\n");
     
@@ -2582,7 +2582,7 @@ function gen_vm($def, $skel) {
        }
 
        // Generate zend_vm_get_opcode_handler() function
-       out($f, "ZEND_API void zend_vm_set_opcode_handler(zend_op* op)\n");
+       out($f, "ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(zend_op* op)\n");
        out($f, "{\n");
        if (!ZEND_VM_SPEC) {
                out($f, "\top->handler = zend_vm_get_opcode_handler(op->opcode, op);\n");
@@ -2598,7 +2598,7 @@ function gen_vm($def, $skel) {
        out($f, "}\n\n");
 
        // Generate zend_vm_set_opcode_handler_ex() function
-       out($f, "ZEND_API void zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t op1_info, uint32_t op2_info, uint32_t res_info)\n");
+       out($f, "ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t op1_info, uint32_t op2_info, uint32_t res_info)\n");
        out($f, "{\n");
        out($f, "\tzend_uchar opcode = zend_user_opcodes[op->opcode];\n");
        if (!ZEND_VM_SPEC) {
@@ -2670,7 +2670,7 @@ function gen_vm($def, $skel) {
 
        // Generate zend_vm_call_opcode_handler() function
        if (ZEND_VM_KIND == ZEND_VM_KIND_CALL || ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) {
-               out($f, "ZEND_API int zend_vm_call_opcode_handler(zend_execute_data* ex)\n");
+               out($f, "ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data* ex)\n");
                out($f, "{\n");
                if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) {
                        out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
@@ -2722,7 +2722,7 @@ function gen_vm($def, $skel) {
                out($f, "\treturn ret;\n");
                out($f, "}\n\n");
        } else {
-               out($f, "ZEND_API int zend_vm_call_opcode_handler(zend_execute_data* ex)\n");
+               out($f, "ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data* ex)\n");
                out($f, "{\n");
                out($f, "\tzend_error_noreturn(E_CORE_ERROR, \"zend_vm_call_opcode_handler() is not supported\");\n");
                out($f, "\treturn 0;\n");
index 513792fd224c910017a0a79515da064352957f82..2464cc4eb8baf810ef27dea5be9455950770ad8e 100644 (file)
@@ -425,9 +425,9 @@ static uint32_t zend_vm_opcodes_flags[199] = {
        0x00000701,
 };
 
-ZEND_API const char* zend_get_opcode_name(zend_uchar opcode) {
+ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(zend_uchar opcode) {
        return zend_vm_opcodes_names[opcode];
 }
-ZEND_API uint32_t zend_get_opcode_flags(zend_uchar opcode) {
+ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags(zend_uchar opcode) {
        return zend_vm_opcodes_flags[opcode];
 }
index 2cf08ab3eac6a3aedda7df10e8be26182a99a698..f9603dfcb7a1dfe929dd382813134d19359ddd0a 100644 (file)
@@ -69,8 +69,8 @@
 
 BEGIN_EXTERN_C()
 
-ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);
-ZEND_API uint32_t zend_get_opcode_flags(zend_uchar opcode);
+ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(zend_uchar opcode);
+ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags(zend_uchar opcode);
 
 END_EXTERN_C()