1217 int Inline_Warm(); // Find more inlining work. 1218 void Finish_Warm(); // Give up on further inlines. 1219 void Optimize(); // Given a graph, optimize it 1220 void Code_Gen(); // Generate code from a graph 1221 1222 // Management of the AliasType table. 1223 void grow_alias_types(); 1224 AliasCacheEntry* probe_alias_cache(const TypePtr* adr_type); 1225 const TypePtr *flatten_alias_type(const TypePtr* adr_type) const; 1226 AliasType* find_alias_type(const TypePtr* adr_type, bool no_create, ciField* field); 1227 1228 void verify_top(Node*) const PRODUCT_RETURN; 1229 1230 // Intrinsic setup. 1231 void register_library_intrinsics(); // initializer 1232 CallGenerator* make_vm_intrinsic(ciMethod* m, bool is_virtual); // constructor 1233 int intrinsic_insertion_index(ciMethod* m, bool is_virtual); // helper 1234 CallGenerator* find_intrinsic(ciMethod* m, bool is_virtual); // query fn 1235 void register_intrinsic(CallGenerator* cg); // update fn 1236 1237 #ifndef PRODUCT 1238 static juint _intrinsic_hist_count[vmIntrinsics::ID_LIMIT]; 1239 static jubyte _intrinsic_hist_flags[vmIntrinsics::ID_LIMIT]; 1240 #endif 1241 // Function calls made by the public function final_graph_reshaping. 1242 // No need to be made public as they are not called elsewhere. 1243 void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc); 1244 void final_graph_reshaping_walk( Node_Stack &nstack, Node *root, Final_Reshape_Counts &frc ); 1245 void eliminate_redundant_card_marks(Node* n); 1246 1247 public: 1248 1249 // Note: Histogram array size is about 1 Kb. 1250 enum { // flag bits: 1251 _intrinsic_worked = 1, // succeeded at least once 1252 _intrinsic_failed = 2, // tried it but it failed 1253 _intrinsic_disabled = 4, // was requested but disabled (e.g., -XX:-InlineUnsafeOps) 1254 _intrinsic_virtual = 8, // was seen in the virtual form (rare) 1255 _intrinsic_both = 16 // was seen in the non-virtual form (usual) 1256 }; 1257 // Update histogram. Return boolean if this is a first-time occurrence. 1258 static bool gather_intrinsic_statistics(vmIntrinsics::ID id, 1259 bool is_virtual, int flags) PRODUCT_RETURN0; 1260 static void print_intrinsic_statistics() PRODUCT_RETURN; 1261 1262 // Graph verification code 1263 // Walk the node list, verifying that there is a one-to-one 1264 // correspondence between Use-Def edges and Def-Use edges 1265 // The option no_dead_code enables stronger checks that the 1266 // graph is strongly connected from root in both directions. 1267 void verify_graph_edges(bool no_dead_code = false) PRODUCT_RETURN; 1268 1269 // Verify GC barrier patterns 1270 void verify_barriers() PRODUCT_RETURN; 1271 1272 // End-of-run dumps. 1273 static void print_statistics() PRODUCT_RETURN; 1274 1275 // Dump formatted assembly 1276 void dump_asm(int *pcs = NULL, uint pc_limit = 0) PRODUCT_RETURN; 1277 void dump_pc(int *pcs, int pc_limit, Node *n); 1278 1279 // Verify ADLC assumptions during startup 1280 static void adlc_verification() PRODUCT_RETURN; | 1217 int Inline_Warm(); // Find more inlining work. 1218 void Finish_Warm(); // Give up on further inlines. 1219 void Optimize(); // Given a graph, optimize it 1220 void Code_Gen(); // Generate code from a graph 1221 1222 // Management of the AliasType table. 1223 void grow_alias_types(); 1224 AliasCacheEntry* probe_alias_cache(const TypePtr* adr_type); 1225 const TypePtr *flatten_alias_type(const TypePtr* adr_type) const; 1226 AliasType* find_alias_type(const TypePtr* adr_type, bool no_create, ciField* field); 1227 1228 void verify_top(Node*) const PRODUCT_RETURN; 1229 1230 // Intrinsic setup. 1231 void register_library_intrinsics(); // initializer 1232 CallGenerator* make_vm_intrinsic(ciMethod* m, bool is_virtual); // constructor 1233 int intrinsic_insertion_index(ciMethod* m, bool is_virtual); // helper 1234 CallGenerator* find_intrinsic(ciMethod* m, bool is_virtual); // query fn 1235 void register_intrinsic(CallGenerator* cg); // update fn 1236 1237 // Returns true if the intrinsic for method 'method' will perform a virtual dispatch. 1238 static bool intrinsic_does_virtual_dispatch_for(Method* method); 1239 1240 // A return value larger than 0 indicates that the intrinsic for method 1241 // 'method' requires predicated logic. 1242 static int intrinsic_predicates_needed_for(Method* method); 1243 1244 #ifndef PRODUCT 1245 static juint _intrinsic_hist_count[vmIntrinsics::ID_LIMIT]; 1246 static jubyte _intrinsic_hist_flags[vmIntrinsics::ID_LIMIT]; 1247 #endif 1248 // Function calls made by the public function final_graph_reshaping. 1249 // No need to be made public as they are not called elsewhere. 1250 void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc); 1251 void final_graph_reshaping_walk( Node_Stack &nstack, Node *root, Final_Reshape_Counts &frc ); 1252 void eliminate_redundant_card_marks(Node* n); 1253 1254 public: 1255 1256 // Note: Histogram array size is about 1 Kb. 1257 enum { // flag bits: 1258 _intrinsic_worked = 1, // succeeded at least once 1259 _intrinsic_failed = 2, // tried it but it failed 1260 _intrinsic_disabled = 4, // was requested but disabled (e.g., -XX:-InlineUnsafeOps) 1261 _intrinsic_virtual = 8, // was seen in the virtual form (rare) 1262 _intrinsic_both = 16 // was seen in the non-virtual form (usual) 1263 }; 1264 // Update histogram. Return boolean if this is a first-time occurrence. 1265 static bool gather_intrinsic_statistics(vmIntrinsics::ID id, 1266 bool is_virtual, int flags) PRODUCT_RETURN0; 1267 static void print_intrinsic_statistics() PRODUCT_RETURN; 1268 1269 // An intrinsic is available if: 1270 // - the intrinsic is enabled (by using the appropriate command-line flag) and 1271 // - the intrinsic is supported by the VM (i.e., the platform on which the VM is 1272 // running provides the instructions necessary for the C2 compiler to generate 1273 // the intrinsic). 1274 // 1275 // The method 'is_intrinsic_available_for' returns true if the current 1276 // platform provides an intrinsic for the method, for the compilation context, and 1277 // for the dispatch mode (virtual or non-virtual) given as parameter. 1278 // 1279 // The parameter 'compilation_context' indicates the context in which 'method' 1280 // is attempted to be intrinsified; 'compilation_context' is either a method 1281 // that is calling 'method' or it is 'method' itself. The parameter 1282 // 'compilation_context' is necessary to implement support for the 1283 // DisableIntrinsic flag. 1284 static bool is_intrinsic_available_for(Method* method, Method* compilation_context, bool is_virtual); 1285 1286 // Graph verification code 1287 // Walk the node list, verifying that there is a one-to-one 1288 // correspondence between Use-Def edges and Def-Use edges 1289 // The option no_dead_code enables stronger checks that the 1290 // graph is strongly connected from root in both directions. 1291 void verify_graph_edges(bool no_dead_code = false) PRODUCT_RETURN; 1292 1293 // Verify GC barrier patterns 1294 void verify_barriers() PRODUCT_RETURN; 1295 1296 // End-of-run dumps. 1297 static void print_statistics() PRODUCT_RETURN; 1298 1299 // Dump formatted assembly 1300 void dump_asm(int *pcs = NULL, uint pc_limit = 0) PRODUCT_RETURN; 1301 void dump_pc(int *pcs, int pc_limit, Node *n); 1302 1303 // Verify ADLC assumptions during startup 1304 static void adlc_verification() PRODUCT_RETURN; |