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

Side by Side Diff: src/assembler.h

Issue 7834018: Support compaction for code space pages. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: port changes from ia32 to arm & x64 Created 9 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
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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 NONE, // never recorded 213 NONE, // never recorded
214 LAST_CODE_ENUM = DEBUG_BREAK, 214 LAST_CODE_ENUM = DEBUG_BREAK,
215 LAST_GCED_ENUM = GLOBAL_PROPERTY_CELL, 215 LAST_GCED_ENUM = GLOBAL_PROPERTY_CELL,
216 // Modes <= LAST_COMPACT_ENUM are guaranteed to have compact encoding. 216 // Modes <= LAST_COMPACT_ENUM are guaranteed to have compact encoding.
217 LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID 217 LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID
218 }; 218 };
219 219
220 220
221 RelocInfo() {} 221 RelocInfo() {}
222 RelocInfo(byte* pc, Mode rmode, intptr_t data) 222 RelocInfo(byte* pc, Mode rmode, intptr_t data)
223 : pc_(pc), rmode_(rmode), data_(data) { 223 : pc_(pc), rmode_(rmode), data_(data), host_(NULL) {
Erik Corry 2011/09/06 14:10:31 If you omit this function the compiler will help y
Vyacheslav Egorov (Chromium) 2011/09/06 15:01:42 Done.
224 }
225
226 RelocInfo(byte* pc, Mode rmode, intptr_t data, Code* host)
227 : pc_(pc), rmode_(rmode), data_(data), host_(host) {
224 } 228 }
225 229
226 static inline bool IsConstructCall(Mode mode) { 230 static inline bool IsConstructCall(Mode mode) {
227 return mode == CONSTRUCT_CALL; 231 return mode == CONSTRUCT_CALL;
228 } 232 }
229 static inline bool IsCodeTarget(Mode mode) { 233 static inline bool IsCodeTarget(Mode mode) {
230 return mode <= LAST_CODE_ENUM; 234 return mode <= LAST_CODE_ENUM;
231 } 235 }
232 // Is the relocation mode affected by GC? 236 // Is the relocation mode affected by GC?
233 static inline bool IsGCRelocMode(Mode mode) { 237 static inline bool IsGCRelocMode(Mode mode) {
(...skipping 20 matching lines...) Expand all
254 static inline bool IsDebugBreakSlot(Mode mode) { 258 static inline bool IsDebugBreakSlot(Mode mode) {
255 return mode == DEBUG_BREAK_SLOT; 259 return mode == DEBUG_BREAK_SLOT;
256 } 260 }
257 static inline int ModeMask(Mode mode) { return 1 << mode; } 261 static inline int ModeMask(Mode mode) { return 1 << mode; }
258 262
259 // Accessors 263 // Accessors
260 byte* pc() const { return pc_; } 264 byte* pc() const { return pc_; }
261 void set_pc(byte* pc) { pc_ = pc; } 265 void set_pc(byte* pc) { pc_ = pc; }
262 Mode rmode() const { return rmode_; } 266 Mode rmode() const { return rmode_; }
263 intptr_t data() const { return data_; } 267 intptr_t data() const { return data_; }
268 Code* host() const { return host_; }
264 269
265 // Apply a relocation by delta bytes 270 // Apply a relocation by delta bytes
266 INLINE(void apply(intptr_t delta)); 271 INLINE(void apply(intptr_t delta));
267 272
268 // Is the pointer this relocation info refers to coded like a plain pointer 273 // Is the pointer this relocation info refers to coded like a plain pointer
269 // or is it strange in some way (eg relative or patched into a series of 274 // or is it strange in some way (eg relative or patched into a series of
270 // instructions). 275 // instructions).
271 bool IsCodedSpecially(); 276 bool IsCodedSpecially();
272 277
273 // Read/modify the code target in the branch/call instruction 278 // Read/modify the code target in the branch/call instruction
274 // this relocation applies to; 279 // this relocation applies to;
275 // can only be called if IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY 280 // can only be called if IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY
276 INLINE(Address target_address()); 281 INLINE(Address target_address());
277 INLINE(void set_target_address(Address target, Code* host)); 282 INLINE(void set_target_address(Address target));
278 INLINE(Object* target_object()); 283 INLINE(Object* target_object());
279 INLINE(Handle<Object> target_object_handle(Assembler* origin)); 284 INLINE(Handle<Object> target_object_handle(Assembler* origin));
280 INLINE(Object** target_object_address()); 285 INLINE(Object** target_object_address());
281 INLINE(void set_target_object(Object* target, Code* code)); 286 INLINE(void set_target_object(Object* target));
282 INLINE(JSGlobalPropertyCell* target_cell()); 287 INLINE(JSGlobalPropertyCell* target_cell());
283 INLINE(Handle<JSGlobalPropertyCell> target_cell_handle()); 288 INLINE(Handle<JSGlobalPropertyCell> target_cell_handle());
284 INLINE(void set_target_cell(JSGlobalPropertyCell* cell, Code* code)); 289 INLINE(void set_target_cell(JSGlobalPropertyCell* cell));
285 290
286 291
287 // Read the address of the word containing the target_address in an 292 // Read the address of the word containing the target_address in an
288 // instruction stream. What this means exactly is architecture-independent. 293 // instruction stream. What this means exactly is architecture-independent.
289 // The only architecture-independent user of this function is the serializer. 294 // The only architecture-independent user of this function is the serializer.
290 // The serializer uses it to find out how many raw bytes of instruction to 295 // The serializer uses it to find out how many raw bytes of instruction to
291 // output before the next target. Architecture-independent code shouldn't 296 // output before the next target. Architecture-independent code shouldn't
292 // dereference the pointer it gets back from this. 297 // dereference the pointer it gets back from this.
293 INLINE(Address target_address_address()); 298 INLINE(Address target_address_address());
294 // This indicates how much space a target takes up when deserializing a code 299 // This indicates how much space a target takes up when deserializing a code
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 static const int kApplyMask; // Modes affected by apply. Depends on arch. 354 static const int kApplyMask; // Modes affected by apply. Depends on arch.
350 355
351 private: 356 private:
352 // On ARM, note that pc_ is the address of the constant pool entry 357 // On ARM, note that pc_ is the address of the constant pool entry
353 // to be relocated and not the address of the instruction 358 // to be relocated and not the address of the instruction
354 // referencing the constant pool entry (except when rmode_ == 359 // referencing the constant pool entry (except when rmode_ ==
355 // comment). 360 // comment).
356 byte* pc_; 361 byte* pc_;
357 Mode rmode_; 362 Mode rmode_;
358 intptr_t data_; 363 intptr_t data_;
364 Code* host_;
359 #ifdef V8_TARGET_ARCH_MIPS 365 #ifdef V8_TARGET_ARCH_MIPS
360 // Code and Embedded Object pointers in mips are stored split 366 // Code and Embedded Object pointers in mips are stored split
361 // across two consecutive 32-bit instructions. Heap management 367 // across two consecutive 32-bit instructions. Heap management
362 // routines expect to access these pointers indirectly. The following 368 // routines expect to access these pointers indirectly. The following
363 // location provides a place for these pointers to exist natually 369 // location provides a place for these pointers to exist natually
364 // when accessed via the Iterator. 370 // when accessed via the Iterator.
365 Object *reconstructed_obj_ptr_; 371 Object *reconstructed_obj_ptr_;
366 // External-reference pointers are also split across instruction-pairs 372 // External-reference pointers are also split across instruction-pairs
367 // in mips, but are accessed via indirect pointers. This location 373 // in mips, but are accessed via indirect pointers. This location
368 // provides a place for that pointer to exist naturally. Its address 374 // provides a place for that pointer to exist naturally. Its address
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 public: 874 public:
869 NullCallWrapper() { } 875 NullCallWrapper() { }
870 virtual ~NullCallWrapper() { } 876 virtual ~NullCallWrapper() { }
871 virtual void BeforeCall(int call_size) const { } 877 virtual void BeforeCall(int call_size) const { }
872 virtual void AfterCall() const { } 878 virtual void AfterCall() const { }
873 }; 879 };
874 880
875 } } // namespace v8::internal 881 } } // namespace v8::internal
876 882
877 #endif // V8_ASSEMBLER_H_ 883 #endif // V8_ASSEMBLER_H_
OLDNEW
« no previous file with comments | « src/arm/deoptimizer-arm.cc ('k') | src/assembler.cc » ('j') | src/mark-compact.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698