OLD | NEW |
---|---|
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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
234 // Everything after runtime_entry (inclusive) is not GC'ed. | 234 // Everything after runtime_entry (inclusive) is not GC'ed. |
235 RUNTIME_ENTRY, | 235 RUNTIME_ENTRY, |
236 JS_RETURN, // Marks start of the ExitJSFrame code. | 236 JS_RETURN, // Marks start of the ExitJSFrame code. |
237 COMMENT, | 237 COMMENT, |
238 POSITION, // See comment for kNoPosition above. | 238 POSITION, // See comment for kNoPosition above. |
239 STATEMENT_POSITION, // See comment for kNoPosition above. | 239 STATEMENT_POSITION, // See comment for kNoPosition above. |
240 DEBUG_BREAK_SLOT, // Additional code inserted for debug break slot. | 240 DEBUG_BREAK_SLOT, // Additional code inserted for debug break slot. |
241 EXTERNAL_REFERENCE, // The address of an external C++ function. | 241 EXTERNAL_REFERENCE, // The address of an external C++ function. |
242 INTERNAL_REFERENCE, // An address inside the same function. | 242 INTERNAL_REFERENCE, // An address inside the same function. |
243 | 243 |
244 #if defined(V8_TARGET_ARCH_X64) | |
Sven Panne
2012/12/14 08:20:11
Similar to the comment in the related CL, I will s
| |
245 // Marks a deopt entry. Only used on X64. | |
246 // It uses a custom noncompact encoding. | |
247 DEOPT_ENTRY, | |
248 #else | |
244 // Marks a constant pool. Only used on ARM. | 249 // Marks a constant pool. Only used on ARM. |
245 // It uses a custom noncompact encoding. | 250 // It uses a custom noncompact encoding. |
246 CONST_POOL, | 251 CONST_POOL, |
252 #endif | |
247 | 253 |
248 // add more as needed | 254 // add more as needed |
249 // Pseudo-types | 255 // Pseudo-types |
250 NUMBER_OF_MODES, // There are at most 15 modes with noncompact encoding. | 256 NUMBER_OF_MODES, // There are at most 15 modes with noncompact encoding. |
251 NONE, // never recorded | 257 NONE, // never recorded |
252 CODE_AGE_SEQUENCE, // Not stored in RelocInfo array, used explictly by | 258 CODE_AGE_SEQUENCE, // Not stored in RelocInfo array, used explictly by |
253 // code aging. | 259 // code aging. |
254 FIRST_REAL_RELOC_MODE = CODE_TARGET, | 260 FIRST_REAL_RELOC_MODE = CODE_TARGET, |
261 #if defined(V8_TARGET_ARCH_X64) | |
Sven Panne
2012/12/14 08:20:11
see above
| |
262 LAST_REAL_RELOC_MODE = DEOPT_ENTRY, | |
263 #else | |
255 LAST_REAL_RELOC_MODE = CONST_POOL, | 264 LAST_REAL_RELOC_MODE = CONST_POOL, |
265 #endif | |
256 FIRST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, | 266 FIRST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, |
257 LAST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, | 267 LAST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, |
258 LAST_CODE_ENUM = DEBUG_BREAK, | 268 LAST_CODE_ENUM = DEBUG_BREAK, |
259 LAST_GCED_ENUM = GLOBAL_PROPERTY_CELL, | 269 LAST_GCED_ENUM = GLOBAL_PROPERTY_CELL, |
260 // Modes <= LAST_COMPACT_ENUM are guaranteed to have compact encoding. | 270 // Modes <= LAST_COMPACT_ENUM are guaranteed to have compact encoding. |
261 LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID, | 271 LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID, |
262 LAST_STANDARD_NONCOMPACT_ENUM = INTERNAL_REFERENCE | 272 LAST_STANDARD_NONCOMPACT_ENUM = INTERNAL_REFERENCE |
263 }; | 273 }; |
264 | 274 |
265 | 275 |
(...skipping 24 matching lines...) Expand all Loading... | |
290 // Is the relocation mode affected by GC? | 300 // Is the relocation mode affected by GC? |
291 static inline bool IsGCRelocMode(Mode mode) { | 301 static inline bool IsGCRelocMode(Mode mode) { |
292 return mode <= LAST_GCED_ENUM; | 302 return mode <= LAST_GCED_ENUM; |
293 } | 303 } |
294 static inline bool IsJSReturn(Mode mode) { | 304 static inline bool IsJSReturn(Mode mode) { |
295 return mode == JS_RETURN; | 305 return mode == JS_RETURN; |
296 } | 306 } |
297 static inline bool IsComment(Mode mode) { | 307 static inline bool IsComment(Mode mode) { |
298 return mode == COMMENT; | 308 return mode == COMMENT; |
299 } | 309 } |
310 #if defined(V8_TARGET_ARCH_X64) | |
Sven Panne
2012/12/14 08:20:11
see above
| |
311 static inline bool IsDeoptEntry(Mode mode) { | |
312 return mode == DEOPT_ENTRY; | |
313 } | |
314 #else | |
300 static inline bool IsConstPool(Mode mode) { | 315 static inline bool IsConstPool(Mode mode) { |
301 return mode == CONST_POOL; | 316 return mode == CONST_POOL; |
302 } | 317 } |
318 #endif | |
303 static inline bool IsPosition(Mode mode) { | 319 static inline bool IsPosition(Mode mode) { |
304 return mode == POSITION || mode == STATEMENT_POSITION; | 320 return mode == POSITION || mode == STATEMENT_POSITION; |
305 } | 321 } |
306 static inline bool IsStatementPosition(Mode mode) { | 322 static inline bool IsStatementPosition(Mode mode) { |
307 return mode == STATEMENT_POSITION; | 323 return mode == STATEMENT_POSITION; |
308 } | 324 } |
309 static inline bool IsExternalReference(Mode mode) { | 325 static inline bool IsExternalReference(Mode mode) { |
310 return mode == EXTERNAL_REFERENCE; | 326 return mode == EXTERNAL_REFERENCE; |
311 } | 327 } |
312 static inline bool IsInternalReference(Mode mode) { | 328 static inline bool IsInternalReference(Mode mode) { |
(...skipping 23 matching lines...) Expand all Loading... | |
336 bool IsCodedSpecially(); | 352 bool IsCodedSpecially(); |
337 | 353 |
338 // Read/modify the code target in the branch/call instruction | 354 // Read/modify the code target in the branch/call instruction |
339 // this relocation applies to; | 355 // this relocation applies to; |
340 // can only be called if IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY | 356 // can only be called if IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY |
341 INLINE(Address target_address()); | 357 INLINE(Address target_address()); |
342 INLINE(void set_target_address(Address target, | 358 INLINE(void set_target_address(Address target, |
343 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); | 359 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); |
344 INLINE(Object* target_object()); | 360 INLINE(Object* target_object()); |
345 INLINE(Handle<Object> target_object_handle(Assembler* origin)); | 361 INLINE(Handle<Object> target_object_handle(Assembler* origin)); |
362 #if defined(V8_TARGET_ARCH_X64) | |
Sven Panne
2012/12/14 08:20:11
see above
| |
363 INLINE(Address target_deopt_entry(Assembler* origin)); | |
364 #endif | |
346 INLINE(Object** target_object_address()); | 365 INLINE(Object** target_object_address()); |
347 INLINE(void set_target_object(Object* target, | 366 INLINE(void set_target_object(Object* target, |
348 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); | 367 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); |
349 INLINE(JSGlobalPropertyCell* target_cell()); | 368 INLINE(JSGlobalPropertyCell* target_cell()); |
350 INLINE(Handle<JSGlobalPropertyCell> target_cell_handle()); | 369 INLINE(Handle<JSGlobalPropertyCell> target_cell_handle()); |
351 INLINE(void set_target_cell(JSGlobalPropertyCell* cell, | 370 INLINE(void set_target_cell(JSGlobalPropertyCell* cell, |
352 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); | 371 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); |
353 INLINE(Code* code_age_stub()); | 372 INLINE(Code* code_age_stub()); |
354 INLINE(void set_code_age_stub(Code* stub)); | 373 INLINE(void set_code_age_stub(Code* stub)); |
355 | 374 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
470 // On ia32 and arm this is 1 + 4 + 1 + 1 + 1 + 4 = 12. | 489 // On ia32 and arm this is 1 + 4 + 1 + 1 + 1 + 4 = 12. |
471 // On x64 this is 1 + 4 + 1 + 1 + 1 + 8 == 16; | 490 // On x64 this is 1 + 4 + 1 + 1 + 1 + 8 == 16; |
472 // Here we use the maximum of the two. | 491 // Here we use the maximum of the two. |
473 static const int kMaxSize = 16; | 492 static const int kMaxSize = 16; |
474 | 493 |
475 private: | 494 private: |
476 inline uint32_t WriteVariableLengthPCJump(uint32_t pc_delta); | 495 inline uint32_t WriteVariableLengthPCJump(uint32_t pc_delta); |
477 inline void WriteTaggedPC(uint32_t pc_delta, int tag); | 496 inline void WriteTaggedPC(uint32_t pc_delta, int tag); |
478 inline void WriteExtraTaggedPC(uint32_t pc_delta, int extra_tag); | 497 inline void WriteExtraTaggedPC(uint32_t pc_delta, int extra_tag); |
479 inline void WriteExtraTaggedIntData(int data_delta, int top_tag); | 498 inline void WriteExtraTaggedIntData(int data_delta, int top_tag); |
499 #if !defined(V8_TARGET_ARCH_X64) | |
Sven Panne
2012/12/14 08:20:11
see above
| |
480 inline void WriteExtraTaggedConstPoolData(int data); | 500 inline void WriteExtraTaggedConstPoolData(int data); |
501 #else | |
502 inline void WriteExtraTaggedDeoptEntryData(int data); | |
503 #endif | |
481 inline void WriteExtraTaggedData(intptr_t data_delta, int top_tag); | 504 inline void WriteExtraTaggedData(intptr_t data_delta, int top_tag); |
482 inline void WriteTaggedData(intptr_t data_delta, int tag); | 505 inline void WriteTaggedData(intptr_t data_delta, int tag); |
483 inline void WriteExtraTag(int extra_tag, int top_tag); | 506 inline void WriteExtraTag(int extra_tag, int top_tag); |
484 | 507 |
485 byte* pos_; | 508 byte* pos_; |
486 byte* last_pc_; | 509 byte* last_pc_; |
487 int last_id_; | 510 int last_id_; |
488 int last_position_; | 511 int last_position_; |
489 DISALLOW_COPY_AND_ASSIGN(RelocInfoWriter); | 512 DISALLOW_COPY_AND_ASSIGN(RelocInfoWriter); |
490 }; | 513 }; |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
956 public: | 979 public: |
957 NullCallWrapper() { } | 980 NullCallWrapper() { } |
958 virtual ~NullCallWrapper() { } | 981 virtual ~NullCallWrapper() { } |
959 virtual void BeforeCall(int call_size) const { } | 982 virtual void BeforeCall(int call_size) const { } |
960 virtual void AfterCall() const { } | 983 virtual void AfterCall() const { } |
961 }; | 984 }; |
962 | 985 |
963 } } // namespace v8::internal | 986 } } // namespace v8::internal |
964 | 987 |
965 #endif // V8_ASSEMBLER_H_ | 988 #endif // V8_ASSEMBLER_H_ |
OLD | NEW |