Skip to content

Fix typos in opcache code comments, tests #7794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ext/opcache/ZendAccelerator.c
Original file line number Diff line number Diff line change
Expand Up @@ -2349,7 +2349,7 @@ static zend_class_entry* zend_accel_inheritance_cache_add(zend_class_entry *ce,
zend_map_ptr_extend(ZCSG(map_ptr_last));
return entry->ce;
}
ZEND_ASSERT(0); // entry = entry->next; // This shouldn't be posible ???
ZEND_ASSERT(0); // entry = entry->next; // This shouldn't be possible ???
}
}

Expand Down Expand Up @@ -3515,7 +3515,7 @@ static void preload_restart(void)
}

static size_t preload_try_strip_filename(zend_string *filename) {
/*FIXME: better way to hanlde eval()'d code? see COMPILED_STRING_DESCRIPTION_FORMAT */
/*FIXME: better way to handle eval()'d code? see COMPILED_STRING_DESCRIPTION_FORMAT */
if (ZSTR_LEN(filename) > sizeof(" eval()'d code")
&& *(ZSTR_VAL(filename) + ZSTR_LEN(filename) - sizeof(" eval()'d code")) == ':') {
const char *cfilename = ZSTR_VAL(filename);
Expand Down
4 changes: 2 additions & 2 deletions ext/opcache/jit/vtune/jitprofiling.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ typedef enum _iJIT_IsProfilingActiveFlags
*/
typedef struct _LineNumberInfo
{
unsigned int Offset; /**<\brief Offset from the begining of the code region. */
unsigned int Offset; /**<\brief Offset from the beginning of the code region. */
unsigned int LineNumber; /**<\brief Matching source line number offset (from beginning of source file). */

} *pLineNumberInfo, LineNumberInfo;
Expand Down Expand Up @@ -670,7 +670,7 @@ unsigned int JITAPI iJIT_GetNewMethodID(void);
iJIT_IsProfilingActiveFlags JITAPI iJIT_IsProfilingActive(void);

/**
* @brief Reports infomation about JIT-compiled code to the agent.
* @brief Reports information about JIT-compiled code to the agent.
*
* The reported information is used to attribute samples obtained from any
* Intel(R) VTune(TM) Amplifier collector. This API needs to be called
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/jit/zend_jit.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
#define ZEND_JIT_DEBUG_TRACE_TSSA (1<<19)
#define ZEND_JIT_DEBUG_TRACE_EXIT_INFO (1<<20)

#define ZEND_JIT_DEBUG_PERSISTENT 0x1f0 /* profile and debbuger flags can't be changed at run-time */
#define ZEND_JIT_DEBUG_PERSISTENT 0x1f0 /* profile and debugger flags can't be changed at run-time */

#define ZEND_JIT_TRACE_MAX_LENGTH 1024 /* max length of single trace */
#define ZEND_JIT_TRACE_MAX_EXITS 512 /* max number of side exits per trace */
Expand Down
44 changes: 22 additions & 22 deletions ext/opcache/jit/zend_jit_arm64.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ static bool logical_immediate_p(uint64_t value, uint32_t reg_size)
| // In x64, if the range of this LONG value can be represented via INT type, only move the low 32 bits into dst_addr.
| // Note that imm32 is signed extended to 64 bits during mov.
| // In aarch64, we choose to handle both cases in the same way. Even though 4 mov's are used for 64-bit value and 2 mov's are
| // needed for 32-bit value, an extra ext insn is needed for 32-bit vlaue.
| // needed for 32-bit value, an extra ext insn is needed for 32-bit value.
| SET_ZVAL_LVAL dst_addr, Z_LVAL_P(zv), Rx(tmp_reg1), Rx(tmp_reg2)
|| }
|| }
Expand Down Expand Up @@ -1794,7 +1794,7 @@ static int zend_jit_interrupt_handler_stub(dasm_State **Dst)
| ldp x29, x30, [sp], # SPAD // stack alignment
| JMP_IP TMP1
} else {
| ldp FP, RX, T2 // retore FP and IP
| ldp FP, RX, T2 // restore FP and IP
| ldp x29, x30, [sp], # NR_SPAD // stack alignment
| mov RETVALx, #1 // ZEND_VM_ENTER
| ret
Expand All @@ -1821,7 +1821,7 @@ static int zend_jit_exception_handler_stub(dasm_State **Dst)
} else {
| mov FCARG1x, FP
| EXT_CALL handler, REG0
| ldp FP, RX, T2 // retore FP and IP
| ldp FP, RX, T2 // restore FP and IP
| ldp x29, x30, [sp], # NR_SPAD // stack alignment
| tbnz RETVALw, #31, >1
| mov RETVALw, #1 // ZEND_VM_ENTER
Expand Down Expand Up @@ -1909,7 +1909,7 @@ static int zend_jit_leave_function_stub(dasm_State **Dst)
| ldp x29, x30, [sp], # SPAD // stack alignment
} else {
| mov FCARG2x, FP
| ldp FP, RX, T2 // retore FP and IP
| ldp FP, RX, T2 // restore FP and IP
| ldp x29, x30, [sp], # NR_SPAD // stack alignment
}
| TST_32_WITH_CONST FCARG1w, ZEND_CALL_TOP, TMP1w
Expand Down Expand Up @@ -1947,7 +1947,7 @@ static int zend_jit_leave_throw_stub(dasm_State **Dst)
|5:
| // opline = EG(exception_op);
| LOAD_IP_ADDR_ZTS executor_globals, exception_op, TMP2
| ldp FP, RX, T2 // retore FP and IP
| ldp FP, RX, T2 // restore FP and IP
| ldp x29, x30, [sp], # NR_SPAD // stack alignment
| mov RETVALx, #2 // ZEND_VM_LEAVE
| ret
Expand Down Expand Up @@ -2418,7 +2418,7 @@ static int zend_jit_trace_halt_stub(dasm_State **Dst)
| mov IP, xzr // PC must be zero
| ret
} else {
| ldp FP, RX, T2 // retore FP and IP
| ldp FP, RX, T2 // restore FP and IP
| ldp x29, x30, [sp], # NR_SPAD // stack alignment
| movn RETVALx, #0 // ZEND_VM_RETURN (-1)
| ret
Expand Down Expand Up @@ -2492,7 +2492,7 @@ static int zend_jit_trace_exit_stub(dasm_State **Dst)
| ldp x29, x30, [sp], # SPAD // stack alignment
| JMP_IP TMP1
} else {
| ldp FP, RX, T2 // retore FP and IP
| ldp FP, RX, T2 // restore FP and IP
| ldp x29, x30, [sp], # NR_SPAD // stack alignment
| mov RETVALx, #1 // ZEND_VM_ENTER
| ret
Expand Down Expand Up @@ -2536,7 +2536,7 @@ static int zend_jit_trace_exit_stub(dasm_State **Dst)
| tst RETVALw, RETVALw
| blt ->trace_halt
|
| ldp FP, RX, T2 // retore FP and IP
| ldp FP, RX, T2 // restore FP and IP
| ldp x29, x30, [sp], # NR_SPAD // stack alignment
| mov RETVALx, #1 // ZEND_VM_ENTER
| ret
Expand All @@ -2556,7 +2556,7 @@ static int zend_jit_trace_escape_stub(dasm_State **Dst)
| ldp x29, x30, [sp], # SPAD // stack alignment
| JMP_IP, TMP1
} else {
| ldp FP, RX, T2 // retore FP and IP
| ldp FP, RX, T2 // restore FP and IP
| ldp x29, x30, [sp], # NR_SPAD // stack alignment
| mov RETVALx, #1 // ZEND_VM_ENTER
| ret
Expand Down Expand Up @@ -3038,7 +3038,7 @@ static int zend_jit_patch(const void *code, size_t size, uint32_t jmp_table_size
if (((ins ^ (uint32_t)delta) & 0x01ffffffu) == 0) {
delta = (uint32_t*)to_addr - ins_ptr;
if (((delta + 0x02000000) >> 26) != 0) {
abort(); // brnach target out of range
abort(); // branch target out of range
}
*ins_ptr = (ins & 0xfc000000u) | ((uint32_t)delta & 0x03ffffffu);
ret++;
Expand All @@ -3056,10 +3056,10 @@ static int zend_jit_patch(const void *code, size_t size, uint32_t jmp_table_size
if (veneer) {
delta = (uint32_t*)veneer - ins_ptr;
if (((delta + 0x40000) >> 19) != 0) {
abort(); // brnach target out of range
abort(); // branch target out of range
}
} else {
abort(); // brnach target out of range
abort(); // branch target out of range
}
}
*ins_ptr = (ins & 0xff00001fu) | (((uint32_t)delta & 0x7ffffu) << 5);
Expand All @@ -3074,10 +3074,10 @@ static int zend_jit_patch(const void *code, size_t size, uint32_t jmp_table_size
if (veneer) {
delta = (uint32_t*)veneer - ins_ptr;
if (((delta + 0x2000) >> 14) != 0) {
abort(); // brnach target out of range
abort(); // branch target out of range
}
} else {
abort(); // brnach target out of range
abort(); // branch target out of range
}
}
*ins_ptr = (ins & 0xfff8001fu) | (((uint32_t)delta & 0x3fffu) << 5);
Expand Down Expand Up @@ -3169,7 +3169,7 @@ static int zend_jit_trace_return(dasm_State **Dst, bool original_handler, const
| ldr REG0, [IP, REG0]
| blr REG0
}
| ldp FP, RX, T2 // retore FP and IP
| ldp FP, RX, T2 // restore FP and IP
| ldp x29, x30, [sp], # NR_SPAD // stack alignment
if (!original_handler || !opline ||
(opline->opcode != ZEND_RETURN
Expand Down Expand Up @@ -3452,7 +3452,7 @@ static int zend_jit_tail_handler(dasm_State **Dst, const zend_op *opline)
| ldp x29, x30, [sp], # SPAD // stack alignment
} else {
| mov FCARG1x, FP
| ldp FP, RX, T2 // retore FP and IP
| ldp FP, RX, T2 // restore FP and IP
| ldp x29, x30, [sp], # NR_SPAD // stack alignment
}
| EXT_JMP handler, REG0
Expand Down Expand Up @@ -4972,7 +4972,7 @@ static int zend_jit_concat_helper(dasm_State **Dst,
}
| LOAD_ZVAL_ADDR FCARG2x, op2_addr
| EXT_CALL zend_jit_fast_assign_concat_helper, REG0
/* concatination with itself may reduce refcount */
/* concatenation with itself may reduce refcount */
op2_info |= MAY_BE_RC1;
} else {
if (Z_REG(res_addr) != ZREG_FCARG1 || Z_OFFSET(res_addr) != 0) {
Expand All @@ -4986,7 +4986,7 @@ static int zend_jit_concat_helper(dasm_State **Dst,
| EXT_CALL zend_jit_fast_concat_tmp_helper, REG0
}
}
/* concatination with empty string may increase refcount */
/* concatenation with empty string may increase refcount */
op2_info |= MAY_BE_RCN;
| FREE_OP op2_type, op2, op2_info, 0, opline, ZREG_TMP1, ZREG_TMP2
|5:
Expand All @@ -5011,7 +5011,7 @@ static int zend_jit_concat_helper(dasm_State **Dst,
| LOAD_ZVAL_ADDR CARG3, op2_addr
| SET_EX_OPLINE opline, REG0
| EXT_CALL concat_function, REG0
/* concatination with empty string may increase refcount */
/* concatenation with empty string may increase refcount */
op1_info |= MAY_BE_RCN;
op2_info |= MAY_BE_RCN;
| FREE_OP op1_type, op1, op1_info, 0, NULL, ZREG_TMP1, ZREG_TMP2
Expand Down Expand Up @@ -9528,7 +9528,7 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
| ldp x29, x30, [sp], # SPAD // stack alignment
| JMP_IP TMP1
} else {
| ldp FP, RX, T2 // retore FP and IP
| ldp FP, RX, T2 // restore FP and IP
| ldp x29, x30, [sp], # NR_SPAD // stack alignment
| mov RETVALx, #1 // ZEND_VM_ENTER
| ret
Expand Down Expand Up @@ -10865,7 +10865,7 @@ static int zend_jit_leave_func(dasm_State **Dst,
// the value of execute_data in execute_ex()
| NIY // TODO
#else
| ldp FP, RX, T2 // retore FP and IP
| ldp FP, RX, T2 // restore FP and IP
| ldp x29, x30, [sp], # NR_SPAD // stack alignment
| mov RETVALx, #2 // ZEND_VM_LEAVE ????
| ret
Expand Down Expand Up @@ -14832,7 +14832,7 @@ static bool zend_jit_fetch_indirect_var(dasm_State **Dst, const zend_op *opline,
| IF_NOT_ZVAL_TYPE var_addr, IS_INDIRECT, &exit_addr, ZREG_TMP1
| GET_ZVAL_PTR FCARG1x, var_addr, TMP1
} else {
/* May be already loaded into FCARG1a or RAX by previus FETCH_OBJ_W/DIM_W */
/* May be already loaded into FCARG1a or RAX by previous FETCH_OBJ_W/DIM_W */
if (opline->op1_type != IS_VAR ||
(opline-1)->result_type != IS_VAR ||
(opline-1)->result.var != opline->op1.var ||
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/jit/zend_jit_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -7854,7 +7854,7 @@ int ZEND_FASTCALL zend_jit_trace_exit(uint32_t exit_num, zend_jit_registers_buf
zend_jit_trace_info *t = &zend_jit_traces[trace_num];
int repeat_last_opline = 0;

/* Deoptimizatoion of VM stack state */
/* Deoptimization of VM stack state */
uint32_t i;
uint32_t stack_size = t->exit_info[exit_num].stack_size;
zend_jit_trace_stack *stack = t->stack_map + t->exit_info[exit_num].stack_offset;
Expand Down
8 changes: 4 additions & 4 deletions ext/opcache/jit/zend_jit_x86.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -5425,7 +5425,7 @@ static int zend_jit_concat_helper(dasm_State **Dst,
}
| LOAD_ZVAL_ADDR FCARG2a, op2_addr
| EXT_CALL zend_jit_fast_assign_concat_helper, r0
/* concatination with itself may reduce refcount */
/* concatenation with itself may reduce refcount */
op2_info |= MAY_BE_RC1;
} else {
if (Z_REG(res_addr) != ZREG_FCARG1 || Z_OFFSET(res_addr) != 0) {
Expand All @@ -5447,7 +5447,7 @@ static int zend_jit_concat_helper(dasm_State **Dst,
| add r4, 12
|.endif
}
/* concatination with empty string may increase refcount */
/* concatenation with empty string may increase refcount */
op2_info |= MAY_BE_RCN;
| FREE_OP op2_type, op2, op2_info, 0, opline
|5:
Expand Down Expand Up @@ -5481,7 +5481,7 @@ static int zend_jit_concat_helper(dasm_State **Dst,
|.if not(X64)
| add r4, 12
|.endif
/* concatination with empty string may increase refcount */
/* concatenation with empty string may increase refcount */
op1_info |= MAY_BE_RCN;
op2_info |= MAY_BE_RCN;
| FREE_OP op1_type, op1, op1_info, 0, NULL
Expand Down Expand Up @@ -15700,7 +15700,7 @@ static bool zend_jit_fetch_indirect_var(dasm_State **Dst, const zend_op *opline,
| IF_NOT_ZVAL_TYPE var_addr, IS_INDIRECT, &exit_addr
| GET_ZVAL_PTR FCARG1a, var_addr
} else {
/* May be already loaded into FCARG1a or RAX by previus FETCH_OBJ_W/DIM_W */
/* May be already loaded into FCARG1a or RAX by previous FETCH_OBJ_W/DIM_W */
if (opline->op1_type != IS_VAR ||
(opline-1)->result_type != IS_VAR ||
(opline-1)->result.var != opline->op1.var ||
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/tests/jit/and_001.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
JIT BW_AND: 001 (emty string)
JIT BW_AND: 001 (empty string)
--INI--
opcache.enable=1
opcache.enable_cli=1
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/tests/jit/assign_045.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
JIT ASSIGN: incorrect assumption about in-memeory zval type
JIT ASSIGN: incorrect assumption about in-memory zval type
--INI--
opcache.enable=1
opcache.enable_cli=1
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/tests/jit/assign_046.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
JIT ASSIGN: incorrect assumption about in-memeory zval type
JIT ASSIGN: incorrect assumption about in-memory zval type
--INI--
opcache.enable=1
opcache.enable_cli=1
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/tests/jit/assign_dim_op_006.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
JIT ASSIGN_DIM_OP 006: Cloberring array be user error handler
JIT ASSIGN_DIM_OP 006: Clobbering array be user error handler
--INI--
opcache.enable=1
opcache.enable_cli=1
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/tests/jit/fetch_r_001.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
FETCH_R: 001 result reference counter may be decremented befor use
FETCH_R: 001 result reference counter may be decremented before use
--INI--
opcache.enable=1
opcache.enable_cli=1
Expand Down