mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-25 22:04:51 +02:00
8075967: Zero interpreter asserts for SafeFetch<32,N> calls in ObjectMonitor
Implement SafeFetchX unsafely and make CanUseSafeFetchX false for Zero Reviewed-by: sgehwolf, dholmes
This commit is contained in:
parent
3e6cf09c39
commit
b115f80cb5
4 changed files with 29 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
|
* Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
|
@ -213,7 +213,7 @@ void frame::zero_print_on_error(int frame_index,
|
||||||
valuebuf[buflen - 1] = '\0';
|
valuebuf[buflen - 1] = '\0';
|
||||||
|
|
||||||
// Print the result
|
// Print the result
|
||||||
st->print_cr(" " PTR_FORMAT ": %-21s = %s", addr, fieldbuf, valuebuf);
|
st->print_cr(" " PTR_FORMAT ": %-21s = %s", p2i(addr), fieldbuf, valuebuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2009, 2010, 2011 Red Hat, Inc.
|
* Copyright 2009, 2010, 2011 Red Hat, Inc.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
|
@ -144,6 +144,7 @@ int MethodHandles::method_handle_entry_linkToVirtual(Method* method, intptr_t UN
|
||||||
oop recv = STACK_OBJECT(-numArgs);
|
oop recv = STACK_OBJECT(-numArgs);
|
||||||
Klass* clazz = recv->klass();
|
Klass* clazz = recv->klass();
|
||||||
Klass* klass_part = InstanceKlass::cast(clazz);
|
Klass* klass_part = InstanceKlass::cast(clazz);
|
||||||
|
ResourceMark rm(THREAD);
|
||||||
klassVtable* vtable = klass_part->vtable();
|
klassVtable* vtable = klass_part->vtable();
|
||||||
Method* vmtarget = vtable->method_at(vmindex);
|
Method* vmtarget = vtable->method_at(vmindex);
|
||||||
|
|
||||||
|
|
|
@ -176,6 +176,19 @@ class StubGenerator: public StubCodeGenerator {
|
||||||
StubRoutines::_oop_arraycopy;
|
StubRoutines::_oop_arraycopy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NYI: SafeFetch for Zero isn't actually safe.
|
||||||
|
static int SafeFetch32(int *adr, int errValue) {
|
||||||
|
int value = errValue;
|
||||||
|
value = *adr;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
static intptr_t SafeFetchN(intptr_t *adr, intptr_t errValue) {
|
||||||
|
intptr_t value = errValue;
|
||||||
|
value = *adr;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
void generate_initial() {
|
void generate_initial() {
|
||||||
// Generates all stubs and initializes the entry points
|
// Generates all stubs and initializes the entry points
|
||||||
|
|
||||||
|
@ -228,11 +241,11 @@ class StubGenerator: public StubCodeGenerator {
|
||||||
generate_arraycopy_stubs();
|
generate_arraycopy_stubs();
|
||||||
|
|
||||||
// Safefetch stubs.
|
// Safefetch stubs.
|
||||||
StubRoutines::_safefetch32_entry = NULL;
|
StubRoutines::_safefetch32_entry = CAST_FROM_FN_PTR(address, StubGenerator::SafeFetch32);
|
||||||
StubRoutines::_safefetch32_fault_pc = NULL;
|
StubRoutines::_safefetch32_fault_pc = NULL;
|
||||||
StubRoutines::_safefetch32_continuation_pc = NULL;
|
StubRoutines::_safefetch32_continuation_pc = NULL;
|
||||||
|
|
||||||
StubRoutines::_safefetchN_entry = NULL;
|
StubRoutines::_safefetchN_entry = CAST_FROM_FN_PTR(address, StubGenerator::SafeFetchN);
|
||||||
StubRoutines::_safefetchN_fault_pc = NULL;
|
StubRoutines::_safefetchN_fault_pc = NULL;
|
||||||
StubRoutines::_safefetchN_continuation_pc = NULL;
|
StubRoutines::_safefetchN_continuation_pc = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -450,7 +450,15 @@ inline intptr_t SafeFetchN(intptr_t* adr, intptr_t errValue) {
|
||||||
|
|
||||||
|
|
||||||
// returns true if SafeFetch32 and SafeFetchN can be used safely (stubroutines are already generated)
|
// returns true if SafeFetch32 and SafeFetchN can be used safely (stubroutines are already generated)
|
||||||
inline bool CanUseSafeFetch32() { return StubRoutines::SafeFetch32_stub() ? true : false; }
|
inline bool CanUseSafeFetch32() {
|
||||||
inline bool CanUseSafeFetchN() { return StubRoutines::SafeFetchN_stub() ? true : false; }
|
// All platforms have the stub but ZERO isn't safe.
|
||||||
|
assert(StubRoutines::SafeFetch32_stub() != NULL, "should have generated stub");
|
||||||
|
return NOT_ZERO(true) ZERO_ONLY(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool CanUseSafeFetchN() {
|
||||||
|
// All platforms have the stub but ZERO isn't safe.
|
||||||
|
assert(StubRoutines::SafeFetchN_stub() != NULL, "should have generated stub");
|
||||||
|
return NOT_ZERO(true) ZERO_ONLY(false);
|
||||||
|
}
|
||||||
#endif // SHARE_VM_RUNTIME_STUBROUTINES_HPP
|
#endif // SHARE_VM_RUNTIME_STUBROUTINES_HPP
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue