comparison src/share/vm/runtime/vframe_hp.cpp @ 6948:e522a00b91aa

Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
author Doug Simon <doug.simon@oracle.com>
date Mon, 12 Nov 2012 23:14:12 +0100
parents 957c266d8bc5 da91efe96a93
children b8f261ba79c6
comparison
equal deleted inserted replaced
6711:ae13cc658b80 6948:e522a00b91aa
1 /* 1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
200 200
201 GrowableArray<MonitorInfo*>* compiledVFrame::monitors() const { 201 GrowableArray<MonitorInfo*>* compiledVFrame::monitors() const {
202 // Natives has no scope 202 // Natives has no scope
203 if (scope() == NULL) { 203 if (scope() == NULL) {
204 nmethod* nm = code(); 204 nmethod* nm = code();
205 methodOop method = nm->method(); 205 Method* method = nm->method();
206 assert(method->is_native(), ""); 206 assert(method->is_native(), "");
207 if (!method->is_synchronized()) { 207 if (!method->is_synchronized()) {
208 return new GrowableArray<MonitorInfo*>(0); 208 return new GrowableArray<MonitorInfo*>(0);
209 } 209 }
210 // This monitor is really only needed for UseBiasedLocking, but 210 // This monitor is really only needed for UseBiasedLocking, but
230 if (ov->is_object() && owner_sv->obj_is_scalar_replaced()) { // The owner object was scalar replaced 230 if (ov->is_object() && owner_sv->obj_is_scalar_replaced()) { // The owner object was scalar replaced
231 assert(mv->eliminated(), "monitor should be eliminated for scalar replaced object"); 231 assert(mv->eliminated(), "monitor should be eliminated for scalar replaced object");
232 // Put klass for scalar replaced object. 232 // Put klass for scalar replaced object.
233 ScopeValue* kv = ((ObjectValue *)ov)->klass(); 233 ScopeValue* kv = ((ObjectValue *)ov)->klass();
234 assert(kv->is_constant_oop(), "klass should be oop constant for scalar replaced object"); 234 assert(kv->is_constant_oop(), "klass should be oop constant for scalar replaced object");
235 KlassHandle k(((ConstantOopReadValue*)kv)->value()()); 235 Handle k(((ConstantOopReadValue*)kv)->value()());
236 result->push(new MonitorInfo(k->as_klassOop(), resolve_monitor_lock(mv->basic_lock()), 236 assert(java_lang_Class::is_instance(k()), "must be");
237 result->push(new MonitorInfo(k(), resolve_monitor_lock(mv->basic_lock()),
237 mv->eliminated(), true)); 238 mv->eliminated(), true));
238 } else { 239 } else {
239 result->push(new MonitorInfo(owner_sv->get_obj()(), resolve_monitor_lock(mv->basic_lock()), 240 result->push(new MonitorInfo(owner_sv->get_obj()(), resolve_monitor_lock(mv->basic_lock()),
240 mv->eliminated(), false)); 241 mv->eliminated(), false));
241 } 242 }
271 nmethod* compiledVFrame::code() const { 272 nmethod* compiledVFrame::code() const {
272 return CodeCache::find_nmethod(_fr.pc()); 273 return CodeCache::find_nmethod(_fr.pc());
273 } 274 }
274 275
275 276
276 methodOop compiledVFrame::method() const { 277 Method* compiledVFrame::method() const {
277 if (scope() == NULL) { 278 if (scope() == NULL) {
278 // native nmethods have no scope the method is implied 279 // native nmethods have no scope the method is implied
279 nmethod* nm = code(); 280 nmethod* nm = code();
280 assert(nm->is_native_method(), "must be native"); 281 assert(nm->is_native_method(), "must be native");
281 return nm->method(); 282 return nm->method();
282 } 283 }
283 return scope()->method()(); 284 return scope()->method();
284 } 285 }
285 286
286 287
287 int compiledVFrame::bci() const { 288 int compiledVFrame::bci() const {
288 int raw = raw_bci(); 289 int raw = raw_bci();
322 ? vframe::sender() 323 ? vframe::sender()
323 : new compiledVFrame(&f, register_map(), thread(), scope()->sender()); 324 : new compiledVFrame(&f, register_map(), thread(), scope()->sender());
324 } 325 }
325 } 326 }
326 327
327 jvmtiDeferredLocalVariableSet::jvmtiDeferredLocalVariableSet(methodOop method, int bci, intptr_t* id) { 328 jvmtiDeferredLocalVariableSet::jvmtiDeferredLocalVariableSet(Method* method, int bci, intptr_t* id) {
328 _method = method; 329 _method = method;
329 _bci = bci; 330 _bci = bci;
330 _id = id; 331 _id = id;
331 // Alway will need at least one, must be on C heap 332 // Alway will need at least one, must be on C heap
332 _locals = new(ResourceObj::C_HEAP, mtCompiler) GrowableArray<jvmtiDeferredLocalVariable*> (1, true); 333 _locals = new(ResourceObj::C_HEAP, mtCompiler) GrowableArray<jvmtiDeferredLocalVariable*> (1, true);
357 } 358 }
358 locals()->push(new jvmtiDeferredLocalVariable(idx, type, val)); 359 locals()->push(new jvmtiDeferredLocalVariable(idx, type, val));
359 } 360 }
360 361
361 void jvmtiDeferredLocalVariableSet::oops_do(OopClosure* f) { 362 void jvmtiDeferredLocalVariableSet::oops_do(OopClosure* f) {
362 363 // The Method* is on the stack so a live activation keeps it alive
363 f->do_oop((oop*) &_method); 364 // either by mirror in interpreter or code in compiled code.
364 for ( int i = 0; i < locals()->length(); i++ ) { 365 for ( int i = 0; i < locals()->length(); i++ ) {
365 if ( locals()->at(i)->type() == T_OBJECT) { 366 if ( locals()->at(i)->type() == T_OBJECT) {
366 f->do_oop(locals()->at(i)->oop_addr()); 367 f->do_oop(locals()->at(i)->oop_addr());
367 } 368 }
368 } 369 }