8256497: Zero: enable G1 and Shenandoah GCs

Reviewed-by: rkennke, erikj, ihse
This commit is contained in:
Aleksey Shipilev 2020-11-22 18:10:04 +00:00
parent 037e49cf57
commit e06a68397d
5 changed files with 56 additions and 18 deletions

View file

@ -31,6 +31,7 @@
#include "interpreter/zero/bytecodeInterpreter.hpp"
#include "interpreter/zero/zeroInterpreter.hpp"
#include "interpreter/zero/zeroInterpreterGenerator.hpp"
#include "oops/access.inline.hpp"
#include "oops/cpCache.inline.hpp"
#include "oops/methodData.hpp"
#include "oops/method.hpp"
@ -120,6 +121,28 @@ int ZeroInterpreter::normal_entry(Method* method, intptr_t UNUSED, TRAPS) {
return 0;
}
int ZeroInterpreter::Reference_get_entry(Method* method, intptr_t UNUSED, TRAPS) {
JavaThread* thread = THREAD->as_Java_thread();
ZeroStack* stack = thread->zero_stack();
intptr_t* topOfStack = stack->sp();
oop ref = STACK_OBJECT(0);
// Shortcut if reference is known NULL
if (ref == NULL) {
return normal_entry(method, 0, THREAD);
}
// Read the referent with weaker semantics, and let GCs handle the rest.
const int referent_offset = java_lang_ref_Reference::referent_offset();
oop obj = HeapAccess<IN_HEAP | ON_WEAK_OOP_REF>::oop_load_at(ref, referent_offset);
SET_STACK_OBJECT(obj, 0);
// No deoptimized frames on the stack
return 0;
}
intptr_t narrow(BasicType type, intptr_t result) {
// mask integer result to narrower return type.
switch (type) {