Mercurial > hg > graal-jvmci-8
comparison src/share/vm/code/codeBlob.hpp @ 3464:be4ca325525a
Merge.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 27 Jul 2011 17:32:44 -0700 |
parents | 75a99b4f1c98 167b70ff3abc |
children | 2f2c6347fce4 |
comparison
equal
deleted
inserted
replaced
3239:7c4b4daac19b | 3464:be4ca325525a |
---|---|
33 // CodeBlob - superclass for all entries in the CodeCache. | 33 // CodeBlob - superclass for all entries in the CodeCache. |
34 // | 34 // |
35 // Suptypes are: | 35 // Suptypes are: |
36 // nmethod : Compiled Java methods (include method that calls to native code) | 36 // nmethod : Compiled Java methods (include method that calls to native code) |
37 // RuntimeStub : Call to VM runtime methods | 37 // RuntimeStub : Call to VM runtime methods |
38 // RicochetBlob : Used for blocking MethodHandle adapters | |
38 // DeoptimizationBlob : Used for deoptimizatation | 39 // DeoptimizationBlob : Used for deoptimizatation |
39 // ExceptionBlob : Used for stack unrolling | 40 // ExceptionBlob : Used for stack unrolling |
40 // SafepointBlob : Used to handle illegal instruction exceptions | 41 // SafepointBlob : Used to handle illegal instruction exceptions |
41 // | 42 // |
42 // | 43 // |
93 | 94 |
94 // Deletion | 95 // Deletion |
95 void flush(); | 96 void flush(); |
96 | 97 |
97 // Typing | 98 // Typing |
98 virtual bool is_buffer_blob() const { return false; } | 99 virtual bool is_buffer_blob() const { return false; } |
99 virtual bool is_nmethod() const { return false; } | 100 virtual bool is_nmethod() const { return false; } |
100 virtual bool is_runtime_stub() const { return false; } | 101 virtual bool is_runtime_stub() const { return false; } |
101 virtual bool is_deoptimization_stub() const { return false; } | 102 virtual bool is_ricochet_stub() const { return false; } |
102 virtual bool is_uncommon_trap_stub() const { return false; } | 103 virtual bool is_deoptimization_stub() const { return false; } |
103 virtual bool is_exception_stub() const { return false; } | 104 virtual bool is_uncommon_trap_stub() const { return false; } |
105 virtual bool is_exception_stub() const { return false; } | |
104 virtual bool is_safepoint_stub() const { return false; } | 106 virtual bool is_safepoint_stub() const { return false; } |
105 virtual bool is_adapter_blob() const { return false; } | 107 virtual bool is_adapter_blob() const { return false; } |
106 virtual bool is_method_handles_adapter_blob() const { return false; } | 108 virtual bool is_method_handles_adapter_blob() const { return false; } |
107 | 109 |
108 virtual bool is_compiled_by_c2() const { return false; } | 110 virtual bool is_compiled_by_c2() const { return false; } |
180 virtual void verify(); | 182 virtual void verify(); |
181 void print() const { print_on(tty); } | 183 void print() const { print_on(tty); } |
182 virtual void print_on(outputStream* st) const; | 184 virtual void print_on(outputStream* st) const; |
183 virtual void print_value_on(outputStream* st) const; | 185 virtual void print_value_on(outputStream* st) const; |
184 | 186 |
187 // Deal with Disassembler, VTune, Forte, JvmtiExport, MemoryService. | |
188 static void trace_new_stub(CodeBlob* blob, const char* name1, const char* name2 = ""); | |
189 | |
185 // Print the comment associated with offset on stream, if there is one | 190 // Print the comment associated with offset on stream, if there is one |
186 virtual void print_block_comment(outputStream* stream, address block_begin) { | 191 virtual void print_block_comment(outputStream* stream, address block_begin) { |
187 intptr_t offset = (intptr_t)(block_begin - code_begin()); | 192 intptr_t offset = (intptr_t)(block_begin - code_begin()); |
188 _comments.print_block_comment(stream, offset); | 193 _comments.print_block_comment(stream, offset); |
189 } | 194 } |
316 //---------------------------------------------------------------------------------------------------- | 321 //---------------------------------------------------------------------------------------------------- |
317 // Super-class for all blobs that exist in only one instance. Implements default behaviour. | 322 // Super-class for all blobs that exist in only one instance. Implements default behaviour. |
318 | 323 |
319 class SingletonBlob: public CodeBlob { | 324 class SingletonBlob: public CodeBlob { |
320 friend class VMStructs; | 325 friend class VMStructs; |
321 public: | 326 |
327 protected: | |
328 void* operator new(size_t s, unsigned size); | |
329 | |
330 public: | |
322 SingletonBlob( | 331 SingletonBlob( |
323 const char* name, | 332 const char* name, |
324 CodeBuffer* cb, | 333 CodeBuffer* cb, |
325 int header_size, | 334 int header_size, |
326 int size, | 335 int size, |
339 void print_value_on(outputStream* st) const; | 348 void print_value_on(outputStream* st) const; |
340 }; | 349 }; |
341 | 350 |
342 | 351 |
343 //---------------------------------------------------------------------------------------------------- | 352 //---------------------------------------------------------------------------------------------------- |
353 // RicochetBlob | |
354 // Holds an arbitrary argument list indefinitely while Java code executes recursively. | |
355 | |
356 class RicochetBlob: public SingletonBlob { | |
357 friend class VMStructs; | |
358 private: | |
359 | |
360 int _bounce_offset; | |
361 int _exception_offset; | |
362 | |
363 // Creation support | |
364 RicochetBlob( | |
365 CodeBuffer* cb, | |
366 int size, | |
367 int bounce_offset, | |
368 int exception_offset, | |
369 int frame_size | |
370 ); | |
371 | |
372 public: | |
373 // Creation | |
374 static RicochetBlob* create( | |
375 CodeBuffer* cb, | |
376 int bounce_offset, | |
377 int exception_offset, | |
378 int frame_size | |
379 ); | |
380 | |
381 // Typing | |
382 bool is_ricochet_stub() const { return true; } | |
383 | |
384 // GC for args | |
385 void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { /* Nothing to do */ } | |
386 | |
387 address bounce_addr() const { return code_begin() + _bounce_offset; } | |
388 address exception_addr() const { return code_begin() + _exception_offset; } | |
389 bool returns_to_bounce_addr(address pc) const { | |
390 address bounce_pc = bounce_addr(); | |
391 return (pc == bounce_pc || (pc + frame::pc_return_offset) == bounce_pc); | |
392 } | |
393 }; | |
394 | |
395 | |
396 //---------------------------------------------------------------------------------------------------- | |
344 // DeoptimizationBlob | 397 // DeoptimizationBlob |
345 | 398 |
346 class DeoptimizationBlob: public SingletonBlob { | 399 class DeoptimizationBlob: public SingletonBlob { |
347 friend class VMStructs; | 400 friend class VMStructs; |
348 private: | 401 private: |
366 int unpack_with_exception_offset, | 419 int unpack_with_exception_offset, |
367 int unpack_with_reexecution_offset, | 420 int unpack_with_reexecution_offset, |
368 int frame_size | 421 int frame_size |
369 ); | 422 ); |
370 | 423 |
371 void* operator new(size_t s, unsigned size); | |
372 | |
373 public: | 424 public: |
374 // Creation | 425 // Creation |
375 static DeoptimizationBlob* create( | 426 static DeoptimizationBlob* create( |
376 CodeBuffer* cb, | 427 CodeBuffer* cb, |
377 OopMapSet* oop_maps, | 428 OopMapSet* oop_maps, |
381 int frame_size | 432 int frame_size |
382 ); | 433 ); |
383 | 434 |
384 // Typing | 435 // Typing |
385 bool is_deoptimization_stub() const { return true; } | 436 bool is_deoptimization_stub() const { return true; } |
386 const DeoptimizationBlob *as_deoptimization_stub() const { return this; } | |
387 bool exception_address_is_unpack_entry(address pc) const { | 437 bool exception_address_is_unpack_entry(address pc) const { |
388 address unpack_pc = unpack(); | 438 address unpack_pc = unpack(); |
389 return (pc == unpack_pc || (pc + frame::pc_return_offset) == unpack_pc); | 439 return (pc == unpack_pc || (pc + frame::pc_return_offset) == unpack_pc); |
390 } | 440 } |
391 | 441 |
442 int size, | 492 int size, |
443 OopMapSet* oop_maps, | 493 OopMapSet* oop_maps, |
444 int frame_size | 494 int frame_size |
445 ); | 495 ); |
446 | 496 |
447 void* operator new(size_t s, unsigned size); | |
448 | |
449 public: | 497 public: |
450 // Creation | 498 // Creation |
451 static UncommonTrapBlob* create( | 499 static UncommonTrapBlob* create( |
452 CodeBuffer* cb, | 500 CodeBuffer* cb, |
453 OopMapSet* oop_maps, | 501 OopMapSet* oop_maps, |
474 int size, | 522 int size, |
475 OopMapSet* oop_maps, | 523 OopMapSet* oop_maps, |
476 int frame_size | 524 int frame_size |
477 ); | 525 ); |
478 | 526 |
479 void* operator new(size_t s, unsigned size); | |
480 | |
481 public: | 527 public: |
482 // Creation | 528 // Creation |
483 static ExceptionBlob* create( | 529 static ExceptionBlob* create( |
484 CodeBuffer* cb, | 530 CodeBuffer* cb, |
485 OopMapSet* oop_maps, | 531 OopMapSet* oop_maps, |
507 int size, | 553 int size, |
508 OopMapSet* oop_maps, | 554 OopMapSet* oop_maps, |
509 int frame_size | 555 int frame_size |
510 ); | 556 ); |
511 | 557 |
512 void* operator new(size_t s, unsigned size); | |
513 | |
514 public: | 558 public: |
515 // Creation | 559 // Creation |
516 static SafepointBlob* create( | 560 static SafepointBlob* create( |
517 CodeBuffer* cb, | 561 CodeBuffer* cb, |
518 OopMapSet* oop_maps, | 562 OopMapSet* oop_maps, |