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

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: Review feedback Created 8 years, 1 month 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 | « src/arm/lithium-codegen-arm.cc ('k') | src/assembler.cc » ('j') | no next file with comments »
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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 void ReadTaggedPosition(); 499 void ReadTaggedPosition();
481 500
482 // If the given mode is wanted, set it in rinfo_ and return true. 501 // If the given mode is wanted, set it in rinfo_ and return true.
483 // Else return false. Used for efficiently skipping unwanted modes. 502 // Else return false. Used for efficiently skipping unwanted modes.
484 bool SetMode(RelocInfo::Mode mode) { 503 bool SetMode(RelocInfo::Mode mode) {
485 return (mode_mask_ & (1 << mode)) ? (rinfo_.rmode_ = mode, true) : false; 504 return (mode_mask_ & (1 << mode)) ? (rinfo_.rmode_ = mode, true) : false;
486 } 505 }
487 506
488 byte* pos_; 507 byte* pos_;
489 byte* end_; 508 byte* end_;
509 byte* code_age_sequence_;
490 RelocInfo rinfo_; 510 RelocInfo rinfo_;
491 bool done_; 511 bool done_;
492 int mode_mask_; 512 int mode_mask_;
493 int last_id_; 513 int last_id_;
494 int last_position_; 514 int last_position_;
495 DISALLOW_COPY_AND_ASSIGN(RelocIterator); 515 DISALLOW_COPY_AND_ASSIGN(RelocIterator);
496 }; 516 };
497 517
498 518
499 //------------------------------------------------------------------------------ 519 //------------------------------------------------------------------------------
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 static ExternalReference perform_gc_function(Isolate* isolate); 608 static ExternalReference perform_gc_function(Isolate* isolate);
589 static ExternalReference fill_heap_number_with_random_function( 609 static ExternalReference fill_heap_number_with_random_function(
590 Isolate* isolate); 610 Isolate* isolate);
591 static ExternalReference random_uint32_function(Isolate* isolate); 611 static ExternalReference random_uint32_function(Isolate* isolate);
592 static ExternalReference transcendental_cache_array_address(Isolate* isolate); 612 static ExternalReference transcendental_cache_array_address(Isolate* isolate);
593 static ExternalReference delete_handle_scope_extensions(Isolate* isolate); 613 static ExternalReference delete_handle_scope_extensions(Isolate* isolate);
594 614
595 static ExternalReference get_date_field_function(Isolate* isolate); 615 static ExternalReference get_date_field_function(Isolate* isolate);
596 static ExternalReference date_cache_stamp(Isolate* isolate); 616 static ExternalReference date_cache_stamp(Isolate* isolate);
597 617
618 static ExternalReference get_make_code_young_function(Isolate* isolate);
619
598 // Deoptimization support. 620 // Deoptimization support.
599 static ExternalReference new_deoptimizer_function(Isolate* isolate); 621 static ExternalReference new_deoptimizer_function(Isolate* isolate);
600 static ExternalReference compute_output_frames_function(Isolate* isolate); 622 static ExternalReference compute_output_frames_function(Isolate* isolate);
601 623
602 // Static data in the keyed lookup cache. 624 // Static data in the keyed lookup cache.
603 static ExternalReference keyed_lookup_cache_keys(Isolate* isolate); 625 static ExternalReference keyed_lookup_cache_keys(Isolate* isolate);
604 static ExternalReference keyed_lookup_cache_field_offsets(Isolate* isolate); 626 static ExternalReference keyed_lookup_cache_field_offsets(Isolate* isolate);
605 627
606 // Static variable Heap::roots_array_start() 628 // Static variable Heap::roots_array_start()
607 static ExternalReference roots_array_start(Isolate* isolate); 629 static ExternalReference roots_array_start(Isolate* isolate);
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 public: 909 public:
888 NullCallWrapper() { } 910 NullCallWrapper() { }
889 virtual ~NullCallWrapper() { } 911 virtual ~NullCallWrapper() { }
890 virtual void BeforeCall(int call_size) const { } 912 virtual void BeforeCall(int call_size) const { }
891 virtual void AfterCall() const { } 913 virtual void AfterCall() const { }
892 }; 914 };
893 915
894 } } // namespace v8::internal 916 } } // namespace v8::internal
895 917
896 #endif // V8_ASSEMBLER_H_ 918 #endif // V8_ASSEMBLER_H_
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698