232 233 // Mark a section frozen. Assign its remaining space to 234 // the following section. It will never expand after this point. 235 inline void freeze(); // { _outer->freeze_section(this); } 236 237 // Ensure there's enough space left in the current section. 238 // Return true if there was an expansion. 239 bool maybe_expand_to_ensure_remaining(csize_t amount); 240 241 #ifndef PRODUCT 242 void decode(); 243 void print(const char* name); 244 #endif //PRODUCT 245 }; 246 247 class CodeString; 248 class CodeStrings { 249 private: 250 #ifndef PRODUCT 251 CodeString* _strings; 252 #ifdef ASSERT 253 // Becomes true after copy-out, forbids further use. 254 bool _defunct; // Zero bit pattern is "valid", see memset call in decode_env::decode_env 255 #endif 256 static const char* _prefix; // defaults to " ;; " 257 #endif 258 259 CodeString* find(intptr_t offset) const; 260 CodeString* find_last(intptr_t offset) const; 261 262 void set_null_and_invalidate() { 263 #ifndef PRODUCT 264 _strings = NULL; 265 #ifdef ASSERT 266 _defunct = true; 267 #endif 268 #endif 269 } 270 271 public: 272 CodeStrings() { 273 #ifndef PRODUCT 274 _strings = NULL; 275 #ifdef ASSERT 276 _defunct = false; 277 #endif 278 #endif 279 } 280 281 bool is_null() { 282 #ifdef ASSERT 283 return _strings == NULL; 284 #else 285 return true; 286 #endif 287 } 288 289 const char* add_string(const char * string) PRODUCT_RETURN_(return NULL;); 290 291 void add_comment(intptr_t offset, const char * comment) PRODUCT_RETURN; 292 bool has_block_comment(intptr_t offset) const; 293 void print_block_comment(outputStream* stream, intptr_t offset) const PRODUCT_RETURN; 294 // MOVE strings from other to this; invalidate other. | 232 233 // Mark a section frozen. Assign its remaining space to 234 // the following section. It will never expand after this point. 235 inline void freeze(); // { _outer->freeze_section(this); } 236 237 // Ensure there's enough space left in the current section. 238 // Return true if there was an expansion. 239 bool maybe_expand_to_ensure_remaining(csize_t amount); 240 241 #ifndef PRODUCT 242 void decode(); 243 void print(const char* name); 244 #endif //PRODUCT 245 }; 246 247 class CodeString; 248 class CodeStrings { 249 private: 250 #ifndef PRODUCT 251 CodeString* _strings; 252 CodeString* _strings_last; 253 #ifdef ASSERT 254 // Becomes true after copy-out, forbids further use. 255 bool _defunct; // Zero bit pattern is "valid", see memset call in decode_env::decode_env 256 #endif 257 static const char* _prefix; // defaults to " ;; " 258 #endif 259 260 CodeString* find(intptr_t offset) const; 261 CodeString* find_last(intptr_t offset) const; 262 263 void set_null_and_invalidate() { 264 #ifndef PRODUCT 265 _strings = NULL; 266 _strings_last = NULL; 267 #ifdef ASSERT 268 _defunct = true; 269 #endif 270 #endif 271 } 272 273 public: 274 CodeStrings() { 275 #ifndef PRODUCT 276 _strings = NULL; 277 _strings_last = NULL; 278 #ifdef ASSERT 279 _defunct = false; 280 #endif 281 #endif 282 } 283 284 bool is_null() { 285 #ifdef ASSERT 286 return _strings == NULL; 287 #else 288 return true; 289 #endif 290 } 291 292 const char* add_string(const char * string) PRODUCT_RETURN_(return NULL;); 293 294 void add_comment(intptr_t offset, const char * comment) PRODUCT_RETURN; 295 bool has_block_comment(intptr_t offset) const; 296 void print_block_comment(outputStream* stream, intptr_t offset) const PRODUCT_RETURN; 297 // MOVE strings from other to this; invalidate other. |