Skip to content

Commit

Permalink
Support JIT (#3907)
Browse files Browse the repository at this point in the history
  • Loading branch information
twose authored Dec 2, 2020
1 parent 75709bc commit dc7aa6a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ext-src/php_swoole_coroutine.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ struct PHPContext {
zend_vm_stack vm_stack;
size_t vm_stack_page_size;
zend_execute_data *execute_data;
#if PHP_VERSION_ID >= 80000
uint32_t jit_trace_num;
#endif
zend_error_handling_t error_handling;
zend_class_entry *exception_class;
zend_object *exception;
Expand Down
9 changes: 9 additions & 0 deletions ext-src/swoole_coroutine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@ inline void PHPCoroutine::save_vm_stack(PHPContext *task) {
task->vm_stack_page_size = EG(vm_stack_page_size);
#endif
task->execute_data = EG(current_execute_data);
#if PHP_VERSION_ID >= 80000
task->jit_trace_num = EG(jit_trace_num);
#endif
task->error_handling = EG(error_handling);
task->exception_class = EG(exception_class);
task->exception = EG(exception);
Expand Down Expand Up @@ -445,6 +448,9 @@ inline void PHPCoroutine::restore_vm_stack(PHPContext *task) {
EG(vm_stack_page_size) = task->vm_stack_page_size;
#endif
EG(current_execute_data) = task->execute_data;
#if PHP_VERSION_ID >= 80000
EG(jit_trace_num) = task->jit_trace_num;
#endif
EG(error_handling) = task->error_handling;
EG(exception_class) = task->exception_class;
EG(exception) = task->exception;
Expand Down Expand Up @@ -617,6 +623,9 @@ void PHPCoroutine::main_func(void *arg) {
EG(error_handling) = EH_NORMAL;
EG(exception_class) = nullptr;
EG(exception) = nullptr;
#if PHP_VERSION_ID >= 80000
EG(jit_trace_num) = 0;
#endif

task->output_ptr = nullptr;
#if PHP_VERSION_ID < 80100
Expand Down

0 comments on commit dc7aa6a

Please sign in to comment.