Mercurial > hg > graal-compiler
comparison src/share/vm/opto/gcm.cpp @ 18041:52b4284cb496
Merge with jdk8u20-b26
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 15 Oct 2014 16:02:50 +0200 |
parents | 89152779163c 78bbf4d43a14 |
children |
comparison
equal
deleted
inserted
replaced
17606:45d7b2c7029d | 18041:52b4284cb496 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
48 # include "adfiles/ad_zero.hpp" | 48 # include "adfiles/ad_zero.hpp" |
49 #endif | 49 #endif |
50 #ifdef TARGET_ARCH_MODEL_arm | 50 #ifdef TARGET_ARCH_MODEL_arm |
51 # include "adfiles/ad_arm.hpp" | 51 # include "adfiles/ad_arm.hpp" |
52 #endif | 52 #endif |
53 #ifdef TARGET_ARCH_MODEL_ppc | 53 #ifdef TARGET_ARCH_MODEL_ppc_32 |
54 # include "adfiles/ad_ppc.hpp" | 54 # include "adfiles/ad_ppc_32.hpp" |
55 #endif | 55 #endif |
56 #ifdef TARGET_ARCH_MODEL_ppc_64 | |
57 # include "adfiles/ad_ppc_64.hpp" | |
58 #endif | |
59 | |
56 | 60 |
57 // Portions of code courtesy of Clifford Click | 61 // Portions of code courtesy of Clifford Click |
58 | 62 |
59 // Optimization - Graph Style | 63 // Optimization - Graph Style |
60 | 64 |
1324 | 1328 |
1325 // Detect implicit-null-check opportunities. Basically, find NULL checks | 1329 // Detect implicit-null-check opportunities. Basically, find NULL checks |
1326 // with suitable memory ops nearby. Use the memory op to do the NULL check. | 1330 // with suitable memory ops nearby. Use the memory op to do the NULL check. |
1327 // I can generate a memory op if there is not one nearby. | 1331 // I can generate a memory op if there is not one nearby. |
1328 if (C->is_method_compilation()) { | 1332 if (C->is_method_compilation()) { |
1329 // Don't do it for natives, adapters, or runtime stubs | |
1330 int allowed_reasons = 0; | |
1331 // ...and don't do it when there have been too many traps, globally. | |
1332 for (int reason = (int)Deoptimization::Reason_none+1; | |
1333 reason < Compile::trapHistLength; reason++) { | |
1334 assert(reason < BitsPerInt, "recode bit map"); | |
1335 if (!C->too_many_traps((Deoptimization::DeoptReason) reason)) | |
1336 allowed_reasons |= nth_bit(reason); | |
1337 } | |
1338 // By reversing the loop direction we get a very minor gain on mpegaudio. | 1333 // By reversing the loop direction we get a very minor gain on mpegaudio. |
1339 // Feel free to revert to a forward loop for clarity. | 1334 // Feel free to revert to a forward loop for clarity. |
1340 // for( int i=0; i < (int)matcher._null_check_tests.size(); i+=2 ) { | 1335 // for( int i=0; i < (int)matcher._null_check_tests.size(); i+=2 ) { |
1341 for (int i = _matcher._null_check_tests.size() - 2; i >= 0; i -= 2) { | 1336 for (int i = _matcher._null_check_tests.size() - 2; i >= 0; i -= 2) { |
1342 Node* proj = _matcher._null_check_tests[i]; | 1337 Node* proj = _matcher._null_check_tests[i]; |
1343 Node* val = _matcher._null_check_tests[i + 1]; | 1338 Node* val = _matcher._null_check_tests[i + 1]; |
1344 Block* block = get_block_for_node(proj); | 1339 Block* block = get_block_for_node(proj); |
1345 implicit_null_check(block, proj, val, allowed_reasons); | 1340 implicit_null_check(block, proj, val, C->allowed_deopt_reasons()); |
1346 // The implicit_null_check will only perform the transformation | 1341 // The implicit_null_check will only perform the transformation |
1347 // if the null branch is truly uncommon, *and* it leads to an | 1342 // if the null branch is truly uncommon, *and* it leads to an |
1348 // uncommon trap. Combined with the too_many_traps guards | 1343 // uncommon trap. Combined with the too_many_traps guards |
1349 // above, this prevents SEGV storms reported in 6366351, | 1344 // above, this prevents SEGV storms reported in 6366351, |
1350 // by recompiling offending methods without this optimization. | 1345 // by recompiling offending methods without this optimization. |
2017 void CFGLoop::dump() const { | 2012 void CFGLoop::dump() const { |
2018 for (int i = 0; i < _depth; i++) tty->print(" "); | 2013 for (int i = 0; i < _depth; i++) tty->print(" "); |
2019 tty->print("%s: %d trip_count: %6.0f freq: %6.0f\n", | 2014 tty->print("%s: %d trip_count: %6.0f freq: %6.0f\n", |
2020 _depth == 0 ? "Method" : "Loop", _id, trip_count(), _freq); | 2015 _depth == 0 ? "Method" : "Loop", _id, trip_count(), _freq); |
2021 for (int i = 0; i < _depth; i++) tty->print(" "); | 2016 for (int i = 0; i < _depth; i++) tty->print(" "); |
2022 tty->print(" members:", _id); | 2017 tty->print(" members:"); |
2023 int k = 0; | 2018 int k = 0; |
2024 for (int i = 0; i < _members.length(); i++) { | 2019 for (int i = 0; i < _members.length(); i++) { |
2025 if (k++ >= 6) { | 2020 if (k++ >= 6) { |
2026 tty->print("\n "); | 2021 tty->print("\n "); |
2027 for (int j = 0; j < _depth+1; j++) tty->print(" "); | 2022 for (int j = 0; j < _depth+1; j++) tty->print(" "); |