comparison src/share/vm/asm/assembler.hpp @ 4114:6729bbc1fcd6

7003454: order constants in constant table by number of references in code Reviewed-by: kvn, never, bdelsart
author twisti
date Wed, 16 Nov 2011 01:39:50 -0800
parents 1d1603768966
children 40c2484c09e1
comparison
equal deleted inserted replaced
4113:8c57262447d3 4114:6729bbc1fcd6
254 // save end pointer back to code buf. 254 // save end pointer back to code buf.
255 void sync(); 255 void sync();
256 256
257 // ensure buf contains all code (call this before using/copying the code) 257 // ensure buf contains all code (call this before using/copying the code)
258 void flush(); 258 void flush();
259
260 // min and max values for signed immediate ranges
261 static int min_simm(int nbits) { return -(intptr_t(1) << (nbits - 1)) ; }
262 static int max_simm(int nbits) { return (intptr_t(1) << (nbits - 1)) - 1; }
263
264 // Define some:
265 static int min_simm10() { return min_simm(10); }
266 static int min_simm13() { return min_simm(13); }
267 static int min_simm16() { return min_simm(16); }
268
269 // Test if x is within signed immediate range for nbits
270 static bool is_simm(intptr_t x, int nbits) { return min_simm(nbits) <= x && x <= max_simm(nbits); }
271
272 // Define some:
273 static bool is_simm5( intptr_t x) { return is_simm(x, 5 ); }
274 static bool is_simm8( intptr_t x) { return is_simm(x, 8 ); }
275 static bool is_simm10(intptr_t x) { return is_simm(x, 10); }
276 static bool is_simm11(intptr_t x) { return is_simm(x, 11); }
277 static bool is_simm12(intptr_t x) { return is_simm(x, 12); }
278 static bool is_simm13(intptr_t x) { return is_simm(x, 13); }
279 static bool is_simm16(intptr_t x) { return is_simm(x, 16); }
280 static bool is_simm26(intptr_t x) { return is_simm(x, 26); }
281 static bool is_simm32(intptr_t x) { return is_simm(x, 32); }
259 282
260 // Accessors 283 // Accessors
261 CodeBuffer* code() const; // _code_section->outer() 284 CodeBuffer* code() const; // _code_section->outer()
262 CodeSection* code_section() const { return _code_section; } 285 CodeSection* code_section() const { return _code_section; }
263 int sect() const; // return _code_section->index() 286 int sect() const; // return _code_section->index()