< prev index next >

src/hotspot/share/runtime/stackValue.cpp

Print this page
rev 59103 : imported patch hotspot


  24 
  25 #include "precompiled.hpp"
  26 #include "code/debugInfo.hpp"
  27 #include "oops/compressedOops.inline.hpp"
  28 #include "oops/oop.hpp"
  29 #include "runtime/frame.inline.hpp"
  30 #include "runtime/handles.inline.hpp"
  31 #include "runtime/stackValue.hpp"
  32 #if INCLUDE_ZGC
  33 #include "gc/z/zBarrier.inline.hpp"
  34 #endif
  35 #if INCLUDE_SHENANDOAHGC
  36 #include "gc/shenandoah/shenandoahBarrierSet.hpp"
  37 #endif
  38 
  39 StackValue* StackValue::create_stack_value(const frame* fr, const RegisterMap* reg_map, ScopeValue* sv) {
  40   if (sv->is_location()) {
  41     // Stack or register value
  42     Location loc = ((LocationValue *)sv)->location();
  43 
  44 #ifdef SPARC
  45     // %%%%% Callee-save floats will NOT be working on a Sparc until we
  46     // handle the case of a 2 floats in a single double register.
  47     assert( !(loc.is_register() && loc.type() == Location::float_in_dbl), "Sparc does not handle callee-save floats yet" );
  48 #endif // SPARC
  49 
  50     // First find address of value
  51 
  52     address value_addr = loc.is_register()
  53       // Value was in a callee-save register
  54       ? reg_map->location(VMRegImpl::as_VMReg(loc.register_number()))
  55       // Else value was directly saved on the stack. The frame's original stack pointer,
  56       // before any extension by its callee (due to Compiler1 linkage on SPARC), must be used.
  57       : ((address)fr->unextended_sp()) + loc.stack_offset();
  58 
  59     // Then package it right depending on type
  60     // Note: the transfer of the data is thru a union that contains
  61     // an intptr_t. This is because an interpreter stack slot is
  62     // really an intptr_t. The use of a union containing an intptr_t
  63     // ensures that on a 64 bit platform we have proper alignment
  64     // and that we store the value where the interpreter will expect
  65     // to find it (i.e. proper endian). Similarly on a 32bit platform
  66     // using the intptr_t ensures that when a value is larger than
  67     // a stack slot (jlong/jdouble) that we capture the proper part
  68     // of the value for the stack slot in question.
  69     //




  24 
  25 #include "precompiled.hpp"
  26 #include "code/debugInfo.hpp"
  27 #include "oops/compressedOops.inline.hpp"
  28 #include "oops/oop.hpp"
  29 #include "runtime/frame.inline.hpp"
  30 #include "runtime/handles.inline.hpp"
  31 #include "runtime/stackValue.hpp"
  32 #if INCLUDE_ZGC
  33 #include "gc/z/zBarrier.inline.hpp"
  34 #endif
  35 #if INCLUDE_SHENANDOAHGC
  36 #include "gc/shenandoah/shenandoahBarrierSet.hpp"
  37 #endif
  38 
  39 StackValue* StackValue::create_stack_value(const frame* fr, const RegisterMap* reg_map, ScopeValue* sv) {
  40   if (sv->is_location()) {
  41     // Stack or register value
  42     Location loc = ((LocationValue *)sv)->location();
  43 






  44     // First find address of value
  45 
  46     address value_addr = loc.is_register()
  47       // Value was in a callee-save register
  48       ? reg_map->location(VMRegImpl::as_VMReg(loc.register_number()))
  49       // Else value was directly saved on the stack. The frame's original stack pointer,
  50       // before any extension by its callee (due to Compiler1 linkage on SPARC), must be used.
  51       : ((address)fr->unextended_sp()) + loc.stack_offset();
  52 
  53     // Then package it right depending on type
  54     // Note: the transfer of the data is thru a union that contains
  55     // an intptr_t. This is because an interpreter stack slot is
  56     // really an intptr_t. The use of a union containing an intptr_t
  57     // ensures that on a 64 bit platform we have proper alignment
  58     // and that we store the value where the interpreter will expect
  59     // to find it (i.e. proper endian). Similarly on a 32bit platform
  60     // using the intptr_t ensures that when a value is larger than
  61     // a stack slot (jlong/jdouble) that we capture the proper part
  62     // of the value for the stack slot in question.
  63     //


< prev index next >