< prev index next >

src/hotspot/cpu/aarch64/abstractInterpreter_aarch64.cpp

Print this page

106 
107   return size;
108 }
109 
110 void AbstractInterpreter::layout_activation(Method* method,
111                                             int tempcount,
112                                             int popframe_extra_args,
113                                             int moncount,
114                                             int caller_actual_parameters,
115                                             int callee_param_count,
116                                             int callee_locals,
117                                             frame* caller,
118                                             frame* interpreter_frame,
119                                             bool is_top_frame,
120                                             bool is_bottom_frame) {
121   // The frame interpreter_frame is guaranteed to be the right size,
122   // as determined by a previous call to the size_activation() method.
123   // It is also guaranteed to be walkable even though it is in a
124   // skeletal state
125 
126   int max_locals = method->max_locals() * Interpreter::stackElementWords;
127   int extra_locals = (method->max_locals() - method->size_of_parameters()) *
128     Interpreter::stackElementWords;
129 
130 #ifdef ASSERT
131   assert(caller->sp() == interpreter_frame->sender_sp(), "Frame not properly walkable");
132 #endif
133 
134   interpreter_frame->interpreter_frame_set_method(method);
135   // NOTE the difference in using sender_sp and
136   // interpreter_frame_sender_sp interpreter_frame_sender_sp is
137   // the original sp of the caller (the unextended_sp) and
138   // sender_sp is fp+8/16 (32bit/64bit) XXX
139   //
140   // The interpreted method entry on AArch64 aligns SP to 16 bytes
141   // before generating the fixed part of the activation frame. So there
142   // may be a gap between the locals block and the saved sender SP. For
143   // an interpreted caller we need to recreate this gap and exactly
144   // align the incoming parameters with the caller's temporary
145   // expression stack. For other types of caller frame it doesn't
146   // matter.
147   intptr_t* locals;
148   if (caller->is_interpreted_frame()) {
149     locals = caller->interpreter_frame_last_sp() + caller_actual_parameters - 1;
150   } else {
151     locals = interpreter_frame->sender_sp() + max_locals - 1;
152   }
153 
154 #ifdef ASSERT
155   if (caller->is_interpreted_frame()) {
156     assert(locals < caller->fp() + frame::interpreter_frame_initial_sp_offset, "bad placement");
157   }
158 #endif
159 
160   interpreter_frame->interpreter_frame_set_locals(locals);
161   BasicObjectLock* montop = interpreter_frame->interpreter_frame_monitor_begin();
162   BasicObjectLock* monbot = montop - moncount;
163   interpreter_frame->interpreter_frame_set_monitor_end(monbot);
164 
165   // Set last_sp
166   intptr_t*  esp = (intptr_t*) monbot -
167     tempcount*Interpreter::stackElementWords -
168     popframe_extra_args;
169   interpreter_frame->interpreter_frame_set_last_sp(esp);
170 
171   // All frames but the initial (oldest) interpreter frame we fill in have
172   // a value for sender_sp that allows walking the stack but isn't
173   // truly correct. Correct the value here.
174   if (extra_locals != 0 &&
175       interpreter_frame->sender_sp() ==
176       interpreter_frame->interpreter_frame_sender_sp()) {
177     interpreter_frame->set_interpreter_frame_sender_sp(caller->sp() +
178                                                        extra_locals);
179   }
180   *interpreter_frame->interpreter_frame_cache_addr() =
181     method->constants()->cache();
182   *interpreter_frame->interpreter_frame_mirror_addr() =
183     method->method_holder()->java_mirror();
184 }

106 
107   return size;
108 }
109 
110 void AbstractInterpreter::layout_activation(Method* method,
111                                             int tempcount,
112                                             int popframe_extra_args,
113                                             int moncount,
114                                             int caller_actual_parameters,
115                                             int callee_param_count,
116                                             int callee_locals,
117                                             frame* caller,
118                                             frame* interpreter_frame,
119                                             bool is_top_frame,
120                                             bool is_bottom_frame) {
121   // The frame interpreter_frame is guaranteed to be the right size,
122   // as determined by a previous call to the size_activation() method.
123   // It is also guaranteed to be walkable even though it is in a
124   // skeletal state
125 
126   const int max_locals = method->max_locals() * Interpreter::stackElementWords;
127   const int params = method->size_of_parameters() * Interpreter::stackElementWords;
128   const int extra_locals = max_locals - params;
129 
130 #ifdef ASSERT
131   assert(caller->sp() == interpreter_frame->sender_sp(), "Frame not properly walkable");
132 #endif
133 
134   interpreter_frame->interpreter_frame_set_method(method);
135   // NOTE the difference in using sender_sp and
136   // interpreter_frame_sender_sp interpreter_frame_sender_sp is
137   // the original sp of the caller (the unextended_sp) and
138   // sender_sp is fp+8/16 (32bit/64bit) XXX
139   //
140   // The interpreted method entry on AArch64 aligns SP to 16 bytes
141   // before generating the fixed part of the activation frame. So there
142   // may be a gap between the locals block and the saved sender SP. For
143   // an interpreted caller we need to recreate this gap and exactly
144   // align the incoming parameters with the caller's temporary
145   // expression stack. For other types of caller frame it doesn't
146   // matter.
147   intptr_t* const locals = caller->is_interpreted_frame()
148     ? caller->interpreter_frame_last_sp() + caller_actual_parameters - 1
149     : interpreter_frame->sender_sp() + max_locals - 1;



150 
151 #ifdef ASSERT
152   if (caller->is_interpreted_frame()) {
153     assert(locals < caller->fp() + frame::interpreter_frame_initial_sp_offset, "bad placement");
154   }
155 #endif
156 
157   interpreter_frame->interpreter_frame_set_locals(locals);
158   BasicObjectLock* montop = interpreter_frame->interpreter_frame_monitor_begin();
159   BasicObjectLock* monbot = montop - moncount;
160   interpreter_frame->interpreter_frame_set_monitor_end(monbot);
161 
162   // Set last_sp
163   intptr_t*  esp = (intptr_t*) monbot -
164     tempcount*Interpreter::stackElementWords -
165     popframe_extra_args;
166   interpreter_frame->interpreter_frame_set_last_sp(esp);
167 
168   // All frames but the initial (oldest) interpreter frame we fill in have
169   // a value for sender_sp that allows walking the stack but isn't
170   // truly correct. Correct the value here.
171   if (extra_locals != 0 && interpreter_frame->sender_sp() == interpreter_frame->interpreter_frame_sender_sp()) {
172     interpreter_frame->set_interpreter_frame_sender_sp(caller->sp() + extra_locals);



173   }
174 
175   *interpreter_frame->interpreter_frame_cache_addr()  = method->constants()->cache();
176   *interpreter_frame->interpreter_frame_mirror_addr() = method->method_holder()->java_mirror();

177 }
< prev index next >