Mercurial > hg > graal-jvmci-8
annotate src/cpu/x86/vm/registerMap_x86.cpp @ 22298:c28cb37b2e1d
Rename JVMCI to INCLUDE_JVMCI.
author | twisti |
---|---|
date | Wed, 22 Jul 2015 08:56:03 -0700 |
parents | 658db9861109 |
children |
rev | line source |
---|---|
20970
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
1 /* |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
4 * |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
8 * |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
14 * |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
18 * |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
21 * questions. |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
22 * |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
23 */ |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
24 |
20988
658db9861109
include "precompiled.hpp", required by Windows builders.
Christian Wirth <christian.wirth@oracle.com>
parents:
20970
diff
changeset
|
25 #include "precompiled.hpp" |
20970
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
26 #include <runtime/registerMap.hpp> |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
27 #include "vmreg_x86.inline.hpp" |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
28 |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
29 address RegisterMap::pd_location(VMReg reg) const { |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
30 if (reg->is_XMMRegister()) { |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
31 int regBase = reg->value() - ConcreteRegisterImpl::max_fpr; |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
32 if (regBase % 4 == 0) { |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
33 // Reads of the low and high 16 byte parts should be handled by location itself |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
34 return NULL; |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
35 } |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
36 VMReg baseReg = as_XMMRegister(regBase >> 3)->as_VMReg(); |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
37 intptr_t offset = (reg->value() - baseReg->value()) * 4; |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
38 if (offset >= 16) { |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
39 // The high part of YMM registers are saved in a their own area in the frame |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
40 baseReg = baseReg->next()->next()->next()->next(); |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
41 offset -= 16; |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
42 } |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
43 address baseLocation = location(baseReg); |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
44 if (baseLocation != NULL) { |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
45 return baseLocation + offset; |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
46 } |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
47 } |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
48 return NULL; |
a560c9b81f0f
Add suport for oops in vector registers at safepoints
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff
changeset
|
49 } |