342 __ ret(0);
343 }
344
345 #endif // COMPILER1
346
347 #undef __
348 #define __ cgen->assembler()->
349
350 // Generates a register specific stub for calling
351 // ZBarrierSetRuntime::load_barrier_on_oop_field_preloaded() or
352 // ZBarrierSetRuntime::load_barrier_on_weak_oop_field_preloaded().
353 //
354 // The raddr register serves as both input and output for this stub. When the stub is
355 // called the raddr register contains the object field address (oop*) where the bad oop
356 // was loaded from, which caused the slow path to be taken. On return from the stub the
357 // raddr register contains the good/healed oop returned from
358 // ZBarrierSetRuntime::load_barrier_on_oop_field_preloaded() or
359 // ZBarrierSetRuntime::load_barrier_on_weak_oop_field_preloaded().
360 static address generate_load_barrier_stub(StubCodeGenerator* cgen, Register raddr, DecoratorSet decorators) {
361 // Don't generate stub for invalid registers
362 if (raddr == rsp || raddr == r12 || raddr == r15) {
363 return NULL;
364 }
365
366 // Create stub name
367 char name[64];
368 const bool weak = (decorators & ON_WEAK_OOP_REF) != 0;
369 os::snprintf(name, sizeof(name), "zgc_load_barrier%s_stub_%s", weak ? "_weak" : "", raddr->name());
370
371 __ align(CodeEntryAlignment);
372 StubCodeMark mark(cgen, "StubRoutines", os::strdup(name, mtCode));
373 address start = __ pc();
374
375 // Save live registers
376 if (raddr != rax) {
377 __ push(rax);
378 }
379 if (raddr != rcx) {
380 __ push(rcx);
381 }
382 if (raddr != rdx) {
|
342 __ ret(0);
343 }
344
345 #endif // COMPILER1
346
347 #undef __
348 #define __ cgen->assembler()->
349
350 // Generates a register specific stub for calling
351 // ZBarrierSetRuntime::load_barrier_on_oop_field_preloaded() or
352 // ZBarrierSetRuntime::load_barrier_on_weak_oop_field_preloaded().
353 //
354 // The raddr register serves as both input and output for this stub. When the stub is
355 // called the raddr register contains the object field address (oop*) where the bad oop
356 // was loaded from, which caused the slow path to be taken. On return from the stub the
357 // raddr register contains the good/healed oop returned from
358 // ZBarrierSetRuntime::load_barrier_on_oop_field_preloaded() or
359 // ZBarrierSetRuntime::load_barrier_on_weak_oop_field_preloaded().
360 static address generate_load_barrier_stub(StubCodeGenerator* cgen, Register raddr, DecoratorSet decorators) {
361 // Don't generate stub for invalid registers
362 if (raddr == rsp || raddr == r15) {
363 return NULL;
364 }
365
366 // Create stub name
367 char name[64];
368 const bool weak = (decorators & ON_WEAK_OOP_REF) != 0;
369 os::snprintf(name, sizeof(name), "zgc_load_barrier%s_stub_%s", weak ? "_weak" : "", raddr->name());
370
371 __ align(CodeEntryAlignment);
372 StubCodeMark mark(cgen, "StubRoutines", os::strdup(name, mtCode));
373 address start = __ pc();
374
375 // Save live registers
376 if (raddr != rax) {
377 __ push(rax);
378 }
379 if (raddr != rcx) {
380 __ push(rcx);
381 }
382 if (raddr != rdx) {
|