Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(449)

Side by Side Diff: src/assembler.h

Issue 10837037: Age code to allow reclaiming old unexecuted functions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Cleanup code Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/assembler.cc » ('j') | src/compiler.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 INTERNAL_REFERENCE, // An address inside the same function. 204 INTERNAL_REFERENCE, // An address inside the same function.
205 205
206 // Marks a constant pool. Only used on ARM. 206 // Marks a constant pool. Only used on ARM.
207 // It uses a custom noncompact encoding. 207 // It uses a custom noncompact encoding.
208 CONST_POOL, 208 CONST_POOL,
209 209
210 // add more as needed 210 // add more as needed
211 // Pseudo-types 211 // Pseudo-types
212 NUMBER_OF_MODES, // There are at most 15 modes with noncompact encoding. 212 NUMBER_OF_MODES, // There are at most 15 modes with noncompact encoding.
213 NONE, // never recorded 213 NONE, // never recorded
214 CODE_AGE_SEQUENCE, // Not stored in RelocInfo array, used explictly by
215 // code aging.
216 FIRST_REAL_RELOC_MODE = CODE_TARGET,
217 LAST_REAL_RELOC_MODE = CONST_POOL,
218 FIRST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE,
219 LAST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE,
214 LAST_CODE_ENUM = DEBUG_BREAK, 220 LAST_CODE_ENUM = DEBUG_BREAK,
215 LAST_GCED_ENUM = GLOBAL_PROPERTY_CELL, 221 LAST_GCED_ENUM = GLOBAL_PROPERTY_CELL,
216 // Modes <= LAST_COMPACT_ENUM are guaranteed to have compact encoding. 222 // Modes <= LAST_COMPACT_ENUM are guaranteed to have compact encoding.
217 LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID, 223 LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID,
218 LAST_STANDARD_NONCOMPACT_ENUM = INTERNAL_REFERENCE 224 LAST_STANDARD_NONCOMPACT_ENUM = INTERNAL_REFERENCE
219 }; 225 };
220 226
221 227
222 RelocInfo() {} 228 RelocInfo() {}
223 229
224 RelocInfo(byte* pc, Mode rmode, intptr_t data, Code* host) 230 RelocInfo(byte* pc, Mode rmode, intptr_t data, Code* host)
225 : pc_(pc), rmode_(rmode), data_(data), host_(host) { 231 : pc_(pc), rmode_(rmode), data_(data), host_(host) {
226 } 232 }
227 233
234 static inline bool IsRealRelocMode(Mode mode) {
235 return mode >= FIRST_REAL_RELOC_MODE &&
236 mode <= LAST_REAL_RELOC_MODE;
237 }
238 static inline bool IsPseudoRelocMode(Mode mode) {
239 ASSERT(!IsRealRelocMode(mode));
240 return mode >= FIRST_PSEUDO_RELOC_MODE &&
241 mode <= LAST_PSEUDO_RELOC_MODE;
242 }
228 static inline bool IsConstructCall(Mode mode) { 243 static inline bool IsConstructCall(Mode mode) {
229 return mode == CONSTRUCT_CALL; 244 return mode == CONSTRUCT_CALL;
230 } 245 }
231 static inline bool IsCodeTarget(Mode mode) { 246 static inline bool IsCodeTarget(Mode mode) {
232 return mode <= LAST_CODE_ENUM; 247 return mode <= LAST_CODE_ENUM;
233 } 248 }
234 static inline bool IsEmbeddedObject(Mode mode) { 249 static inline bool IsEmbeddedObject(Mode mode) {
235 return mode == EMBEDDED_OBJECT; 250 return mode == EMBEDDED_OBJECT;
236 } 251 }
237 // Is the relocation mode affected by GC? 252 // Is the relocation mode affected by GC?
(...skipping 17 matching lines...) Expand all
255 } 270 }
256 static inline bool IsExternalReference(Mode mode) { 271 static inline bool IsExternalReference(Mode mode) {
257 return mode == EXTERNAL_REFERENCE; 272 return mode == EXTERNAL_REFERENCE;
258 } 273 }
259 static inline bool IsInternalReference(Mode mode) { 274 static inline bool IsInternalReference(Mode mode) {
260 return mode == INTERNAL_REFERENCE; 275 return mode == INTERNAL_REFERENCE;
261 } 276 }
262 static inline bool IsDebugBreakSlot(Mode mode) { 277 static inline bool IsDebugBreakSlot(Mode mode) {
263 return mode == DEBUG_BREAK_SLOT; 278 return mode == DEBUG_BREAK_SLOT;
264 } 279 }
280 static inline bool IsCodeAgeSequence(Mode mode) {
281 return mode == CODE_AGE_SEQUENCE;
282 }
265 static inline int ModeMask(Mode mode) { return 1 << mode; } 283 static inline int ModeMask(Mode mode) { return 1 << mode; }
266 284
267 // Accessors 285 // Accessors
268 byte* pc() const { return pc_; } 286 byte* pc() const { return pc_; }
269 void set_pc(byte* pc) { pc_ = pc; } 287 void set_pc(byte* pc) { pc_ = pc; }
270 Mode rmode() const { return rmode_; } 288 Mode rmode() const { return rmode_; }
271 intptr_t data() const { return data_; } 289 intptr_t data() const { return data_; }
272 Code* host() const { return host_; } 290 Code* host() const { return host_; }
273 291
274 // Apply a relocation by delta bytes 292 // Apply a relocation by delta bytes
(...skipping 12 matching lines...) Expand all
287 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); 305 WriteBarrierMode mode = UPDATE_WRITE_BARRIER));
288 INLINE(Object* target_object()); 306 INLINE(Object* target_object());
289 INLINE(Handle<Object> target_object_handle(Assembler* origin)); 307 INLINE(Handle<Object> target_object_handle(Assembler* origin));
290 INLINE(Object** target_object_address()); 308 INLINE(Object** target_object_address());
291 INLINE(void set_target_object(Object* target, 309 INLINE(void set_target_object(Object* target,
292 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); 310 WriteBarrierMode mode = UPDATE_WRITE_BARRIER));
293 INLINE(JSGlobalPropertyCell* target_cell()); 311 INLINE(JSGlobalPropertyCell* target_cell());
294 INLINE(Handle<JSGlobalPropertyCell> target_cell_handle()); 312 INLINE(Handle<JSGlobalPropertyCell> target_cell_handle());
295 INLINE(void set_target_cell(JSGlobalPropertyCell* cell, 313 INLINE(void set_target_cell(JSGlobalPropertyCell* cell,
296 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); 314 WriteBarrierMode mode = UPDATE_WRITE_BARRIER));
297 315 INLINE(Code* code_age_stub());
316 INLINE(void set_code_age_stub(Code* stub));
298 317
299 // Read the address of the word containing the target_address in an 318 // Read the address of the word containing the target_address in an
300 // instruction stream. What this means exactly is architecture-independent. 319 // instruction stream. What this means exactly is architecture-independent.
301 // The only architecture-independent user of this function is the serializer. 320 // The only architecture-independent user of this function is the serializer.
302 // The serializer uses it to find out how many raw bytes of instruction to 321 // The serializer uses it to find out how many raw bytes of instruction to
303 // output before the next target. Architecture-independent code shouldn't 322 // output before the next target. Architecture-independent code shouldn't
304 // dereference the pointer it gets back from this. 323 // dereference the pointer it gets back from this.
305 INLINE(Address target_address_address()); 324 INLINE(Address target_address_address());
306 // This indicates how much space a target takes up when deserializing a code 325 // This indicates how much space a target takes up when deserializing a code
307 // stream. For most architectures this is just the size of a pointer. For 326 // stream. For most architectures this is just the size of a pointer. For
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 void ReadTaggedPosition(); 502 void ReadTaggedPosition();
484 503
485 // If the given mode is wanted, set it in rinfo_ and return true. 504 // If the given mode is wanted, set it in rinfo_ and return true.
486 // Else return false. Used for efficiently skipping unwanted modes. 505 // Else return false. Used for efficiently skipping unwanted modes.
487 bool SetMode(RelocInfo::Mode mode) { 506 bool SetMode(RelocInfo::Mode mode) {
488 return (mode_mask_ & (1 << mode)) ? (rinfo_.rmode_ = mode, true) : false; 507 return (mode_mask_ & (1 << mode)) ? (rinfo_.rmode_ = mode, true) : false;
489 } 508 }
490 509
491 byte* pos_; 510 byte* pos_;
492 byte* end_; 511 byte* end_;
512 byte* code_age_sequence_;
493 RelocInfo rinfo_; 513 RelocInfo rinfo_;
494 bool done_; 514 bool done_;
495 int mode_mask_; 515 int mode_mask_;
496 int last_id_; 516 int last_id_;
497 int last_position_; 517 int last_position_;
498 DISALLOW_COPY_AND_ASSIGN(RelocIterator); 518 DISALLOW_COPY_AND_ASSIGN(RelocIterator);
499 }; 519 };
500 520
501 521
502 //------------------------------------------------------------------------------ 522 //------------------------------------------------------------------------------
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 static ExternalReference perform_gc_function(Isolate* isolate); 611 static ExternalReference perform_gc_function(Isolate* isolate);
592 static ExternalReference fill_heap_number_with_random_function( 612 static ExternalReference fill_heap_number_with_random_function(
593 Isolate* isolate); 613 Isolate* isolate);
594 static ExternalReference random_uint32_function(Isolate* isolate); 614 static ExternalReference random_uint32_function(Isolate* isolate);
595 static ExternalReference transcendental_cache_array_address(Isolate* isolate); 615 static ExternalReference transcendental_cache_array_address(Isolate* isolate);
596 static ExternalReference delete_handle_scope_extensions(Isolate* isolate); 616 static ExternalReference delete_handle_scope_extensions(Isolate* isolate);
597 617
598 static ExternalReference get_date_field_function(Isolate* isolate); 618 static ExternalReference get_date_field_function(Isolate* isolate);
599 static ExternalReference date_cache_stamp(Isolate* isolate); 619 static ExternalReference date_cache_stamp(Isolate* isolate);
600 620
621 static ExternalReference get_make_code_young_function(Isolate* isolate);
622
601 // Deoptimization support. 623 // Deoptimization support.
602 static ExternalReference new_deoptimizer_function(Isolate* isolate); 624 static ExternalReference new_deoptimizer_function(Isolate* isolate);
603 static ExternalReference compute_output_frames_function(Isolate* isolate); 625 static ExternalReference compute_output_frames_function(Isolate* isolate);
604 626
605 // Static data in the keyed lookup cache. 627 // Static data in the keyed lookup cache.
606 static ExternalReference keyed_lookup_cache_keys(Isolate* isolate); 628 static ExternalReference keyed_lookup_cache_keys(Isolate* isolate);
607 static ExternalReference keyed_lookup_cache_field_offsets(Isolate* isolate); 629 static ExternalReference keyed_lookup_cache_field_offsets(Isolate* isolate);
608 630
609 // Static variable Heap::roots_array_start() 631 // Static variable Heap::roots_array_start()
610 static ExternalReference roots_array_start(Isolate* isolate); 632 static ExternalReference roots_array_start(Isolate* isolate);
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 public: 912 public:
891 NullCallWrapper() { } 913 NullCallWrapper() { }
892 virtual ~NullCallWrapper() { } 914 virtual ~NullCallWrapper() { }
893 virtual void BeforeCall(int call_size) const { } 915 virtual void BeforeCall(int call_size) const { }
894 virtual void AfterCall() const { } 916 virtual void AfterCall() const { }
895 }; 917 };
896 918
897 } } // namespace v8::internal 919 } } // namespace v8::internal
898 920
899 #endif // V8_ASSEMBLER_H_ 921 #endif // V8_ASSEMBLER_H_
OLDNEW
« no previous file with comments | « no previous file | src/assembler.cc » ('j') | src/compiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698