Changeset 288


Ignore:
Timestamp:
Dec 19, 2002, 3:11:29 PM (18 years ago)
Author:
orlov
Message:

* empty log message *

Location:
to-imperative/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/compiler/rfp_asail.rf

    r241 r288  
    221221       */
    222222      (EQ (e.expr1) (e.pos1) (e.len1) (e.expr2) (e.pos2) (e.len2)) =
    223         'eq (' <Expr-Ref-To-CPP 0 e.expr1> ', '
    224             <Expr-Int-To-CPP e.pos1> ', ' <Expr-Int-To-CPP e.len1> ', '
    225             <Expr-Ref-To-CPP 0 e.expr2> ', '
    226             <Expr-Int-To-CPP e.pos2> ', ' <Expr-Int-To-CPP e.len2> ')';
     223        'eq_expr (' <Expr-Ref-To-CPP 0 e.expr1> ', '
     224              <Expr-Int-To-CPP e.pos1> ', ' <Expr-Int-To-CPP e.len1> ', '
     225              <Expr-Ref-To-CPP 0 e.expr2> ', '
     226              <Expr-Int-To-CPP e.pos2> ', ' <Expr-Int-To-CPP e.len2> ')';
    227227      /*
    228228       * FLAT-EQ -> to function flat_eq() with 5 arg.
  • to-imperative/trunk/runtime/rf_expr.hh

    r186 r288  
    689689
    690690friend
    691 inline bool fast_eq (
    692   Term const* _f1, Term const* _l1, Term const* _f2, Term const* _l2
     691inline bool eq_expr (
     692  const Expr &_e1, uintptr_t _pos1, uintptr_t _len1,
     693  const Expr &_e2, uintptr_t _pos2, uintptr_t _len2
    693694)
    694695{
    695   for (; _f1 < _l1; _f1++, _f2++) {
    696     if ((*_f1).get_type() != (*_f2).get_type() || (*_f1).data2 != (*_f2).data2)
     696  if (_len1 == _len2) {
     697    Term *p1 = _e1.get_first() + _pos1;
     698    Term *p2 = _e2.get_first() + _pos2;
     699    Term *l1 = p1  + _len1;
     700    for (; p1 < l1; p1++, p2++) {
     701      if (*p1 != *p2) return false;
     702    }
     703    return true;
     704  }
     705  return false;
     706}
     707
     708
     709friend
     710inline bool flat_eq (
     711  const Expr &_e1, uintptr_t _pos1,
     712  const Expr &_e2, uintptr_t _pos2, uintptr_t _len
     713)
     714{
     715  Term *p1 = _e1.get_first() + _pos1;
     716  Term *p2 = _e2.get_first() + _pos2;
     717  Term *l1 = p1  + _len;
     718  for (; p1 < l1; p1++, p2++) {
     719    if (p1->get_type() != p2->get_type() || p1->data2 != p2->data2)
    697720      return false;
    698721  }
  • to-imperative/trunk/runtime/rf_term.hh

    r157 r288  
    4848friend inline Expr operator + (Term const&, Term const&) ;
    4949friend inline bool operator == (Term const&, Term const&) ;
    50 friend inline bool fast_eq (
    51                 Term const* _f1, Term const* _l1, Term const* _f2, Term const* _l2) ;
     50friend inline bool flat_eq (
     51    const Expr &_e1, uintptr_t _pos1,
     52    const Expr &_e2, uintptr_t _pos2, uintptr_t _len );
    5253
    5354private:
Note: See TracChangeset for help on using the changeset viewer.