103 int frame_size,
104 OopMapSet* oop_maps
105 );
106
107 // Deletion
108 void flush();
109
110 // Typing
111 virtual bool is_buffer_blob() const { return false; }
112 virtual bool is_nmethod() const { return false; }
113 virtual bool is_runtime_stub() const { return false; }
114 virtual bool is_deoptimization_stub() const { return false; }
115 virtual bool is_uncommon_trap_stub() const { return false; }
116 virtual bool is_exception_stub() const { return false; }
117 virtual bool is_safepoint_stub() const { return false; }
118 virtual bool is_adapter_blob() const { return false; }
119 virtual bool is_method_handles_adapter_blob() const { return false; }
120
121 virtual bool is_compiled_by_c2() const { return false; }
122 virtual bool is_compiled_by_c1() const { return false; }
123
124 // Casting
125 nmethod* as_nmethod_or_null() { return is_nmethod() ? (nmethod*) this : NULL; }
126
127 // Boundaries
128 address header_begin() const { return (address) this; }
129 address header_end() const { return ((address) this) + _header_size; };
130 relocInfo* relocation_begin() const { return (relocInfo*) header_end(); };
131 relocInfo* relocation_end() const { return (relocInfo*)(header_end() + _relocation_size); }
132 address content_begin() const { return (address) header_begin() + _content_offset; }
133 address content_end() const { return (address) header_begin() + _data_offset; }
134 address code_begin() const { return (address) header_begin() + _code_offset; }
135 address code_end() const { return (address) header_begin() + _data_offset; }
136 address data_begin() const { return (address) header_begin() + _data_offset; }
137 address data_end() const { return (address) header_begin() + _size; }
138
139 // Offsets
140 int relocation_offset() const { return _header_size; }
141 int content_offset() const { return _content_offset; }
142 int code_offset() const { return _code_offset; }
363 bool is_alive() const { return true; }
364
365 void verify(); // does nothing
366 void print_on(outputStream* st) const;
367 void print_value_on(outputStream* st) const;
368 };
369
370
371 //----------------------------------------------------------------------------------------------------
372 // DeoptimizationBlob
373
374 class DeoptimizationBlob: public SingletonBlob {
375 friend class VMStructs;
376 private:
377 int _unpack_offset;
378 int _unpack_with_exception;
379 int _unpack_with_reexecution;
380
381 int _unpack_with_exception_in_tls;
382
383 // Creation support
384 DeoptimizationBlob(
385 CodeBuffer* cb,
386 int size,
387 OopMapSet* oop_maps,
388 int unpack_offset,
389 int unpack_with_exception_offset,
390 int unpack_with_reexecution_offset,
391 int frame_size
392 );
393
394 public:
395 // Creation
396 static DeoptimizationBlob* create(
397 CodeBuffer* cb,
398 OopMapSet* oop_maps,
399 int unpack_offset,
400 int unpack_with_exception_offset,
401 int unpack_with_reexecution_offset,
402 int frame_size
412 // GC for args
413 void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { /* Nothing to do */ }
414
415 // Printing
416 void print_value_on(outputStream* st) const;
417
418 address unpack() const { return code_begin() + _unpack_offset; }
419 address unpack_with_exception() const { return code_begin() + _unpack_with_exception; }
420 address unpack_with_reexecution() const { return code_begin() + _unpack_with_reexecution; }
421
422 // Alternate entry point for C1 where the exception and issuing pc
423 // are in JavaThread::_exception_oop and JavaThread::_exception_pc
424 // instead of being in registers. This is needed because C1 doesn't
425 // model exception paths in a way that keeps these registers free so
426 // there may be live values in those registers during deopt.
427 void set_unpack_with_exception_in_tls_offset(int offset) {
428 _unpack_with_exception_in_tls = offset;
429 assert(code_contains(code_begin() + _unpack_with_exception_in_tls), "must be PC inside codeblob");
430 }
431 address unpack_with_exception_in_tls() const { return code_begin() + _unpack_with_exception_in_tls; }
432 };
433
434
435 //----------------------------------------------------------------------------------------------------
436 // UncommonTrapBlob (currently only used by Compiler 2)
437
438 #ifdef COMPILER2
439
440 class UncommonTrapBlob: public SingletonBlob {
441 friend class VMStructs;
442 private:
443 // Creation support
444 UncommonTrapBlob(
445 CodeBuffer* cb,
446 int size,
447 OopMapSet* oop_maps,
448 int frame_size
449 );
450
451 public:
|
103 int frame_size,
104 OopMapSet* oop_maps
105 );
106
107 // Deletion
108 void flush();
109
110 // Typing
111 virtual bool is_buffer_blob() const { return false; }
112 virtual bool is_nmethod() const { return false; }
113 virtual bool is_runtime_stub() const { return false; }
114 virtual bool is_deoptimization_stub() const { return false; }
115 virtual bool is_uncommon_trap_stub() const { return false; }
116 virtual bool is_exception_stub() const { return false; }
117 virtual bool is_safepoint_stub() const { return false; }
118 virtual bool is_adapter_blob() const { return false; }
119 virtual bool is_method_handles_adapter_blob() const { return false; }
120
121 virtual bool is_compiled_by_c2() const { return false; }
122 virtual bool is_compiled_by_c1() const { return false; }
123 virtual bool is_compiled_by_jvmci() const { return false; }
124
125 // Casting
126 nmethod* as_nmethod_or_null() { return is_nmethod() ? (nmethod*) this : NULL; }
127
128 // Boundaries
129 address header_begin() const { return (address) this; }
130 address header_end() const { return ((address) this) + _header_size; };
131 relocInfo* relocation_begin() const { return (relocInfo*) header_end(); };
132 relocInfo* relocation_end() const { return (relocInfo*)(header_end() + _relocation_size); }
133 address content_begin() const { return (address) header_begin() + _content_offset; }
134 address content_end() const { return (address) header_begin() + _data_offset; }
135 address code_begin() const { return (address) header_begin() + _code_offset; }
136 address code_end() const { return (address) header_begin() + _data_offset; }
137 address data_begin() const { return (address) header_begin() + _data_offset; }
138 address data_end() const { return (address) header_begin() + _size; }
139
140 // Offsets
141 int relocation_offset() const { return _header_size; }
142 int content_offset() const { return _content_offset; }
143 int code_offset() const { return _code_offset; }
364 bool is_alive() const { return true; }
365
366 void verify(); // does nothing
367 void print_on(outputStream* st) const;
368 void print_value_on(outputStream* st) const;
369 };
370
371
372 //----------------------------------------------------------------------------------------------------
373 // DeoptimizationBlob
374
375 class DeoptimizationBlob: public SingletonBlob {
376 friend class VMStructs;
377 private:
378 int _unpack_offset;
379 int _unpack_with_exception;
380 int _unpack_with_reexecution;
381
382 int _unpack_with_exception_in_tls;
383
384 #if INCLUDE_JVMCI
385 // Offsets when JVMCI calls uncommon_trap.
386 int _uncommon_trap_offset;
387 int _implicit_exception_uncommon_trap_offset;
388 #endif
389
390 // Creation support
391 DeoptimizationBlob(
392 CodeBuffer* cb,
393 int size,
394 OopMapSet* oop_maps,
395 int unpack_offset,
396 int unpack_with_exception_offset,
397 int unpack_with_reexecution_offset,
398 int frame_size
399 );
400
401 public:
402 // Creation
403 static DeoptimizationBlob* create(
404 CodeBuffer* cb,
405 OopMapSet* oop_maps,
406 int unpack_offset,
407 int unpack_with_exception_offset,
408 int unpack_with_reexecution_offset,
409 int frame_size
419 // GC for args
420 void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { /* Nothing to do */ }
421
422 // Printing
423 void print_value_on(outputStream* st) const;
424
425 address unpack() const { return code_begin() + _unpack_offset; }
426 address unpack_with_exception() const { return code_begin() + _unpack_with_exception; }
427 address unpack_with_reexecution() const { return code_begin() + _unpack_with_reexecution; }
428
429 // Alternate entry point for C1 where the exception and issuing pc
430 // are in JavaThread::_exception_oop and JavaThread::_exception_pc
431 // instead of being in registers. This is needed because C1 doesn't
432 // model exception paths in a way that keeps these registers free so
433 // there may be live values in those registers during deopt.
434 void set_unpack_with_exception_in_tls_offset(int offset) {
435 _unpack_with_exception_in_tls = offset;
436 assert(code_contains(code_begin() + _unpack_with_exception_in_tls), "must be PC inside codeblob");
437 }
438 address unpack_with_exception_in_tls() const { return code_begin() + _unpack_with_exception_in_tls; }
439
440 #if INCLUDE_JVMCI
441 // Offsets when JVMCI calls uncommon_trap.
442 void set_uncommon_trap_offset(int offset) {
443 _uncommon_trap_offset = offset;
444 assert(contains(code_begin() + _uncommon_trap_offset), "must be PC inside codeblob");
445 }
446 address uncommon_trap() const { return code_begin() + _uncommon_trap_offset; }
447
448 void set_implicit_exception_uncommon_trap_offset(int offset) {
449 _implicit_exception_uncommon_trap_offset = offset;
450 assert(contains(code_begin() + _implicit_exception_uncommon_trap_offset), "must be PC inside codeblob");
451 }
452 address implicit_exception_uncommon_trap() const { return code_begin() + _implicit_exception_uncommon_trap_offset; }
453 #endif // INCLUDE_JVMCI
454 };
455
456
457 //----------------------------------------------------------------------------------------------------
458 // UncommonTrapBlob (currently only used by Compiler 2)
459
460 #ifdef COMPILER2
461
462 class UncommonTrapBlob: public SingletonBlob {
463 friend class VMStructs;
464 private:
465 // Creation support
466 UncommonTrapBlob(
467 CodeBuffer* cb,
468 int size,
469 OopMapSet* oop_maps,
470 int frame_size
471 );
472
473 public:
|