annotate src/share/vm/interpreter/interpreter.cpp @ 3672:b31471cdc53e

7200163: add CodeComments functionality to assember stubs Summary: Pass the codeBuffer to the Stub constructor, and adapts the disassembler to print the comments. Reviewed-by: jrose, kvn, twisti Contributed-by: goetz.lindenmaier@sap.com
author kvn
date Mon, 24 Sep 2012 10:30:14 -0700
parents da91efe96a93
children a3e2f723f2a5
rev   line source
duke@0 1 /*
coleenp@3602 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
duke@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 *
duke@0 5 * This code is free software; you can redistribute it and/or modify it
duke@0 6 * under the terms of the GNU General Public License version 2 only, as
duke@0 7 * published by the Free Software Foundation.
duke@0 8 *
duke@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@0 13 * accompanied this code).
duke@0 14 *
duke@0 15 * You should have received a copy of the GNU General Public License version
duke@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 18 *
trims@1472 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1472 20 * or visit www.oracle.com if you need additional information or have any
trims@1472 21 * questions.
duke@0 22 *
duke@0 23 */
duke@0 24
stefank@1879 25 #include "precompiled.hpp"
stefank@1879 26 #include "asm/assembler.hpp"
stefank@1879 27 #include "interpreter/bytecodeHistogram.hpp"
stefank@1879 28 #include "interpreter/bytecodeInterpreter.hpp"
stefank@1879 29 #include "interpreter/interpreter.hpp"
stefank@1879 30 #include "interpreter/interpreterRuntime.hpp"
stefank@1879 31 #include "interpreter/templateTable.hpp"
stefank@1879 32 #include "memory/allocation.inline.hpp"
stefank@1879 33 #include "memory/resourceArea.hpp"
stefank@1879 34 #include "oops/arrayOop.hpp"
coleenp@3602 35 #include "oops/methodData.hpp"
coleenp@3602 36 #include "oops/method.hpp"
stefank@1879 37 #include "oops/oop.inline.hpp"
stefank@1879 38 #include "prims/forte.hpp"
stefank@1879 39 #include "prims/jvmtiExport.hpp"
twisti@3534 40 #include "prims/methodHandles.hpp"
stefank@1879 41 #include "runtime/handles.inline.hpp"
stefank@1879 42 #include "runtime/sharedRuntime.hpp"
stefank@1879 43 #include "runtime/stubRoutines.hpp"
stefank@1879 44 #include "runtime/timer.hpp"
duke@0 45
duke@0 46 # define __ _masm->
duke@0 47
duke@0 48
duke@0 49 //------------------------------------------------------------------------------------------------------------------------
duke@0 50 // Implementation of InterpreterCodelet
duke@0 51
duke@0 52 void InterpreterCodelet::initialize(const char* description, Bytecodes::Code bytecode) {
duke@0 53 _description = description;
duke@0 54 _bytecode = bytecode;
duke@0 55 }
duke@0 56
duke@0 57
duke@0 58 void InterpreterCodelet::verify() {
duke@0 59 }
duke@0 60
duke@0 61
bobv@1601 62 void InterpreterCodelet::print_on(outputStream* st) const {
kvn@3672 63 ttyLocker ttyl;
kvn@3672 64
duke@0 65 if (PrintInterpreter) {
bobv@1601 66 st->cr();
bobv@1601 67 st->print_cr("----------------------------------------------------------------------");
duke@0 68 }
duke@0 69
bobv@1601 70 if (description() != NULL) st->print("%s ", description());
bobv@1601 71 if (bytecode() >= 0 ) st->print("%d %s ", bytecode(), Bytecodes::name(bytecode()));
bobv@1601 72 st->print_cr("[" INTPTR_FORMAT ", " INTPTR_FORMAT "] %d bytes",
duke@0 73 code_begin(), code_end(), code_size());
duke@0 74
duke@0 75 if (PrintInterpreter) {
bobv@1601 76 st->cr();
kvn@3672 77 Disassembler::decode(code_begin(), code_end(), st, DEBUG_ONLY(_comments) NOT_DEBUG(CodeComments()));
duke@0 78 }
duke@0 79 }
duke@0 80
duke@0 81
duke@0 82 //------------------------------------------------------------------------------------------------------------------------
duke@0 83 // Implementation of platform independent aspects of Interpreter
duke@0 84
duke@0 85 void AbstractInterpreter::initialize() {
duke@0 86 if (_code != NULL) return;
duke@0 87
duke@0 88 // make sure 'imported' classes are initialized
duke@0 89 if (CountBytecodes || TraceBytecodes || StopInterpreterAt) BytecodeCounter::reset();
duke@0 90 if (PrintBytecodeHistogram) BytecodeHistogram::reset();
duke@0 91 if (PrintBytecodePairHistogram) BytecodePairHistogram::reset();
duke@0 92
duke@0 93 InvocationCounter::reinitialize(DelayCompilationDuringStartup);
duke@0 94
duke@0 95 }
duke@0 96
duke@0 97 void AbstractInterpreter::print() {
duke@0 98 tty->cr();
duke@0 99 tty->print_cr("----------------------------------------------------------------------");
duke@0 100 tty->print_cr("Interpreter");
duke@0 101 tty->cr();
duke@0 102 tty->print_cr("code size = %6dK bytes", (int)_code->used_space()/1024);
duke@0 103 tty->print_cr("total space = %6dK bytes", (int)_code->total_space()/1024);
duke@0 104 tty->print_cr("wasted space = %6dK bytes", (int)_code->available_space()/1024);
duke@0 105 tty->cr();
duke@0 106 tty->print_cr("# of codelets = %6d" , _code->number_of_stubs());
duke@0 107 tty->print_cr("avg codelet size = %6d bytes", _code->used_space() / _code->number_of_stubs());
duke@0 108 tty->cr();
duke@0 109 _code->print();
duke@0 110 tty->print_cr("----------------------------------------------------------------------");
duke@0 111 tty->cr();
duke@0 112 }
duke@0 113
duke@0 114
duke@0 115 void interpreter_init() {
duke@0 116 Interpreter::initialize();
duke@0 117 #ifndef PRODUCT
duke@0 118 if (TraceBytecodes) BytecodeTracer::set_closure(BytecodeTracer::std_closure());
duke@0 119 #endif // PRODUCT
duke@0 120 // need to hit every safepoint in order to call zapping routine
duke@0 121 // register the interpreter
duke@0 122 Forte::register_stub(
duke@0 123 "Interpreter",
duke@0 124 AbstractInterpreter::code()->code_start(),
duke@0 125 AbstractInterpreter::code()->code_end()
duke@0 126 );
duke@0 127
duke@0 128 // notify JVMTI profiler
duke@0 129 if (JvmtiExport::should_post_dynamic_code_generated()) {
duke@0 130 JvmtiExport::post_dynamic_code_generated("Interpreter",
duke@0 131 AbstractInterpreter::code()->code_start(),
duke@0 132 AbstractInterpreter::code()->code_end());
duke@0 133 }
duke@0 134 }
duke@0 135
duke@0 136 //------------------------------------------------------------------------------------------------------------------------
duke@0 137 // Implementation of interpreter
duke@0 138
duke@0 139 StubQueue* AbstractInterpreter::_code = NULL;
duke@0 140 bool AbstractInterpreter::_notice_safepoints = false;
duke@0 141 address AbstractInterpreter::_rethrow_exception_entry = NULL;
duke@0 142
duke@0 143 address AbstractInterpreter::_native_entry_begin = NULL;
duke@0 144 address AbstractInterpreter::_native_entry_end = NULL;
duke@0 145 address AbstractInterpreter::_slow_signature_handler;
duke@0 146 address AbstractInterpreter::_entry_table [AbstractInterpreter::number_of_method_entries];
duke@0 147 address AbstractInterpreter::_native_abi_to_tosca [AbstractInterpreter::number_of_result_handlers];
duke@0 148
duke@0 149 //------------------------------------------------------------------------------------------------------------------------
duke@0 150 // Generation of complete interpreter
duke@0 151
duke@0 152 AbstractInterpreterGenerator::AbstractInterpreterGenerator(StubQueue* _code) {
duke@0 153 _masm = NULL;
duke@0 154 }
duke@0 155
duke@0 156
duke@0 157 static const BasicType types[Interpreter::number_of_result_handlers] = {
duke@0 158 T_BOOLEAN,
duke@0 159 T_CHAR ,
duke@0 160 T_BYTE ,
duke@0 161 T_SHORT ,
duke@0 162 T_INT ,
duke@0 163 T_LONG ,
duke@0 164 T_VOID ,
duke@0 165 T_FLOAT ,
duke@0 166 T_DOUBLE ,
duke@0 167 T_OBJECT
duke@0 168 };
duke@0 169
duke@0 170 void AbstractInterpreterGenerator::generate_all() {
duke@0 171
duke@0 172
duke@0 173 { CodeletMark cm(_masm, "slow signature handler");
duke@0 174 Interpreter::_slow_signature_handler = generate_slow_signature_handler();
duke@0 175 }
duke@0 176
duke@0 177 }
duke@0 178
duke@0 179 //------------------------------------------------------------------------------------------------------------------------
duke@0 180 // Entry points
duke@0 181
duke@0 182 AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(methodHandle m) {
duke@0 183 // Abstract method?
duke@0 184 if (m->is_abstract()) return abstract;
duke@0 185
twisti@3534 186 // Method handle primitive?
twisti@3534 187 if (m->is_method_handle_intrinsic()) {
twisti@3534 188 vmIntrinsics::ID id = m->intrinsic_id();
twisti@3534 189 assert(MethodHandles::is_signature_polymorphic(id), "must match an intrinsic");
twisti@3534 190 MethodKind kind = (MethodKind)( method_handle_invoke_FIRST +
twisti@3534 191 ((int)id - vmIntrinsics::FIRST_MH_SIG_POLY) );
twisti@3534 192 assert(kind <= method_handle_invoke_LAST, "parallel enum ranges");
twisti@3534 193 return kind;
twisti@3534 194 }
jrose@710 195
duke@0 196 // Native method?
duke@0 197 // Note: This test must come _before_ the test for intrinsic
duke@0 198 // methods. See also comments below.
duke@0 199 if (m->is_native()) {
twisti@3534 200 assert(!m->is_method_handle_intrinsic(), "overlapping bits here, watch out");
duke@0 201 return m->is_synchronized() ? native_synchronized : native;
duke@0 202 }
duke@0 203
duke@0 204 // Synchronized?
duke@0 205 if (m->is_synchronized()) {
duke@0 206 return zerolocals_synchronized;
duke@0 207 }
duke@0 208
duke@0 209 if (RegisterFinalizersAtInit && m->code_size() == 1 &&
duke@0 210 m->intrinsic_id() == vmIntrinsics::_Object_init) {
duke@0 211 // We need to execute the special return bytecode to check for
duke@0 212 // finalizer registration so create a normal frame.
duke@0 213 return zerolocals;
duke@0 214 }
duke@0 215
duke@0 216 // Empty method?
duke@0 217 if (m->is_empty_method()) {
duke@0 218 return empty;
duke@0 219 }
duke@0 220
duke@0 221 // Special intrinsic method?
duke@0 222 // Note: This test must come _after_ the test for native methods,
duke@0 223 // otherwise we will run into problems with JDK 1.2, see also
duke@0 224 // AbstractInterpreterGenerator::generate_method_entry() for
duke@0 225 // for details.
duke@0 226 switch (m->intrinsic_id()) {
duke@0 227 case vmIntrinsics::_dsin : return java_lang_math_sin ;
duke@0 228 case vmIntrinsics::_dcos : return java_lang_math_cos ;
duke@0 229 case vmIntrinsics::_dtan : return java_lang_math_tan ;
duke@0 230 case vmIntrinsics::_dabs : return java_lang_math_abs ;
duke@0 231 case vmIntrinsics::_dsqrt : return java_lang_math_sqrt ;
duke@0 232 case vmIntrinsics::_dlog : return java_lang_math_log ;
duke@0 233 case vmIntrinsics::_dlog10: return java_lang_math_log10;
roland@3352 234 case vmIntrinsics::_dpow : return java_lang_math_pow ;
roland@3352 235 case vmIntrinsics::_dexp : return java_lang_math_exp ;
johnc@2346 236
johnc@2346 237 case vmIntrinsics::_Reference_get:
johnc@2346 238 return java_lang_ref_reference_get;
johnc@2346 239 }
johnc@2346 240
johnc@2346 241 // Accessor method?
johnc@2346 242 if (m->is_accessor()) {
johnc@2346 243 assert(m->size_of_parameters() == 1, "fast code for accessors assumes parameter size = 1");
johnc@2346 244 return accessor;
duke@0 245 }
duke@0 246
duke@0 247 // Note: for now: zero locals for all non-empty methods
duke@0 248 return zerolocals;
duke@0 249 }
duke@0 250
duke@0 251
twisti@3534 252 void AbstractInterpreter::set_entry_for_kind(AbstractInterpreter::MethodKind kind, address entry) {
twisti@3534 253 assert(kind >= method_handle_invoke_FIRST &&
twisti@3534 254 kind <= method_handle_invoke_LAST, "late initialization only for MH entry points");
twisti@3534 255 assert(_entry_table[kind] == _entry_table[abstract], "previous value must be AME entry");
twisti@3534 256 _entry_table[kind] = entry;
twisti@3534 257 }
twisti@3534 258
twisti@3534 259
duke@0 260 // Return true if the interpreter can prove that the given bytecode has
duke@0 261 // not yet been executed (in Java semantics, not in actual operation).
duke@0 262 bool AbstractInterpreter::is_not_reached(methodHandle method, int bci) {
never@2027 263 Bytecodes::Code code = method()->code_at(bci);
duke@0 264
never@2027 265 if (!Bytecodes::must_rewrite(code)) {
duke@0 266 // might have been reached
duke@0 267 return false;
duke@0 268 }
duke@0 269
duke@0 270 // the bytecode might not be rewritten if the method is an accessor, etc.
duke@0 271 address ientry = method->interpreter_entry();
duke@0 272 if (ientry != entry_for_kind(AbstractInterpreter::zerolocals) &&
duke@0 273 ientry != entry_for_kind(AbstractInterpreter::zerolocals_synchronized))
duke@0 274 return false; // interpreter does not run this method!
duke@0 275
duke@0 276 // otherwise, we can be sure this bytecode has never been executed
duke@0 277 return true;
duke@0 278 }
duke@0 279
duke@0 280
duke@0 281 #ifndef PRODUCT
duke@0 282 void AbstractInterpreter::print_method_kind(MethodKind kind) {
duke@0 283 switch (kind) {
duke@0 284 case zerolocals : tty->print("zerolocals" ); break;
duke@0 285 case zerolocals_synchronized: tty->print("zerolocals_synchronized"); break;
duke@0 286 case native : tty->print("native" ); break;
duke@0 287 case native_synchronized : tty->print("native_synchronized" ); break;
duke@0 288 case empty : tty->print("empty" ); break;
duke@0 289 case accessor : tty->print("accessor" ); break;
duke@0 290 case abstract : tty->print("abstract" ); break;
duke@0 291 case java_lang_math_sin : tty->print("java_lang_math_sin" ); break;
duke@0 292 case java_lang_math_cos : tty->print("java_lang_math_cos" ); break;
duke@0 293 case java_lang_math_tan : tty->print("java_lang_math_tan" ); break;
duke@0 294 case java_lang_math_abs : tty->print("java_lang_math_abs" ); break;
duke@0 295 case java_lang_math_sqrt : tty->print("java_lang_math_sqrt" ); break;
duke@0 296 case java_lang_math_log : tty->print("java_lang_math_log" ); break;
duke@0 297 case java_lang_math_log10 : tty->print("java_lang_math_log10" ); break;
twisti@3534 298 default:
twisti@3534 299 if (kind >= method_handle_invoke_FIRST &&
twisti@3534 300 kind <= method_handle_invoke_LAST) {
twisti@3534 301 const char* kind_name = vmIntrinsics::name_at(method_handle_intrinsic(kind));
twisti@3534 302 if (kind_name[0] == '_') kind_name = &kind_name[1]; // '_invokeExact' => 'invokeExact'
twisti@3534 303 tty->print("method_handle_%s", kind_name);
twisti@3534 304 break;
twisti@3534 305 }
twisti@3534 306 ShouldNotReachHere();
twisti@3534 307 break;
duke@0 308 }
duke@0 309 }
duke@0 310 #endif // PRODUCT
duke@0 311
duke@0 312
duke@0 313 //------------------------------------------------------------------------------------------------------------------------
duke@0 314 // Deoptimization support
duke@0 315
cfang@900 316 // If deoptimization happens, this function returns the point of next bytecode to continue execution
coleenp@3602 317 address AbstractInterpreter::deopt_continue_after_entry(Method* method, address bcp, int callee_parameters, bool is_top_frame) {
duke@0 318 assert(method->contains(bcp), "just checkin'");
never@2027 319 Bytecodes::Code code = Bytecodes::java_code_at(method, bcp);
cfang@900 320 assert(!Interpreter::bytecode_should_reexecute(code), "should not reexecute");
duke@0 321 int bci = method->bci_from(bcp);
duke@0 322 int length = -1; // initial value for debugging
duke@0 323 // compute continuation length
never@2027 324 length = Bytecodes::length_at(method, bcp);
duke@0 325 // compute result type
duke@0 326 BasicType type = T_ILLEGAL;
cfang@900 327
duke@0 328 switch (code) {
duke@0 329 case Bytecodes::_invokevirtual :
duke@0 330 case Bytecodes::_invokespecial :
duke@0 331 case Bytecodes::_invokestatic :
duke@0 332 case Bytecodes::_invokeinterface: {
duke@0 333 Thread *thread = Thread::current();
duke@0 334 ResourceMark rm(thread);
duke@0 335 methodHandle mh(thread, method);
coleenp@2062 336 type = Bytecode_invoke(mh, bci).result_type();
duke@0 337 // since the cache entry might not be initialized:
duke@0 338 // (NOT needed for the old calling convension)
duke@0 339 if (!is_top_frame) {
duke@0 340 int index = Bytes::get_native_u2(bcp+1);
duke@0 341 method->constants()->cache()->entry_at(index)->set_parameter_size(callee_parameters);
duke@0 342 }
duke@0 343 break;
duke@0 344 }
duke@0 345
jrose@1059 346 case Bytecodes::_invokedynamic: {
jrose@1059 347 Thread *thread = Thread::current();
jrose@1059 348 ResourceMark rm(thread);
jrose@1059 349 methodHandle mh(thread, method);
coleenp@2062 350 type = Bytecode_invoke(mh, bci).result_type();
jrose@1059 351 // since the cache entry might not be initialized:
jrose@1059 352 // (NOT needed for the old calling convension)
jrose@1059 353 if (!is_top_frame) {
jrose@1059 354 int index = Bytes::get_native_u4(bcp+1);
coleenp@3602 355 method->constants()->invokedynamic_cp_cache_entry_at(index)->set_parameter_size(callee_parameters);
jrose@1059 356 }
jrose@1059 357 break;
jrose@1059 358 }
jrose@1059 359
duke@0 360 case Bytecodes::_ldc :
duke@0 361 case Bytecodes::_ldc_w : // fall through
duke@0 362 case Bytecodes::_ldc2_w:
jrose@1522 363 {
jrose@1522 364 Thread *thread = Thread::current();
jrose@1522 365 ResourceMark rm(thread);
jrose@1522 366 methodHandle mh(thread, method);
never@2027 367 type = Bytecode_loadconstant(mh, bci).result_type();
jrose@1522 368 break;
jrose@1522 369 }
duke@0 370
duke@0 371 default:
duke@0 372 type = Bytecodes::result_type(code);
duke@0 373 break;
duke@0 374 }
duke@0 375
duke@0 376 // return entry point for computed continuation state & bytecode length
duke@0 377 return
duke@0 378 is_top_frame
duke@0 379 ? Interpreter::deopt_entry (as_TosState(type), length)
duke@0 380 : Interpreter::return_entry(as_TosState(type), length);
duke@0 381 }
duke@0 382
cfang@900 383 // If deoptimization happens, this function returns the point where the interpreter reexecutes
cfang@900 384 // the bytecode.
cfang@900 385 // Note: Bytecodes::_athrow is a special case in that it does not return
cfang@900 386 // Interpreter::deopt_entry(vtos, 0) like others
coleenp@3602 387 address AbstractInterpreter::deopt_reexecute_entry(Method* method, address bcp) {
cfang@900 388 assert(method->contains(bcp), "just checkin'");
never@2027 389 Bytecodes::Code code = Bytecodes::java_code_at(method, bcp);
cfang@900 390 #ifdef COMPILER1
cfang@900 391 if(code == Bytecodes::_athrow ) {
cfang@900 392 return Interpreter::rethrow_exception_entry();
cfang@900 393 }
cfang@900 394 #endif /* COMPILER1 */
cfang@900 395 return Interpreter::deopt_entry(vtos, 0);
cfang@900 396 }
cfang@900 397
cfang@900 398 // If deoptimization happens, the interpreter should reexecute these bytecodes.
cfang@900 399 // This function mainly helps the compilers to set up the reexecute bit.
cfang@900 400 bool AbstractInterpreter::bytecode_should_reexecute(Bytecodes::Code code) {
cfang@900 401 switch (code) {
cfang@900 402 case Bytecodes::_lookupswitch:
cfang@900 403 case Bytecodes::_tableswitch:
cfang@900 404 case Bytecodes::_fast_binaryswitch:
cfang@900 405 case Bytecodes::_fast_linearswitch:
cfang@900 406 // recompute condtional expression folded into _if<cond>
cfang@900 407 case Bytecodes::_lcmp :
cfang@900 408 case Bytecodes::_fcmpl :
cfang@900 409 case Bytecodes::_fcmpg :
cfang@900 410 case Bytecodes::_dcmpl :
cfang@900 411 case Bytecodes::_dcmpg :
cfang@900 412 case Bytecodes::_ifnull :
cfang@900 413 case Bytecodes::_ifnonnull :
cfang@900 414 case Bytecodes::_goto :
cfang@900 415 case Bytecodes::_goto_w :
cfang@900 416 case Bytecodes::_ifeq :
cfang@900 417 case Bytecodes::_ifne :
cfang@900 418 case Bytecodes::_iflt :
cfang@900 419 case Bytecodes::_ifge :
cfang@900 420 case Bytecodes::_ifgt :
cfang@900 421 case Bytecodes::_ifle :
cfang@900 422 case Bytecodes::_if_icmpeq :
cfang@900 423 case Bytecodes::_if_icmpne :
cfang@900 424 case Bytecodes::_if_icmplt :
cfang@900 425 case Bytecodes::_if_icmpge :
cfang@900 426 case Bytecodes::_if_icmpgt :
cfang@900 427 case Bytecodes::_if_icmple :
cfang@900 428 case Bytecodes::_if_acmpeq :
cfang@900 429 case Bytecodes::_if_acmpne :
cfang@900 430 // special cases
cfang@900 431 case Bytecodes::_getfield :
cfang@900 432 case Bytecodes::_putfield :
cfang@900 433 case Bytecodes::_getstatic :
cfang@900 434 case Bytecodes::_putstatic :
cfang@900 435 case Bytecodes::_aastore :
cfang@900 436 #ifdef COMPILER1
cfang@900 437 //special case of reexecution
cfang@900 438 case Bytecodes::_athrow :
cfang@900 439 #endif
cfang@900 440 return true;
cfang@900 441
cfang@900 442 default:
cfang@900 443 return false;
cfang@900 444 }
cfang@900 445 }
cfang@900 446
duke@0 447 void AbstractInterpreterGenerator::bang_stack_shadow_pages(bool native_call) {
duke@0 448 // Quick & dirty stack overflow checking: bang the stack & handle trap.
duke@0 449 // Note that we do the banging after the frame is setup, since the exception
duke@0 450 // handling code expects to find a valid interpreter frame on the stack.
duke@0 451 // Doing the banging earlier fails if the caller frame is not an interpreter
duke@0 452 // frame.
duke@0 453 // (Also, the exception throwing code expects to unlock any synchronized
duke@0 454 // method receiever, so do the banging after locking the receiver.)
duke@0 455
duke@0 456 // Bang each page in the shadow zone. We can't assume it's been done for
duke@0 457 // an interpreter frame with greater than a page of locals, so each page
duke@0 458 // needs to be checked. Only true for non-native.
duke@0 459 if (UseStackBanging) {
duke@0 460 const int start_page = native_call ? StackShadowPages : 1;
duke@0 461 const int page_size = os::vm_page_size();
duke@0 462 for (int pages = start_page; pages <= StackShadowPages ; pages++) {
duke@0 463 __ bang_stack_with_offset(pages*page_size);
duke@0 464 }
duke@0 465 }
duke@0 466 }