# define ZEND_ATTRIBUTE_UNUSED __attribute__((unused))
# define ZEND_COLD __attribute__((cold))
# define ZEND_HOT __attribute__((hot))
+# ifdef __OPTIMIZE__
+# define ZEND_OPT_SIZE __attribute__((optimize("Os")))
+# define ZEND_OPT_SPEED __attribute__((optimize("Ofast")))
+# else
+# define ZEND_OPT_SIZE
+# define ZEND_OPT_SPEED
+# endif
#else
# define ZEND_ATTRIBUTE_UNUSED
# define ZEND_COLD
# define ZEND_HOT
+# define ZEND_OPT_SIZE
+# define ZEND_OPT_SPEED
#endif
#if defined(__GNUC__) && ZEND_GCC_VERSION >= 5000
# endif
# if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)
# define ZEND_VM_RETURN() opline = &hybrid_halt_op; return
-# define ZEND_VM_HOT zend_always_inline
+# define ZEND_VM_HOT zend_always_inline ZEND_OPT_SIZE
# else
# define ZEND_VM_RETURN() opline = NULL; return
# define ZEND_VM_HOT
if ($kind == ZEND_VM_KIND_HYBRID) {
out($f,"# if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
out($f,"# define ZEND_VM_RETURN() opline = &hybrid_halt_op; return\n");
- out($f,"# define ZEND_VM_HOT zend_always_inline\n");
+ out($f,"# define ZEND_VM_HOT zend_always_inline ZEND_OPT_SIZE\n");
out($f,"# else\n");
out($f,"# define ZEND_VM_RETURN() opline = NULL; return\n");
out($f,"# define ZEND_VM_HOT\n");