comparison src/cpu/sparc/vm/graalCodeInstaller_sparc.cpp @ 21255:ccddbb1409d2

[SPARC] Implement Narrow OOPS
author Stefan Anzinger <stefan.anzinger@oracle.com>
date Wed, 06 May 2015 17:13:50 +0200
parents f7d45e2426d4
children
comparison
equal deleted inserted replaced
21254:7a49a2763a7a 21255:ccddbb1409d2
1 /* 1 /*
2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2013, 2015, 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.
43 void CodeInstaller::pd_patch_OopConstant(int pc_offset, Handle& constant) { 43 void CodeInstaller::pd_patch_OopConstant(int pc_offset, Handle& constant) {
44 address pc = _instructions->start() + pc_offset; 44 address pc = _instructions->start() + pc_offset;
45 Handle obj = HotSpotObjectConstantImpl::object(constant); 45 Handle obj = HotSpotObjectConstantImpl::object(constant);
46 jobject value = JNIHandles::make_local(obj()); 46 jobject value = JNIHandles::make_local(obj());
47 if (HotSpotObjectConstantImpl::compressed(constant)) { 47 if (HotSpotObjectConstantImpl::compressed(constant)) {
48 fatal("unimplemented: narrow oop relocation"); 48 #ifdef _LP64
49 int oop_index = _oop_recorder->find_index(value);
50 RelocationHolder rspec = oop_Relocation::spec(oop_index);
51 _instructions->relocate(pc, rspec, 1);
52 #else
53 fatal("compressed oop on 32bit");
54 #endif
49 } else { 55 } else {
50 NativeMovConstReg* move = nativeMovConstReg_at(pc); 56 NativeMovConstReg* move = nativeMovConstReg_at(pc);
51 move->set_data((intptr_t) value); 57 move->set_data((intptr_t) value);
52 58
53 // We need two relocations: one on the sethi and one on the add. 59 // We need two relocations: one on the sethi and one on the add.