Mercurial > hg > graal-compiler
comparison src/share/vm/asm/codeBuffer.hpp @ 7206:d2f8c38e543d
Merge
author | roland |
---|---|
date | Fri, 07 Dec 2012 01:09:03 -0800 |
parents | cd3d6a6b95d9 |
children | a5de0cc2f91c |
comparison
equal
deleted
inserted
replaced
7191:816b7e5bf2ed | 7206:d2f8c38e543d |
---|---|
23 */ | 23 */ |
24 | 24 |
25 #ifndef SHARE_VM_ASM_CODEBUFFER_HPP | 25 #ifndef SHARE_VM_ASM_CODEBUFFER_HPP |
26 #define SHARE_VM_ASM_CODEBUFFER_HPP | 26 #define SHARE_VM_ASM_CODEBUFFER_HPP |
27 | 27 |
28 #include "asm/assembler.hpp" | |
29 #include "code/oopRecorder.hpp" | 28 #include "code/oopRecorder.hpp" |
30 #include "code/relocInfo.hpp" | 29 #include "code/relocInfo.hpp" |
31 | 30 |
32 class CodeComments; | 31 class CodeComments; |
33 class AbstractAssembler; | 32 class PhaseCFG; |
34 class MacroAssembler; | 33 class Compile; |
35 class PhaseCFG; | 34 class BufferBlob; |
36 class Compile; | 35 class CodeBuffer; |
37 class BufferBlob; | 36 class Label; |
38 class CodeBuffer; | |
39 | 37 |
40 class CodeOffsets: public StackObj { | 38 class CodeOffsets: public StackObj { |
41 public: | 39 public: |
42 enum Entries { Entry, | 40 enum Entries { Entry, |
43 Verified_Entry, | 41 Verified_Entry, |
192 assert(allocates2(pc), "relocation addr must be in this section"); | 190 assert(allocates2(pc), "relocation addr must be in this section"); |
193 _locs_point = pc; | 191 _locs_point = pc; |
194 } | 192 } |
195 | 193 |
196 // Code emission | 194 // Code emission |
197 void emit_int8 (int8_t x) { *((int8_t*) end()) = x; set_end(end() + 1); } | 195 void emit_int8 ( int8_t x) { *((int8_t*) end()) = x; set_end(end() + sizeof(int8_t)); } |
198 void emit_int16(int16_t x) { *((int16_t*) end()) = x; set_end(end() + 2); } | 196 void emit_int16( int16_t x) { *((int16_t*) end()) = x; set_end(end() + sizeof(int16_t)); } |
199 void emit_int32(int32_t x) { *((int32_t*) end()) = x; set_end(end() + 4); } | 197 void emit_int32( int32_t x) { *((int32_t*) end()) = x; set_end(end() + sizeof(int32_t)); } |
200 void emit_int64(int64_t x) { *((int64_t*) end()) = x; set_end(end() + 8); } | 198 void emit_int64( int64_t x) { *((int64_t*) end()) = x; set_end(end() + sizeof(int64_t)); } |
199 | |
200 void emit_float( jfloat x) { *((jfloat*) end()) = x; set_end(end() + sizeof(jfloat)); } | |
201 void emit_double(jdouble x) { *((jdouble*) end()) = x; set_end(end() + sizeof(jdouble)); } | |
202 void emit_address(address x) { *((address*) end()) = x; set_end(end() + sizeof(address)); } | |
201 | 203 |
202 // Share a scratch buffer for relocinfo. (Hacky; saves a resource allocation.) | 204 // Share a scratch buffer for relocinfo. (Hacky; saves a resource allocation.) |
203 void initialize_shared_locs(relocInfo* buf, int length); | 205 void initialize_shared_locs(relocInfo* buf, int length); |
204 | 206 |
205 // Manage labels and their addresses. | 207 // Manage labels and their addresses. |
449 static int locator_sect(int locator) { return locator & sect_mask; } | 451 static int locator_sect(int locator) { return locator & sect_mask; } |
450 static int locator(int pos, int sect) { return (pos << sect_bits) | sect; } | 452 static int locator(int pos, int sect) { return (pos << sect_bits) | sect; } |
451 int locator(address addr) const; | 453 int locator(address addr) const; |
452 address locator_address(int locator) const; | 454 address locator_address(int locator) const; |
453 | 455 |
456 // Heuristic for pre-packing the taken/not-taken bit of a predicted branch. | |
457 bool is_backward_branch(Label& L); | |
458 | |
454 // Properties | 459 // Properties |
455 const char* name() const { return _name; } | 460 const char* name() const { return _name; } |
456 CodeBuffer* before_expand() const { return _before_expand; } | 461 CodeBuffer* before_expand() const { return _before_expand; } |
457 BufferBlob* blob() const { return _blob; } | 462 BufferBlob* blob() const { return _blob; } |
458 void set_blob(BufferBlob* blob); | 463 void set_blob(BufferBlob* blob); |