315 void NativeMovRegMem::verify() {
316 #ifdef ASSERT
317 address dest = MacroAssembler::target_addr_for_insn(instruction_address());
318 #endif
319 }
320
321 //--------------------------------------------------------------------------------
322
323 void NativeJump::verify() { ; }
324
325
326 void NativeJump::check_verified_entry_alignment(address entry, address verified_entry) {
327 }
328
329
330 address NativeJump::jump_destination() const {
331 address dest = MacroAssembler::target_addr_for_insn(instruction_address());
332
333 // We use jump to self as the unresolved address which the inline
334 // cache code (and relocs) know about
335
336 // return -1 if jump to self
337 dest = (dest == (address) this) ? (address) -1 : dest;
338 return dest;
339 }
340
341 void NativeJump::set_jump_destination(address dest) {
342 // We use jump to self as the unresolved address which the inline
343 // cache code (and relocs) know about
344 if (dest == (address) -1)
345 dest = instruction_address();
346
347 MacroAssembler::pd_patch_instruction(instruction_address(), dest);
348 ICache::invalidate_range(instruction_address(), instruction_size);
349 };
350
351 //-------------------------------------------------------------------
352
353 address NativeGeneralJump::jump_destination() const {
354 NativeMovConstReg* move = nativeMovConstReg_at(instruction_address());
355 address dest = (address) move->data();
356
357 // We use jump to self as the unresolved address which the inline
358 // cache code (and relocs) know about
359
360 // return -1 if jump to self
361 dest = (dest == (address) this) ? (address) -1 : dest;
362 return dest;
363 }
364
365 void NativeGeneralJump::set_jump_destination(address dest) {
366 NativeMovConstReg* move = nativeMovConstReg_at(instruction_address());
367
368 // We use jump to self as the unresolved address which the inline
369 // cache code (and relocs) know about
370 if (dest == (address) -1) {
371 dest = instruction_address();
372 }
373
374 move->set_data((uintptr_t) dest);
375 };
376
377 //-------------------------------------------------------------------
378
379 bool NativeInstruction::is_safepoint_poll() {
380 // a safepoint_poll is implemented in two steps as either
381 //
|
315 void NativeMovRegMem::verify() {
316 #ifdef ASSERT
317 address dest = MacroAssembler::target_addr_for_insn(instruction_address());
318 #endif
319 }
320
321 //--------------------------------------------------------------------------------
322
323 void NativeJump::verify() { ; }
324
325
326 void NativeJump::check_verified_entry_alignment(address entry, address verified_entry) {
327 }
328
329
330 address NativeJump::jump_destination() const {
331 address dest = MacroAssembler::target_addr_for_insn(instruction_address());
332
333 // We use jump to self as the unresolved address which the inline
334 // cache code (and relocs) know about
335 // As a special case we also use sequence movptr(r,0); br(r);
336 // i.e. jump to 0 when we need leave space for a wide immediate
337 // load
338
339 // return -1 if jump to self or to 0
340 if ((dest == (address)this) || dest == 0) {
341 dest = (address) -1;
342 }
343 return dest;
344 }
345
346 void NativeJump::set_jump_destination(address dest) {
347 // We use jump to self as the unresolved address which the inline
348 // cache code (and relocs) know about
349 if (dest == (address) -1)
350 dest = instruction_address();
351
352 MacroAssembler::pd_patch_instruction(instruction_address(), dest);
353 ICache::invalidate_range(instruction_address(), instruction_size);
354 };
355
356 //-------------------------------------------------------------------
357
358 address NativeGeneralJump::jump_destination() const {
359 NativeMovConstReg* move = nativeMovConstReg_at(instruction_address());
360 address dest = (address) move->data();
361
362 // We use jump to self as the unresolved address which the inline
363 // cache code (and relocs) know about
364 // As a special case we also use jump to 0 when first generating
365 // a general jump
366
367 // return -1 if jump to self or to 0
368 if ((dest == (address)this) || dest == 0) {
369 dest = (address) -1;
370 }
371 return dest;
372 }
373
374 void NativeGeneralJump::set_jump_destination(address dest) {
375 NativeMovConstReg* move = nativeMovConstReg_at(instruction_address());
376
377 // We use jump to self as the unresolved address which the inline
378 // cache code (and relocs) know about
379 if (dest == (address) -1) {
380 dest = instruction_address();
381 }
382
383 move->set_data((uintptr_t) dest);
384 };
385
386 //-------------------------------------------------------------------
387
388 bool NativeInstruction::is_safepoint_poll() {
389 // a safepoint_poll is implemented in two steps as either
390 //
|