Permalink
Browse files

Remove implementation stubs for yield delegation

I decided to leave out yield delegation for an initial proposal, so remove
the stubs for it too.
  • Loading branch information...
nikic committed Aug 25, 2012
1 parent f53225a commit bd70d155885fdc087afba912c1b290615b864e2f
Showing with 2 additions and 80 deletions.
  1. +0 −23 Zend/zend_compile.c
  2. +0 −1 Zend/zend_compile.h
  3. +0 −3 Zend/zend_language_parser.y
  4. +1 −6 Zend/zend_vm_def.h
  5. +0 −45 Zend/zend_vm_execute.h
  6. +1 −2 Zend/zend_vm_opcodes.h
View
@@ -2702,29 +2702,6 @@ void zend_do_yield(znode *result, znode *value, const znode *key, zend_bool is_v
}
/* }}} */
-void zend_do_delegate_yield(znode *result, const znode *value TSRMLS_DC) /* {{{ */
-{
- zend_op *opline;
-
- if (!CG(active_op_array)->function_name) {
- zend_error(E_COMPILE_ERROR, "The \"yield*\" expression can only be used inside a function");
- }
-
- CG(active_op_array)->fn_flags |= ZEND_ACC_GENERATOR;
-
- opline = get_next_op(CG(active_op_array) TSRMLS_CC);
-
- opline->opcode = ZEND_DELEGATE_YIELD;
-
- SET_NODE(opline->op1, value);
- SET_UNUSED(opline->op2);
-
- opline->result_type = IS_VAR;
- opline->result.var = get_temporary_variable(CG(active_op_array));
- GET_NODE(result, opline->result);
-}
-/* }}} */
-
static int zend_add_try_element(zend_uint try_op TSRMLS_DC) /* {{{ */
{
int try_catch_offset = CG(active_op_array)->last_try_catch++;
View
@@ -496,7 +496,6 @@ int zend_do_begin_class_member_function_call(znode *class_name, znode *method_na
void zend_do_end_function_call(znode *function_name, znode *result, const znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC);
void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC);
void zend_do_yield(znode *result, znode *value, const znode *key, zend_bool is_variable TSRMLS_DC);
-void zend_do_delegate_yield(znode *result, const znode *value TSRMLS_DC);
void zend_do_handle_exception(TSRMLS_D);
void zend_do_begin_lambda_function_declaration(znode *result, znode *function_token, int return_reference, int is_static TSRMLS_DC);
@@ -807,9 +807,6 @@ expr_without_variable:
| '`' backticks_expr '`' { zend_do_shell_exec(&$$, &$2 TSRMLS_CC); }
| T_PRINT expr { zend_do_print(&$$, &$2 TSRMLS_CC); }
| T_YIELD { zend_do_yield(&$$, NULL, NULL, 0 TSRMLS_CC); }
- /*| T_YIELD expr_without_variable { zend_do_yield(&$$, &$2, NULL, 0 TSRMLS_CC); }
- | T_YIELD variable { zend_do_yield(&$$, &$2, NULL, 1 TSRMLS_CC); }*/
- | T_YIELD '*' expr { zend_do_delegate_yield(&$$, &$3 TSRMLS_CC); }
| function is_reference { zend_do_begin_lambda_function_declaration(&$$, &$1, $2.op_type, 0 TSRMLS_CC); }
'(' parameter_list ')' lexical_vars
'{' inner_statement_list '}' { zend_do_end_function_declaration(&$1 TSRMLS_CC); $$ = $3; }
View
@@ -3055,7 +3055,7 @@ ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY)
ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
}
-ZEND_VM_HANDLER(162, ZEND_GENERATOR_RETURN, ANY, ANY)
+ZEND_VM_HANDLER(161, ZEND_GENERATOR_RETURN, ANY, ANY)
{
if (EX(op_array)->has_finally_block) {
ZEND_VM_DISPATCH_TO_HELPER_EX(zend_finally_handler_leaving, type, ZEND_RETURN);
@@ -5552,9 +5552,4 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE
ZEND_VM_RETURN();
}
-ZEND_VM_HANDLER(161, ZEND_DELEGATE_YIELD, CONST|TMP|VAR|CV, ANY)
-{
- ZEND_VM_NEXT_OPCODE();
-}
-
ZEND_VM_EXPORT_HELPER(zend_do_fcall, zend_do_fcall_common_helper)
View
@@ -3177,11 +3177,6 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL ZEND_DELEGATE_YIELD_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
-{
- ZEND_VM_NEXT_OPCODE();
-}
-
static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -8556,11 +8551,6 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL ZEND_DELEGATE_YIELD_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
-{
- ZEND_VM_NEXT_OPCODE();
-}
-
static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -14014,11 +14004,6 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL ZEND_DELEGATE_YIELD_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
-{
- ZEND_VM_NEXT_OPCODE();
-}
-
static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -31430,11 +31415,6 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL ZEND_DELEGATE_YIELD_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
-{
- ZEND_VM_NEXT_OPCODE();
-}
-
static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -45025,31 +45005,6 @@ void zend_init_opcodes_handlers(void)
ZEND_YIELD_SPEC_CV_VAR_HANDLER,
ZEND_YIELD_SPEC_CV_UNUSED_HANDLER,
ZEND_YIELD_SPEC_CV_CV_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_CONST_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_CONST_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_CONST_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_CONST_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_CONST_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_TMP_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_TMP_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_TMP_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_TMP_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_TMP_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_VAR_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_VAR_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_VAR_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_VAR_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_VAR_HANDLER,
- ZEND_NULL_HANDLER,
- ZEND_NULL_HANDLER,
- ZEND_NULL_HANDLER,
- ZEND_NULL_HANDLER,
- ZEND_NULL_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_CV_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_CV_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_CV_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_CV_HANDLER,
- ZEND_DELEGATE_YIELD_SPEC_CV_HANDLER,
ZEND_GENERATOR_RETURN_SPEC_HANDLER,
ZEND_GENERATOR_RETURN_SPEC_HANDLER,
ZEND_GENERATOR_RETURN_SPEC_HANDLER,
View
@@ -161,5 +161,4 @@
#define ZEND_JMP_SET_VAR 158
#define ZEND_LEAVE 159
#define ZEND_YIELD 160
-#define ZEND_DELEGATE_YIELD 161
-#define ZEND_GENERATOR_RETURN 162
+#define ZEND_GENERATOR_RETURN 161

0 comments on commit bd70d15

Please sign in to comment.