Home | History | Annotate | Download | only in cpp-define-generator
      1 /*
      2  * Copyright (C) 2016 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 // Includes every single offset file in art.
     18 // Useful for processing every single offset together.
     19 
     20 // Usage:
     21 // #define DEFINE_INCLUDE_DEPENDENCIES
     22 // #include "offsets_all.def"
     23 // to automatically include each def file's header dependencies.
     24 //
     25 // Afterwards,
     26 // #define DEFINE_EXPR(define_name, field_type, expr) ...
     27 // #include "offsets_all.def"
     28 // to process each offset however one wants.
     29 #if defined(DEFINE_INCLUDE_DEPENDENCIES)
     30 #define DEFINE_EXPR(define_name, field_type, expr)
     31 #endif
     32 
     33 #if !defined(DEFINE_EXPR)
     34 #error "Either DEFINE_INCLUDE_DEPENDENCIES or DEFINE_EXPR must be defined"
     35 #endif
     36 
     37 #include "constant_reference.def"
     38 #include "offset_runtime.def"
     39 // TODO: rest of THREAD_ offsets (depends on __SIZEOF__POINTER__).
     40 #include "offset_thread.def"
     41 // TODO: SHADOW_FRAME depends on __SIZEOF__POINTER__
     42 // #include "offset_shadow_frame.def"
     43 #include "offset_codeitem.def"
     44 // TODO: MIRROR_OBJECT_HEADER_SIZE (depends on #ifdef read barrier)
     45 // TODO: MIRROR_CLASS offsets (see above)
     46 #include "offset_mirror_object.def"
     47 #include "constant_class.def"
     48 // TODO: MIRROR_*_ARRAY offsets (depends on header size)
     49 // TODO: MIRROR_STRING offsets (depends on header size)
     50 #include "offset_dexcache.def"
     51 #include "constant_dexcache.def"
     52 #include "constant_card_table.def"
     53 #include "constant_heap.def"
     54 #include "constant_lockword.def"
     55 #include "constant_globals.def"
     56 #include "constant_rosalloc.def"
     57 #include "constant_thread.def"
     58 #include "constant_jit.def"
     59 
     60 // TODO: MIRROR_OBJECT_HEADER_SIZE #ifdef depends on read barriers
     61 // TODO: Array offsets (depends on MIRROR_OBJECT_HEADER_SIZE)
     62 
     63 #if defined(DEFINE_INCLUDE_DEPENDENCIES)
     64 #undef DEFINE_EXPR
     65 #undef DEFINE_INCLUDE_DEPENDENCIES
     66 #endif
     67 
     68 
     69