[php-src] jit-arm64: Support ZEND_JIT_ON_PROF_REQUEST mode
| From: | Hao Sun | Date: | Tue, 27 Apr 2021 09:47:14 +0000 |
| Subject: | [php-src] jit-arm64: Support ZEND_JIT_ON_PROF_REQUEST mode | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-115869@lists.php.net to get a copy of this message | ||
Author: Hao Sun (shqking)
Date: 2021-04-27T09:46:42Z
Commit: https://github.com/php/php-src/commit/d6b468fe638d5f339bf425ec08d871e307e44326
Raw diff: https://github.com/php/php-src/commit/d6b468fe638d5f339bf425ec08d871e307e44326.diff
Support ZEND_JIT_ON_PROF_REQUEST mode
This patch implements function zend_jit_hybrid_profile_jit_stub(), which
is needed by ZEND_JIT_ON_PROF_REQUEST mode, i.e. 'opcache.jit=122x'.
Change-Id: Icb591c81675ffc077180229362882278ac8406c6
Changed paths:
M ext/opcache/jit/zend_jit_arm64.dasc
Diff:
diff --git a/ext/opcache/jit/zend_jit_arm64.dasc b/ext/opcache/jit/zend_jit_arm64.dasc
index deb0fac77094..a34ae5a8ccf5 100644
--- a/ext/opcache/jit/zend_jit_arm64.dasc
+++ b/ext/opcache/jit/zend_jit_arm64.dasc
@@ -1989,7 +1989,25 @@ static int zend_jit_hybrid_profile_jit_stub(dasm_State **Dst)
}
|->hybrid_profile_jit:
- | NIY_STUB // TODO
+ | // ++zend_jit_profile_counter;
+ | LOAD_ADDR REG0, &zend_jit_profile_counter
+ | ldr TMP1, [REG0]
+ | add TMP1, TMP1, #1
+ | str TMP1, [REG0]
+ | // op_array = (zend_op_array*)EX(func);
+ | ldr REG0, EX->func
+ | // run_time_cache = EX(run_time_cache);
+ | ldr REG2, EX->run_time_cache
+ | // jit_extension = (const void*)ZEND_FUNC_INFO(op_array);
+ | ldr REG0, [REG0, #offsetof(zend_op_array, reserved[zend_func_info_rid])]
+ | // ++ZEND_COUNTER_INFO(op_array)
+ | LOAD_32BIT_VAL TMP1w, (zend_jit_profile_counter_rid * sizeof(void*))
+ | ldr TMP2, [REG2, TMP1]
+ | add TMP2, TMP2, #1
+ | str TMP2, [REG2, TMP1]
+ | // return ((zend_vm_opcode_handler_t)jit_extension->orig_handler)()
+ | ldr TMP1, [REG0, #offsetof(zend_jit_op_array_extension, orig_handler)]
+ | br TMP1
return 1;
}