annotate src/share/vm/shark/sharkInvariants.cpp @ 10185:d50cc62e94ff

8012715: G1: GraphKit accesses PtrQueue::_index as int but is size_t Summary: In graphKit INT operations were generated to access PtrQueue::_index which has type size_t. This is 64 bit on 64-bit machines. No problems occur on little endian machines as long as the index fits into 32 bit, but on big endian machines the upper part is read, which is zero. This leads to unnecessary branches to the slow path in the runtime. Reviewed-by: twisti, johnc Contributed-by: Martin Doerr <martin.doerr@sap.com>
author johnc
date Wed, 24 Apr 2013 14:48:43 -0700
parents f95d63e2154a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
1 /*
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1692
diff changeset
2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
3 * Copyright 2008, 2009 Red Hat, Inc.
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
5 *
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
6 * This code is free software; you can redistribute it and/or modify it
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
7 * under the terms of the GNU General Public License version 2 only, as
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
8 * published by the Free Software Foundation.
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
9 *
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
10 * This code is distributed in the hope that it will be useful, but WITHOUT
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
13 * version 2 for more details (a copy is included in the LICENSE file that
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
14 * accompanied this code).
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
15 *
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License version
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
17 * 2 along with this work; if not, write to the Free Software Foundation,
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
19 *
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
21 * or visit www.oracle.com if you need additional information or have any
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
22 * questions.
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
23 *
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
24 */
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
25
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1692
diff changeset
26 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1692
diff changeset
27 #include "shark/sharkInvariants.hpp"
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
28
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
29 int SharkTargetInvariants::count_monitors() {
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
30 int result = 0;
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
31 if (is_synchronized() || target()->has_monitor_bytecodes()) {
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
32 for (int i = 0; i < flow()->block_count(); i++) {
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
33 result = MAX2(result, flow()->pre_order_at(i)->monitor_count());
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
34 }
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
35 }
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
36 return result;
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
37 }