|
1 | 1 | /*
|
2 |
| - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
|
4 | 4 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
5 | 5 | *
|
@@ -221,13 +221,13 @@ address NativeMovConstReg::set_data_plain(intptr_t data, CodeBlob *cb) {
|
221 | 221 | // A calculation relative to the global TOC.
|
222 | 222 | if (MacroAssembler::get_address_of_calculate_address_from_global_toc_at(addr, cb->content_begin()) !=
|
223 | 223 | (address)data) {
|
224 |
| - const int invalidated_range = |
225 |
| - MacroAssembler::patch_calculate_address_from_global_toc_at(addr, cb->content_begin(), |
| 224 | + const address inst2_addr = addr; |
| 225 | + const address inst1_addr = |
| 226 | + MacroAssembler::patch_calculate_address_from_global_toc_at(inst2_addr, cb->content_begin(), |
226 | 227 | (address)data);
|
227 |
| - const address start = invalidated_range < 0 ? addr + invalidated_range : addr; |
228 |
| - // FIXME: |
229 |
| - const int range = invalidated_range < 0 ? 4 - invalidated_range : 8; |
230 |
| - ICache::ppc64_flush_icache_bytes(start, range); |
| 228 | + assert(inst1_addr != NULL && inst1_addr < inst2_addr, "first instruction must be found"); |
| 229 | + const int range = inst2_addr - inst1_addr + BytesPerInstWord; |
| 230 | + ICache::ppc64_flush_icache_bytes(inst1_addr, range); |
231 | 231 | }
|
232 | 232 | next_address = addr + 1 * BytesPerInstWord;
|
233 | 233 | } else if (MacroAssembler::is_load_const_at(addr)) {
|
@@ -288,15 +288,15 @@ void NativeMovConstReg::set_data(intptr_t data) {
|
288 | 288 | }
|
289 | 289 |
|
290 | 290 | void NativeMovConstReg::set_narrow_oop(narrowOop data, CodeBlob *code /* = NULL */) {
|
291 |
| - address addr = addr_at(0); |
| 291 | + address inst2_addr = addr_at(0); |
292 | 292 | CodeBlob* cb = (code) ? code : CodeCache::find_blob(instruction_address());
|
293 |
| - if (MacroAssembler::get_narrow_oop(addr, cb->content_begin()) == (long)data) return; |
294 |
| - const int invalidated_range = |
295 |
| - MacroAssembler::patch_set_narrow_oop(addr, cb->content_begin(), (long)data); |
296 |
| - const address start = invalidated_range < 0 ? addr + invalidated_range : addr; |
297 |
| - // FIXME: |
298 |
| - const int range = invalidated_range < 0 ? 4 - invalidated_range : 8; |
299 |
| - ICache::ppc64_flush_icache_bytes(start, range); |
| 293 | + if (MacroAssembler::get_narrow_oop(inst2_addr, cb->content_begin()) == (long)data) |
| 294 | + return; |
| 295 | + const address inst1_addr = |
| 296 | + MacroAssembler::patch_set_narrow_oop(inst2_addr, cb->content_begin(), (long)data); |
| 297 | + assert(inst1_addr != NULL && inst1_addr < inst2_addr, "first instruction must be found"); |
| 298 | + const int range = inst2_addr - inst1_addr + BytesPerInstWord; |
| 299 | + ICache::ppc64_flush_icache_bytes(inst1_addr, range); |
300 | 300 | }
|
301 | 301 |
|
302 | 302 | // Do not use an assertion here. Let clients decide whether they only
|
|
0 commit comments