author | rkennke |
Sun, 06 May 2018 00:42:59 +0200 | |
changeset 50024 | 7238cb613dc5 |
parent 49929 | f38329fe8055 |
child 50110 | 3d98842c8677 |
permissions | -rw-r--r-- |
49748 | 1 |
/* |
2 |
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
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 |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
25 |
#include "precompiled.hpp" |
|
26 |
#include "gc/shared/barrierSetAssembler.hpp" |
|
49898
4745598b307f
8200235: Generalize jniFastGetField jobject/jweak resolve
eosterlund
parents:
49748
diff
changeset
|
27 |
#include "runtime/jniHandles.hpp" |
49748 | 28 |
|
29 |
#define __ masm-> |
|
30 |
||
31 |
void BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, |
|
32 |
Register dst, Address src, Register tmp1, Register tmp_thread) { |
|
50024
7238cb613dc5
8202676: AArch64: Missing enter/leave around barrier leads to infinite loop
rkennke
parents:
49929
diff
changeset
|
33 |
|
7238cb613dc5
8202676: AArch64: Missing enter/leave around barrier leads to infinite loop
rkennke
parents:
49929
diff
changeset
|
34 |
// LR is live. It must be saved around calls. |
7238cb613dc5
8202676: AArch64: Missing enter/leave around barrier leads to infinite loop
rkennke
parents:
49929
diff
changeset
|
35 |
|
49748 | 36 |
bool on_heap = (decorators & IN_HEAP) != 0; |
37 |
bool on_root = (decorators & IN_ROOT) != 0; |
|
38 |
switch (type) { |
|
39 |
case T_OBJECT: |
|
40 |
case T_ARRAY: { |
|
41 |
if (on_heap) { |
|
42 |
__ load_heap_oop(dst, src); |
|
43 |
} else { |
|
44 |
assert(on_root, "why else?"); |
|
45 |
__ ldr(dst, src); |
|
46 |
} |
|
47 |
break; |
|
48 |
} |
|
49 |
default: Unimplemented(); |
|
50 |
} |
|
51 |
} |
|
52 |
||
53 |
void BarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, |
|
54 |
Address dst, Register val, Register tmp1, Register tmp2) { |
|
55 |
bool on_heap = (decorators & IN_HEAP) != 0; |
|
56 |
bool on_root = (decorators & IN_ROOT) != 0; |
|
57 |
switch (type) { |
|
58 |
case T_OBJECT: |
|
59 |
case T_ARRAY: { |
|
60 |
if (on_heap) { |
|
61 |
__ store_heap_oop(dst, val); |
|
62 |
} else { |
|
63 |
assert(on_root, "why else?"); |
|
64 |
__ str(val, dst); |
|
65 |
} |
|
66 |
break; |
|
67 |
} |
|
68 |
default: Unimplemented(); |
|
69 |
} |
|
70 |
} |
|
49898
4745598b307f
8200235: Generalize jniFastGetField jobject/jweak resolve
eosterlund
parents:
49748
diff
changeset
|
71 |
|
49929
f38329fe8055
8202381: (Solaris) SIGBUS in # V [libjvm.so+0xcee494] jni_GetIntField+0x224
eosterlund
parents:
49898
diff
changeset
|
72 |
void BarrierSetAssembler::try_resolve_jobject_in_native(MacroAssembler* masm, Register jni_env, |
f38329fe8055
8202381: (Solaris) SIGBUS in # V [libjvm.so+0xcee494] jni_GetIntField+0x224
eosterlund
parents:
49898
diff
changeset
|
73 |
Register obj, Register tmp, Label& slowpath) { |
49898
4745598b307f
8200235: Generalize jniFastGetField jobject/jweak resolve
eosterlund
parents:
49748
diff
changeset
|
74 |
// If mask changes we need to ensure that the inverse is still encodable as an immediate |
4745598b307f
8200235: Generalize jniFastGetField jobject/jweak resolve
eosterlund
parents:
49748
diff
changeset
|
75 |
STATIC_ASSERT(JNIHandles::weak_tag_mask == 1); |
49929
f38329fe8055
8202381: (Solaris) SIGBUS in # V [libjvm.so+0xcee494] jni_GetIntField+0x224
eosterlund
parents:
49898
diff
changeset
|
76 |
__ andr(obj, obj, ~JNIHandles::weak_tag_mask); |
f38329fe8055
8202381: (Solaris) SIGBUS in # V [libjvm.so+0xcee494] jni_GetIntField+0x224
eosterlund
parents:
49898
diff
changeset
|
77 |
__ ldr(obj, Address(obj, 0)); // *obj |
49898
4745598b307f
8200235: Generalize jniFastGetField jobject/jweak resolve
eosterlund
parents:
49748
diff
changeset
|
78 |
} |