/[eiffelstudio]/branches/CAT_mono/Src/Eiffel/eiffel/genericity/cl_type_i.e
ViewVC logotype

Diff of /branches/CAT_mono/Src/Eiffel/eiffel/genericity/cl_type_i.e

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 69651 by juliant, Tue Jul 24 17:50:09 2007 UTC revision 69657 by juliant, Tue Jul 24 19:16:42 2007 UTC
# Line 375  feature -- Status Line 375  feature -- Status
375          has_expanded_mark: BOOLEAN is          has_expanded_mark: BOOLEAN is
376                          -- Is class type explicitly marked as expanded?                          -- Is class type explicitly marked as expanded?
377                  do                  do
378                          Result := declaration_mark = {CL_TYPE_A}.expanded_mark                          Result := declaration_mark.bit_and ({CL_TYPE_A}.expanded_mark) /= 0
379                  ensure                  ensure
380                          definition: Result = (declaration_mark = {CL_TYPE_A}.expanded_mark)                          definition: Result = (declaration_mark.bit_and ({CL_TYPE_A}.expanded_mark) /= 0)
381                  end                  end
382    
383          has_reference_mark: BOOLEAN is          has_reference_mark: BOOLEAN is
384                          -- Is class type explicitly marked as reference?                          -- Is class type explicitly marked as reference?
385                  do                  do
386                          Result := declaration_mark = {CL_TYPE_A}.reference_mark                          Result := declaration_mark.bit_and ({CL_TYPE_A}.reference_mark) /= 0
387                  ensure                  ensure
388                          definition: Result = (declaration_mark = {CL_TYPE_A}.reference_mark)                          definition: Result = (declaration_mark.bit_and ({CL_TYPE_A}.reference_mark) /= 0)
389                  end                  end
390    
391          has_separate_mark: BOOLEAN is          has_separate_mark: BOOLEAN is
392                          -- Is class type explicitly marked as reference?                          -- Is class type explicitly marked as reference?
393                  do                  do
394                          Result := declaration_mark = {CL_TYPE_A}.separate_mark                          Result := declaration_mark.bit_and ({CL_TYPE_A}.separate_mark) /= 0
395                  ensure                  ensure
396                          definition: Result = (declaration_mark = {CL_TYPE_A}.separate_mark)                          definition: Result = (declaration_mark.bit_and ({CL_TYPE_A}.separate_mark) /= 0)
397                  end                  end
398    
399          has_monomorph_mark: BOOLEAN is          has_monomorph_mark: BOOLEAN is
400                          -- Is class type explicitly marked as monomorph?                          -- Is class type explicitly marked as monomorph?
401                  do                  do
402                          Result := declaration_mark = {CL_TYPE_A}.monomorph_mark                          Result := declaration_mark.bit_and ({CL_TYPE_A}.monomorph_mark) /= 0
403                  ensure                  ensure
404                          definition: Result = (declaration_mark = {CL_TYPE_A}.monomorph_mark)                          definition: Result = (declaration_mark.bit_and ({CL_TYPE_A}.monomorph_mark) /= 0)
405                  end                  end
406    
407          is_expanded: BOOLEAN is          is_expanded: BOOLEAN is
408                          -- Is the type expanded?                          -- Is the type expanded?
409                  do                  do
410                                  -- Do not check for `has_separate_mark' because a separate class cannot be expanded.                          Result := has_expanded_mark or else (not has_reference_mark and then base_class.is_expanded)
                         Result := has_expanded_mark or else ((has_no_mark or has_monomorph_mark) and then base_class.is_expanded)  
411                  end                  end
412    
413                  is_reference: BOOLEAN is          is_reference: BOOLEAN is
414                          -- Is the type a reference type?                          -- Is the type a reference type?
415                  do                  do
416                          Result := has_reference_mark or else                          Result := has_reference_mark or else (not has_expanded_mark and then not base_class.is_expanded)
                                 ((has_no_mark or has_separate_mark or has_monomorph_mark) and then not base_class.is_expanded)  
417                  end                  end
418    
419          is_separate: BOOLEAN is          is_separate: BOOLEAN is
# Line 424  feature -- Status Line 422  feature -- Status
422                          Result := has_separate_mark                          Result := has_separate_mark
423                  end                  end
424    
425            is_monomorph: BOOLEAN is
426                            -- Is the type monomorph?
427                    do
428                            Result := has_monomorph_mark or else is_expanded or else is_frozen
429                    end
430    
431          is_enum: BOOLEAN is          is_enum: BOOLEAN is
432                          -- Is current type an IL enum type?                          -- Is current type an IL enum type?
433                          -- Useful to find out if some call optimization can be done                          -- Useful to find out if some call optimization can be done
# Line 768  feature {CL_TYPE_A, TUPLE_CLASS_B} -- Im Line 772  feature {CL_TYPE_A, TUPLE_CLASS_B} -- Im
772          set_mark (mark: like declaration_mark) is          set_mark (mark: like declaration_mark) is
773                          -- Set `declaration_mark' to the given value `mark'.                          -- Set `declaration_mark' to the given value `mark'.
774                  require                  require
775                          valid_declaration_mark:  --                      valid_declaration_mark:
776                                  mark = {CL_TYPE_A}.no_mark or mark = {CL_TYPE_A}.expanded_mark or  --                              mark = {CL_TYPE_A}.no_mark or mark = {CL_TYPE_A}.expanded_mark or
777                                  mark = {CL_TYPE_A}.reference_mark or mark = {CL_TYPE_A}.separate_mark or  --                              mark = {CL_TYPE_A}.reference_mark or mark = {CL_TYPE_A}.separate_mark or
778                                  mark = {CL_TYPE_A}.monomorph_mark  --                              mark = {CL_TYPE_A}.monomorph_mark
779                  do                  do
780                          declaration_mark := mark                          declaration_mark := mark
781                  ensure                  ensure
# Line 780  feature {CL_TYPE_A, TUPLE_CLASS_B} -- Im Line 784  feature {CL_TYPE_A, TUPLE_CLASS_B} -- Im
784    
785  invariant  invariant
786          class_id_positive: class_id > 0          class_id_positive: class_id > 0
787          valid_declaration_mark:  -- Todo: new invariant for mark using bit-mask
788                  declaration_mark = {CL_TYPE_A}.no_mark or  --      valid_declaration_mark:
789                  declaration_mark = {CL_TYPE_A}.expanded_mark or  --              declaration_mark = {CL_TYPE_A}.no_mark or
790                  declaration_mark = {CL_TYPE_A}.reference_mark or  --              declaration_mark = {CL_TYPE_A}.expanded_mark or
791                  declaration_mark = {CL_TYPE_A}.separate_mark or  --              declaration_mark = {CL_TYPE_A}.reference_mark or
792                  declaration_mark = {CL_TYPE_A}.monomorph_mark  --              declaration_mark = {CL_TYPE_A}.separate_mark or
793    --              declaration_mark = {CL_TYPE_A}.monomorph_mark
794    
795  indexing  indexing
796          copyright:      "Copyright (c) 1984-2006, Eiffel Software"          copyright:      "Copyright (c) 1984-2006, Eiffel Software"

Legend:
Removed from v.69651  
changed lines
  Added in v.69657

  ViewVC Help
Powered by ViewVC 1.1.23