pike.git / src / docode.c

version» Context lines:

pike.git/src/docode.c:1063:    } else if (flags & WANT_LVALUE) {    if (n->u.integer.b == IDREF_MAGIC_THIS) {    my_yyerror("this is not an lvalue.");    }    if (level) {    emit2(F_EXTERNAL_LVALUE, n->u.integer.b, level);    } else {    emit1(F_GLOBAL_LVALUE, n->u.integer.b);    }    return 2; +  } else if (n->u.integer.b == IDREF_MAGIC_THIS) { +  if (n->token == F_GET_SET) { +  my_yyerror("this is not a getter/setter."); +  } +  if (level) { +  struct program_state *state = Pike_compiler; +  int e; +  for (e = level; e; e--) { +  state->new_program->flags |= +  PROGRAM_USES_PARENT|PROGRAM_NEEDS_PARENT; +  state = state->previous; +  } +  emit2(F_EXTERNAL, IDREF_MAGIC_THIS, level);    } else { -  +  emit1(F_THIS_OBJECT, 0); +  } +  } else {    struct reference *ref =    PTR_FROM_INT(state->new_program, n->u.integer.b);    struct identifier *id =    ID_FROM_PTR(state->new_program, ref);    if (n->token == F_GET_SET) {    struct inherit *inh =    INHERIT_FROM_PTR(state->new_program, ref);    int f;   #ifdef PIKE_DEBUG    if (!IDENTIFIER_IS_VARIABLE(id->identifier_flags) ||
pike.git/src/docode.c:1126:    } else {    struct program_state *state = Pike_compiler;    int e;    for (e = level; e; e--) {    state->new_program->flags |=    PROGRAM_USES_PARENT|PROGRAM_NEEDS_PARENT;    state = state->previous;    }    emit2(F_EXTERNAL, n->u.integer.b, level);    } -  } else if (n->u.integer.b == IDREF_MAGIC_THIS) { -  emit1(F_THIS_OBJECT, 0); +     } else if(IDENTIFIER_IS_FUNCTION(id->identifier_flags) &&    id->identifier_flags & IDENTIFIER_HAS_BODY)    {    /* Only use this opcode when it's certain that the result    * can't zero, i.e. when we know the function isn't just a    * prototype. */    emit1(F_LFUN, n->u.integer.b);    } else if (IDENTIFIER_IS_CONSTANT(id->identifier_flags) &&    (ref->id_flags & (ID_INLINE|ID_PRIVATE)) && !ref->inherit_offset &&    (id->func.const_info.offset >= 0)) {