src/share/vm/code/codeBlob.hpp

Tue, 11 May 2010 14:35:43 -0700

author
prr
date
Tue, 11 May 2010 14:35:43 -0700
changeset 1840
fb57d4cf76c2
parent 1734
9eba43136cb5
child 1907
c18cbe5936b8
child 1918
1a5913bf5e19
permissions
-rw-r--r--

6931180: Migration to recent versions of MS Platform SDK
6951582: Build problems on win64
Summary: Changes to enable building JDK7 with Microsoft Visual Studio 2010
Reviewed-by: ohair, art, ccheung, dcubed

duke@435 1 /*
twisti@1734 2 * Copyright 1998-2010 Sun Microsystems, Inc. All Rights Reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
duke@435 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@435 20 * CA 95054 USA or visit www.sun.com if you need additional information or
duke@435 21 * have any questions.
duke@435 22 *
duke@435 23 */
duke@435 24
duke@435 25 // CodeBlob - superclass for all entries in the CodeCache.
duke@435 26 //
duke@435 27 // Suptypes are:
duke@435 28 // nmethod : Compiled Java methods (include method that calls to native code)
duke@435 29 // RuntimeStub : Call to VM runtime methods
duke@435 30 // DeoptimizationBlob : Used for deoptimizatation
duke@435 31 // ExceptionBlob : Used for stack unrolling
duke@435 32 // SafepointBlob : Used to handle illegal instruction exceptions
duke@435 33 //
duke@435 34 //
duke@435 35 // Layout:
duke@435 36 // - header
duke@435 37 // - relocation
duke@435 38 // - instruction space
duke@435 39 // - data space
duke@435 40 class DeoptimizationBlob;
duke@435 41
duke@435 42 class CodeBlob VALUE_OBJ_CLASS_SPEC {
duke@435 43
duke@435 44 friend class VMStructs;
duke@435 45
duke@435 46 private:
duke@435 47 const char* _name;
duke@435 48 int _size; // total size of CodeBlob in bytes
duke@435 49 int _header_size; // size of header (depends on subclass)
duke@435 50 int _relocation_size; // size of relocation
duke@435 51 int _instructions_offset; // offset to where instructions region begins
duke@435 52 int _frame_complete_offset; // instruction offsets in [0.._frame_complete_offset) have
duke@435 53 // not finished setting up their frame. Beware of pc's in
duke@435 54 // that range. There is a similar range(s) on returns
duke@435 55 // which we don't detect.
duke@435 56 int _data_offset; // offset to where data region begins
duke@435 57 int _oops_offset; // offset to where embedded oop table begins (inside data)
duke@435 58 int _oops_length; // number of embedded oops
duke@435 59 int _frame_size; // size of stack frame
duke@435 60 OopMapSet* _oop_maps; // OopMap for this CodeBlob
duke@435 61 CodeComments _comments;
duke@435 62
duke@435 63 friend class OopRecorder;
duke@435 64
duke@435 65 void fix_oop_relocations(address begin, address end, bool initialize_immediates);
duke@435 66 inline void initialize_immediate_oop(oop* dest, jobject handle);
duke@435 67
duke@435 68 public:
duke@435 69 // Returns the space needed for CodeBlob
duke@435 70 static unsigned int allocation_size(CodeBuffer* cb, int header_size);
duke@435 71
duke@435 72 // Creation
duke@435 73 // a) simple CodeBlob
duke@435 74 // frame_complete is the offset from the beginning of the instructions
duke@435 75 // to where the frame setup (from stackwalk viewpoint) is complete.
duke@435 76 CodeBlob(const char* name, int header_size, int size, int frame_complete, int locs_size);
duke@435 77
duke@435 78 // b) full CodeBlob
duke@435 79 CodeBlob(
duke@435 80 const char* name,
duke@435 81 CodeBuffer* cb,
duke@435 82 int header_size,
duke@435 83 int size,
duke@435 84 int frame_complete,
duke@435 85 int frame_size,
duke@435 86 OopMapSet* oop_maps
duke@435 87 );
duke@435 88
duke@435 89 // Deletion
duke@435 90 void flush();
duke@435 91
duke@435 92 // Typing
twisti@1734 93 virtual bool is_buffer_blob() const { return false; }
twisti@1734 94 virtual bool is_nmethod() const { return false; }
twisti@1734 95 virtual bool is_runtime_stub() const { return false; }
twisti@1734 96 virtual bool is_deoptimization_stub() const { return false; }
twisti@1734 97 virtual bool is_uncommon_trap_stub() const { return false; }
twisti@1734 98 virtual bool is_exception_stub() const { return false; }
twisti@1734 99 virtual bool is_safepoint_stub() const { return false; }
twisti@1734 100 virtual bool is_adapter_blob() const { return false; }
twisti@1734 101 virtual bool is_method_handles_adapter_blob() const { return false; }
duke@435 102
duke@435 103 virtual bool is_compiled_by_c2() const { return false; }
duke@435 104 virtual bool is_compiled_by_c1() const { return false; }
duke@435 105
twisti@1570 106 // Casting
twisti@1570 107 nmethod* as_nmethod_or_null() { return is_nmethod() ? (nmethod*) this : NULL; }
twisti@1570 108
duke@435 109 // Boundaries
duke@435 110 address header_begin() const { return (address) this; }
duke@435 111 address header_end() const { return ((address) this) + _header_size; };
duke@435 112 relocInfo* relocation_begin() const { return (relocInfo*) header_end(); };
duke@435 113 relocInfo* relocation_end() const { return (relocInfo*)(header_end() + _relocation_size); }
duke@435 114 address instructions_begin() const { return (address) header_begin() + _instructions_offset; }
duke@435 115 address instructions_end() const { return (address) header_begin() + _data_offset; }
duke@435 116 address data_begin() const { return (address) header_begin() + _data_offset; }
duke@435 117 address data_end() const { return (address) header_begin() + _size; }
duke@435 118 oop* oops_begin() const { return (oop*) (header_begin() + _oops_offset); }
duke@435 119 oop* oops_end() const { return oops_begin() + _oops_length; }
duke@435 120
duke@435 121 // Offsets
duke@435 122 int relocation_offset() const { return _header_size; }
duke@435 123 int instructions_offset() const { return _instructions_offset; }
duke@435 124 int data_offset() const { return _data_offset; }
duke@435 125 int oops_offset() const { return _oops_offset; }
duke@435 126
duke@435 127 // Sizes
duke@435 128 int size() const { return _size; }
duke@435 129 int header_size() const { return _header_size; }
duke@435 130 int relocation_size() const { return (address) relocation_end() - (address) relocation_begin(); }
duke@435 131 int instructions_size() const { return instructions_end() - instructions_begin(); }
duke@435 132 int data_size() const { return data_end() - data_begin(); }
duke@435 133 int oops_size() const { return (address) oops_end() - (address) oops_begin(); }
duke@435 134
duke@435 135 // Containment
duke@435 136 bool blob_contains(address addr) const { return header_begin() <= addr && addr < data_end(); }
duke@435 137 bool relocation_contains(relocInfo* addr) const{ return relocation_begin() <= addr && addr < relocation_end(); }
duke@435 138 bool instructions_contains(address addr) const { return instructions_begin() <= addr && addr < instructions_end(); }
duke@435 139 bool data_contains(address addr) const { return data_begin() <= addr && addr < data_end(); }
duke@435 140 bool oops_contains(oop* addr) const { return oops_begin() <= addr && addr < oops_end(); }
duke@435 141 bool contains(address addr) const { return instructions_contains(addr); }
duke@435 142 bool is_frame_complete_at(address addr) const { return instructions_contains(addr) &&
duke@435 143 addr >= instructions_begin() + _frame_complete_offset; }
duke@435 144
duke@435 145 // Relocation support
duke@435 146 void fix_oop_relocations(address begin, address end) {
duke@435 147 fix_oop_relocations(begin, end, false);
duke@435 148 }
duke@435 149 void fix_oop_relocations() {
duke@435 150 fix_oop_relocations(NULL, NULL, false);
duke@435 151 }
duke@435 152 relocInfo::relocType reloc_type_for_address(address pc);
duke@435 153 bool is_at_poll_return(address pc);
duke@435 154 bool is_at_poll_or_poll_return(address pc);
duke@435 155
duke@435 156 // Support for oops in scopes and relocs:
duke@435 157 // Note: index 0 is reserved for null.
duke@435 158 oop oop_at(int index) const { return index == 0? (oop)NULL: *oop_addr_at(index); }
duke@435 159 oop* oop_addr_at(int index) const{ // for GC
duke@435 160 // relocation indexes are biased by 1 (because 0 is reserved)
duke@435 161 assert(index > 0 && index <= _oops_length, "must be a valid non-zero index");
duke@435 162 return &oops_begin()[index-1];
duke@435 163 }
duke@435 164
duke@435 165 void copy_oops(GrowableArray<jobject>* oops);
duke@435 166
duke@435 167 // CodeCache support: really only used by the nmethods, but in order to get
duke@435 168 // asserts and certain bookkeeping to work in the CodeCache they are defined
duke@435 169 // virtual here.
duke@435 170 virtual bool is_zombie() const { return false; }
duke@435 171 virtual bool is_locked_by_vm() const { return false; }
duke@435 172
duke@435 173 virtual bool is_unloaded() const { return false; }
duke@435 174 virtual bool is_not_entrant() const { return false; }
duke@435 175
duke@435 176 // GC support
duke@435 177 virtual bool is_alive() const = 0;
duke@435 178 virtual void do_unloading(BoolObjectClosure* is_alive,
duke@435 179 OopClosure* keep_alive,
duke@435 180 bool unloading_occurred);
duke@435 181 virtual void oops_do(OopClosure* f) = 0;
jrose@1424 182 // (All CodeBlob subtypes other than NMethod currently have
jrose@1424 183 // an empty oops_do() method.
duke@435 184
duke@435 185 // OopMap for frame
duke@435 186 OopMapSet* oop_maps() const { return _oop_maps; }
duke@435 187 void set_oop_maps(OopMapSet* p);
duke@435 188 OopMap* oop_map_for_return_address(address return_address);
duke@435 189 virtual void preserve_callee_argument_oops(frame fr, const RegisterMap* reg_map, OopClosure* f) { ShouldNotReachHere(); }
duke@435 190
duke@435 191 // Frame support
duke@435 192 int frame_size() const { return _frame_size; }
duke@435 193 void set_frame_size(int size) { _frame_size = size; }
duke@435 194
duke@435 195 // Returns true, if the next frame is responsible for GC'ing oops passed as arguments
duke@435 196 virtual bool caller_must_gc_arguments(JavaThread* thread) const { return false; }
duke@435 197
duke@435 198 // Naming
duke@435 199 const char* name() const { return _name; }
duke@435 200 void set_name(const char* name) { _name = name; }
duke@435 201
duke@435 202 // Debugging
duke@435 203 virtual void verify();
duke@435 204 virtual void print() const PRODUCT_RETURN;
duke@435 205 virtual void print_value_on(outputStream* st) const PRODUCT_RETURN;
duke@435 206
duke@435 207 // Print the comment associated with offset on stream, if there is one
jrose@1590 208 virtual void print_block_comment(outputStream* stream, address block_begin) {
jrose@1590 209 intptr_t offset = (intptr_t)(block_begin - instructions_begin());
duke@435 210 _comments.print_block_comment(stream, offset);
duke@435 211 }
duke@435 212
duke@435 213 // Transfer ownership of comments to this CodeBlob
duke@435 214 void set_comments(CodeComments& comments) {
duke@435 215 _comments.assign(comments);
duke@435 216 }
duke@435 217 };
duke@435 218
duke@435 219
duke@435 220 //----------------------------------------------------------------------------------------------------
duke@435 221 // BufferBlob: used to hold non-relocatable machine code such as the interpreter, stubroutines, etc.
duke@435 222
duke@435 223 class BufferBlob: public CodeBlob {
duke@435 224 friend class VMStructs;
twisti@1734 225 friend class AdapterBlob;
twisti@1734 226 friend class MethodHandlesAdapterBlob;
twisti@1734 227
duke@435 228 private:
duke@435 229 // Creation support
duke@435 230 BufferBlob(const char* name, int size);
duke@435 231 BufferBlob(const char* name, int size, CodeBuffer* cb);
duke@435 232
duke@435 233 void* operator new(size_t s, unsigned size);
duke@435 234
duke@435 235 public:
duke@435 236 // Creation
duke@435 237 static BufferBlob* create(const char* name, int buffer_size);
duke@435 238 static BufferBlob* create(const char* name, CodeBuffer* cb);
duke@435 239
duke@435 240 static void free(BufferBlob* buf);
duke@435 241
duke@435 242 // Typing
twisti@1734 243 virtual bool is_buffer_blob() const { return true; }
duke@435 244
duke@435 245 // GC/Verification support
duke@435 246 void preserve_callee_argument_oops(frame fr, const RegisterMap* reg_map, OopClosure* f) { /* nothing to do */ }
duke@435 247 bool is_alive() const { return true; }
duke@435 248 void do_unloading(BoolObjectClosure* is_alive,
duke@435 249 OopClosure* keep_alive,
duke@435 250 bool unloading_occurred) { /* do nothing */ }
duke@435 251
duke@435 252 void oops_do(OopClosure* f) { /* do nothing*/ }
duke@435 253
duke@435 254 void verify();
duke@435 255 void print() const PRODUCT_RETURN;
duke@435 256 void print_value_on(outputStream* st) const PRODUCT_RETURN;
duke@435 257 };
duke@435 258
duke@435 259
duke@435 260 //----------------------------------------------------------------------------------------------------
twisti@1734 261 // AdapterBlob: used to hold C2I/I2C adapters
twisti@1734 262
twisti@1734 263 class AdapterBlob: public BufferBlob {
twisti@1734 264 private:
twisti@1734 265 AdapterBlob(int size) : BufferBlob("I2C/C2I adapters", size) {}
twisti@1734 266 AdapterBlob(int size, CodeBuffer* cb) : BufferBlob("I2C/C2I adapters", size, cb) {}
twisti@1734 267
twisti@1734 268 public:
twisti@1734 269 // Creation
twisti@1734 270 static AdapterBlob* create(CodeBuffer* cb);
twisti@1734 271
twisti@1734 272 // Typing
twisti@1734 273 virtual bool is_adapter_blob() const { return true; }
twisti@1734 274 };
twisti@1734 275
twisti@1734 276
twisti@1734 277 //----------------------------------------------------------------------------------------------------
twisti@1734 278 // MethodHandlesAdapterBlob: used to hold MethodHandles adapters
twisti@1734 279
twisti@1734 280 class MethodHandlesAdapterBlob: public BufferBlob {
twisti@1734 281 private:
twisti@1734 282 MethodHandlesAdapterBlob(int size) : BufferBlob("MethodHandles adapters", size) {}
twisti@1734 283 MethodHandlesAdapterBlob(int size, CodeBuffer* cb) : BufferBlob("MethodHandles adapters", size, cb) {}
twisti@1734 284
twisti@1734 285 public:
twisti@1734 286 // Creation
twisti@1734 287 static MethodHandlesAdapterBlob* create(int buffer_size);
twisti@1734 288
twisti@1734 289 // Typing
twisti@1734 290 virtual bool is_method_handles_adapter_blob() const { return true; }
twisti@1734 291 };
twisti@1734 292
twisti@1734 293
twisti@1734 294 //----------------------------------------------------------------------------------------------------
duke@435 295 // RuntimeStub: describes stubs used by compiled code to call a (static) C++ runtime routine
duke@435 296
duke@435 297 class RuntimeStub: public CodeBlob {
duke@435 298 friend class VMStructs;
duke@435 299 private:
duke@435 300 bool _caller_must_gc_arguments;
duke@435 301
duke@435 302 // Creation support
duke@435 303 RuntimeStub(
duke@435 304 const char* name,
duke@435 305 CodeBuffer* cb,
duke@435 306 int size,
duke@435 307 int frame_complete,
duke@435 308 int frame_size,
duke@435 309 OopMapSet* oop_maps,
duke@435 310 bool caller_must_gc_arguments
duke@435 311 );
duke@435 312
duke@435 313 void* operator new(size_t s, unsigned size);
duke@435 314
duke@435 315 public:
duke@435 316 // Creation
duke@435 317 static RuntimeStub* new_runtime_stub(
duke@435 318 const char* stub_name,
duke@435 319 CodeBuffer* cb,
duke@435 320 int frame_complete,
duke@435 321 int frame_size,
duke@435 322 OopMapSet* oop_maps,
duke@435 323 bool caller_must_gc_arguments
duke@435 324 );
duke@435 325
duke@435 326 // Typing
duke@435 327 bool is_runtime_stub() const { return true; }
duke@435 328
duke@435 329 // GC support
duke@435 330 bool caller_must_gc_arguments(JavaThread* thread) const { return _caller_must_gc_arguments; }
duke@435 331
duke@435 332 address entry_point() { return instructions_begin(); }
duke@435 333
duke@435 334 // GC/Verification support
duke@435 335 void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { /* nothing to do */ }
duke@435 336 bool is_alive() const { return true; }
duke@435 337 void do_unloading(BoolObjectClosure* is_alive,
duke@435 338 OopClosure* keep_alive,
duke@435 339 bool unloading_occurred) { /* do nothing */ }
duke@435 340 void oops_do(OopClosure* f) { /* do-nothing*/ }
duke@435 341
duke@435 342 void verify();
duke@435 343 void print() const PRODUCT_RETURN;
duke@435 344 void print_value_on(outputStream* st) const PRODUCT_RETURN;
duke@435 345 };
duke@435 346
duke@435 347
duke@435 348 //----------------------------------------------------------------------------------------------------
duke@435 349 // Super-class for all blobs that exist in only one instance. Implements default behaviour.
duke@435 350
duke@435 351 class SingletonBlob: public CodeBlob {
duke@435 352 friend class VMStructs;
duke@435 353 public:
duke@435 354 SingletonBlob(
duke@435 355 const char* name,
duke@435 356 CodeBuffer* cb,
duke@435 357 int header_size,
duke@435 358 int size,
duke@435 359 int frame_size,
duke@435 360 OopMapSet* oop_maps
duke@435 361 )
duke@435 362 : CodeBlob(name, cb, header_size, size, CodeOffsets::frame_never_safe, frame_size, oop_maps)
duke@435 363 {};
duke@435 364
duke@435 365 bool is_alive() const { return true; }
duke@435 366 void do_unloading(BoolObjectClosure* is_alive,
duke@435 367 OopClosure* keep_alive,
duke@435 368 bool unloading_occurred) { /* do-nothing*/ }
duke@435 369
duke@435 370 void verify(); // does nothing
duke@435 371 void print() const PRODUCT_RETURN;
duke@435 372 void print_value_on(outputStream* st) const PRODUCT_RETURN;
duke@435 373 };
duke@435 374
duke@435 375
duke@435 376 //----------------------------------------------------------------------------------------------------
duke@435 377 // DeoptimizationBlob
duke@435 378
duke@435 379 class DeoptimizationBlob: public SingletonBlob {
duke@435 380 friend class VMStructs;
duke@435 381 private:
duke@435 382 int _unpack_offset;
duke@435 383 int _unpack_with_exception;
duke@435 384 int _unpack_with_reexecution;
duke@435 385
duke@435 386 int _unpack_with_exception_in_tls;
duke@435 387
duke@435 388 // Creation support
duke@435 389 DeoptimizationBlob(
duke@435 390 CodeBuffer* cb,
duke@435 391 int size,
duke@435 392 OopMapSet* oop_maps,
duke@435 393 int unpack_offset,
duke@435 394 int unpack_with_exception_offset,
duke@435 395 int unpack_with_reexecution_offset,
duke@435 396 int frame_size
duke@435 397 );
duke@435 398
duke@435 399 void* operator new(size_t s, unsigned size);
duke@435 400
duke@435 401 public:
duke@435 402 // Creation
duke@435 403 static DeoptimizationBlob* create(
duke@435 404 CodeBuffer* cb,
duke@435 405 OopMapSet* oop_maps,
duke@435 406 int unpack_offset,
duke@435 407 int unpack_with_exception_offset,
duke@435 408 int unpack_with_reexecution_offset,
duke@435 409 int frame_size
duke@435 410 );
duke@435 411
duke@435 412 // Typing
duke@435 413 bool is_deoptimization_stub() const { return true; }
duke@435 414 const DeoptimizationBlob *as_deoptimization_stub() const { return this; }
duke@435 415 bool exception_address_is_unpack_entry(address pc) const {
duke@435 416 address unpack_pc = unpack();
duke@435 417 return (pc == unpack_pc || (pc + frame::pc_return_offset) == unpack_pc);
duke@435 418 }
duke@435 419
duke@435 420
duke@435 421
duke@435 422
duke@435 423 // GC for args
duke@435 424 void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { /* Nothing to do */ }
duke@435 425
duke@435 426 // Iteration
duke@435 427 void oops_do(OopClosure* f) {}
duke@435 428
duke@435 429 // Printing
duke@435 430 void print_value_on(outputStream* st) const PRODUCT_RETURN;
duke@435 431
duke@435 432 address unpack() const { return instructions_begin() + _unpack_offset; }
duke@435 433 address unpack_with_exception() const { return instructions_begin() + _unpack_with_exception; }
duke@435 434 address unpack_with_reexecution() const { return instructions_begin() + _unpack_with_reexecution; }
duke@435 435
duke@435 436 // Alternate entry point for C1 where the exception and issuing pc
duke@435 437 // are in JavaThread::_exception_oop and JavaThread::_exception_pc
duke@435 438 // instead of being in registers. This is needed because C1 doesn't
duke@435 439 // model exception paths in a way that keeps these registers free so
duke@435 440 // there may be live values in those registers during deopt.
duke@435 441 void set_unpack_with_exception_in_tls_offset(int offset) {
duke@435 442 _unpack_with_exception_in_tls = offset;
duke@435 443 assert(contains(instructions_begin() + _unpack_with_exception_in_tls), "must be PC inside codeblob");
duke@435 444 }
duke@435 445 address unpack_with_exception_in_tls() const { return instructions_begin() + _unpack_with_exception_in_tls; }
duke@435 446 };
duke@435 447
duke@435 448
duke@435 449 //----------------------------------------------------------------------------------------------------
duke@435 450 // UncommonTrapBlob (currently only used by Compiler 2)
duke@435 451
duke@435 452 #ifdef COMPILER2
duke@435 453
duke@435 454 class UncommonTrapBlob: public SingletonBlob {
duke@435 455 friend class VMStructs;
duke@435 456 private:
duke@435 457 // Creation support
duke@435 458 UncommonTrapBlob(
duke@435 459 CodeBuffer* cb,
duke@435 460 int size,
duke@435 461 OopMapSet* oop_maps,
duke@435 462 int frame_size
duke@435 463 );
duke@435 464
duke@435 465 void* operator new(size_t s, unsigned size);
duke@435 466
duke@435 467 public:
duke@435 468 // Creation
duke@435 469 static UncommonTrapBlob* create(
duke@435 470 CodeBuffer* cb,
duke@435 471 OopMapSet* oop_maps,
duke@435 472 int frame_size
duke@435 473 );
duke@435 474
duke@435 475 // GC for args
duke@435 476 void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { /* nothing to do */ }
duke@435 477
duke@435 478 // Typing
duke@435 479 bool is_uncommon_trap_stub() const { return true; }
duke@435 480
duke@435 481 // Iteration
duke@435 482 void oops_do(OopClosure* f) {}
duke@435 483 };
duke@435 484
duke@435 485
duke@435 486 //----------------------------------------------------------------------------------------------------
duke@435 487 // ExceptionBlob: used for exception unwinding in compiled code (currently only used by Compiler 2)
duke@435 488
duke@435 489 class ExceptionBlob: public SingletonBlob {
duke@435 490 friend class VMStructs;
duke@435 491 private:
duke@435 492 // Creation support
duke@435 493 ExceptionBlob(
duke@435 494 CodeBuffer* cb,
duke@435 495 int size,
duke@435 496 OopMapSet* oop_maps,
duke@435 497 int frame_size
duke@435 498 );
duke@435 499
duke@435 500 void* operator new(size_t s, unsigned size);
duke@435 501
duke@435 502 public:
duke@435 503 // Creation
duke@435 504 static ExceptionBlob* create(
duke@435 505 CodeBuffer* cb,
duke@435 506 OopMapSet* oop_maps,
duke@435 507 int frame_size
duke@435 508 );
duke@435 509
duke@435 510 // GC for args
duke@435 511 void preserve_callee_argument_oops(frame fr, const RegisterMap* reg_map, OopClosure* f) { /* nothing to do */ }
duke@435 512
duke@435 513 // Typing
duke@435 514 bool is_exception_stub() const { return true; }
duke@435 515
duke@435 516 // Iteration
duke@435 517 void oops_do(OopClosure* f) {}
duke@435 518 };
duke@435 519 #endif // COMPILER2
duke@435 520
duke@435 521
duke@435 522 //----------------------------------------------------------------------------------------------------
duke@435 523 // SafepointBlob: handles illegal_instruction exceptions during a safepoint
duke@435 524
duke@435 525 class SafepointBlob: public SingletonBlob {
duke@435 526 friend class VMStructs;
duke@435 527 private:
duke@435 528 // Creation support
duke@435 529 SafepointBlob(
duke@435 530 CodeBuffer* cb,
duke@435 531 int size,
duke@435 532 OopMapSet* oop_maps,
duke@435 533 int frame_size
duke@435 534 );
duke@435 535
duke@435 536 void* operator new(size_t s, unsigned size);
duke@435 537
duke@435 538 public:
duke@435 539 // Creation
duke@435 540 static SafepointBlob* create(
duke@435 541 CodeBuffer* cb,
duke@435 542 OopMapSet* oop_maps,
duke@435 543 int frame_size
duke@435 544 );
duke@435 545
duke@435 546 // GC for args
duke@435 547 void preserve_callee_argument_oops(frame fr, const RegisterMap* reg_map, OopClosure* f) { /* nothing to do */ }
duke@435 548
duke@435 549 // Typing
duke@435 550 bool is_safepoint_stub() const { return true; }
duke@435 551
duke@435 552 // Iteration
duke@435 553 void oops_do(OopClosure* f) {}
duke@435 554 };

mercurial