Skip to content

Commit f599fb8

Browse files
committed
Add todos for constant autoloading lookups
1 parent 3d95ec5 commit f599fb8

File tree

5 files changed

+6
-0
lines changed

5 files changed

+6
-0
lines changed

Zend/zend_builtin_functions.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ ZEND_FUNCTION(define)
523523

524524
/* {{{ Check whether a constant exists
525525
Warning: This function is special-cased by zend_compile.c and so is usually bypassed */
526+
// TODO Update this and compiler
526527
ZEND_FUNCTION(defined)
527528
{
528529
zend_string *name;

Zend/zend_constants.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ ZEND_API bool zend_verify_const_access(zend_class_constant *c, zend_class_entry
276276
}
277277
/* }}} */
278278

279+
// TODO Add support for auto-loading?
279280
static zend_constant *zend_get_constant_str_impl(const char *name, size_t name_len)
280281
{
281282
zend_constant *c = zend_hash_str_find_ptr(EG(zend_constants), name, name_len);
@@ -302,6 +303,7 @@ ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len)
302303

303304
static zend_constant *zend_get_constant_impl(zend_string *name)
304305
{
306+
// TODO Use lookup
305307
zend_constant *c = zend_hash_find_ptr(EG(zend_constants), name);
306308
if (c) {
307309
return c;

Zend/zend_execute.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4599,6 +4599,7 @@ static zend_always_inline zend_result _zend_quick_get_constant(
45994599
zend_constant *c = NULL;
46004600

46014601
/* null/true/false are resolved during compilation, so don't check for them here. */
4602+
// TODO Create a constant_lookup
46024603
zv = zend_hash_find_known_hash(EG(zend_constants), Z_STR_P(key));
46034604
if (zv) {
46044605
c = (zend_constant*)Z_PTR_P(zv);

Zend/zend_vm_def.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5839,6 +5839,7 @@ ZEND_VM_HOT_HANDLER(99, ZEND_FETCH_CONSTANT, UNUSED|CONST_FETCH, CONST, CACHE_SL
58395839
}
58405840

58415841
SAVE_OPLINE();
5842+
// TODO Constant lookup
58425843
zend_quick_get_constant(RT_CONSTANT(opline, opline->op2) + 1, opline->op1.num OPLINE_CC EXECUTE_DATA_CC);
58435844
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
58445845
}

Zend/zend_vm_execute.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33226,6 +33226,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPE
3322633226
}
3322733227

3322833228
SAVE_OPLINE();
33229+
// TODO Constant lookup
3322933230
zend_quick_get_constant(RT_CONSTANT(opline, opline->op2) + 1, opline->op1.num OPLINE_CC EXECUTE_DATA_CC);
3323033231
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
3323133232
}

0 commit comments

Comments
 (0)