Mercurial > hg > graal-compiler
comparison src/share/vm/runtime/vframe.cpp @ 20806:6ee9b878902b
Fix merge mess-ups
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Tue, 07 Apr 2015 18:57:02 +0200 |
parents | 7848fc12602b |
children | be896a1983c0 |
comparison
equal
deleted
inserted
replaced
20805:379471b334cb | 20806:6ee9b878902b |
---|---|
325 addr = NULL; | 325 addr = NULL; |
326 } | 326 } |
327 | 327 |
328 StackValue* const sv = create_stack_value_from_oop_map(oop_mask, | 328 StackValue* const sv = create_stack_value_from_oop_map(oop_mask, |
329 i + max_locals, | 329 i + max_locals, |
330 | 330 addr); |
331 StackValueCollection* interpretedVFrame::expressions() const { | 331 assert(sv != NULL, "sanity check"); |
332 int length = fr().interpreter_frame_expression_stack_size(); | 332 |
333 if (method()->is_native()) { | 333 result->add(sv); |
334 // If the method is native, there is no expression stack | 334 } |
335 length = 0; | 335 } |
336 } | 336 |
337 | 337 StackValueCollection* interpretedVFrame::locals() const { |
338 int nof_locals = method()->max_locals(); | 338 return stack_data(false); |
339 StackValueCollection* result = new StackValueCollection(length); | 339 } |
340 | |
341 StackValueCollection* interpretedVFrame::expressions() const { | |
342 return stack_data(true); | |
343 } | |
344 | |
345 /* | |
346 * Worker routine for fetching references and/or values | |
347 * for a particular bci in the interpretedVFrame. | |
348 * | |
349 * Returns data for either "locals" or "expressions", | |
350 * using bci relative oop_map (oop_mask) information. | |
351 * | |
352 * @param expressions bool switch controlling what data to return | |
353 (false == locals / true == expressions) | |
354 * | |
355 */ | |
356 StackValueCollection* interpretedVFrame::stack_data(bool expressions) const { | |
340 | 357 |
341 InterpreterOopMap oop_mask; | 358 InterpreterOopMap oop_mask; |
342 // Get oopmap describing oops and int for current bci | 359 // oopmap for current bci |
343 if (TraceDeoptimization && Verbose) { | 360 if ((TraceDeoptimization && Verbose) GRAAL_ONLY( || PrintDeoptimizationDetails)) { |
344 methodHandle m_h(method()); | 361 methodHandle m_h(Thread::current(), method()); |
345 OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask); | 362 OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask); |
346 } else { | 363 } else { |
347 method()->mask_for(bci(), &oop_mask); | 364 method()->mask_for(bci(), &oop_mask); |
348 } | 365 } |
349 // handle expressions | 366 |
350 for(int i=0; i < length; i++) { | 367 const int mask_len = oop_mask.number_of_entries(); |
351 // Find stack location | 368 |
352 intptr_t *addr = fr().interpreter_frame_expression_stack_at(i); | 369 // If the method is native, method()->max_locals() is not telling the truth. |
353 | |
354 // Depending on oop/int put it in the right package | |
355 StackValue *sv; | |
356 if (oop_mask.is_oop(i + nof_locals)) { | |
357 // oop value | |
358 Handle h(*(oop *)addr); | |
359 sv = new StackValue(h); | |
360 } else { | |
361 // integer | |
362 sv = new StackValue(*addr); | |
363 } | |
364 assert(sv != NULL, "sanity check"); | |
365 result->add(sv); | |
366 } | |
367 return result; | |
368 } | |
369 | |
370 // For our purposes, max locals instead equals the size of parameters. | 370 // For our purposes, max locals instead equals the size of parameters. |
371 const int max_locals = method()->is_native() ? | 371 const int max_locals = method()->is_native() ? |
372 method()->size_of_parameters() : method()->max_locals(); | 372 method()->size_of_parameters() : method()->max_locals(); |
373 | 373 |
374 assert(mask_len >= max_locals, "invariant"); | 374 assert(mask_len >= max_locals, "invariant"); |