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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 // Everything after runtime_entry (inclusive) is not GC'ed. | 384 // Everything after runtime_entry (inclusive) is not GC'ed. |
385 RUNTIME_ENTRY, | 385 RUNTIME_ENTRY, |
386 COMMENT, | 386 COMMENT, |
387 POSITION, // See comment for kNoPosition above. | 387 POSITION, // See comment for kNoPosition above. |
388 STATEMENT_POSITION, // See comment for kNoPosition above. | 388 STATEMENT_POSITION, // See comment for kNoPosition above. |
389 | 389 |
390 // Additional code inserted for debug break slot. | 390 // Additional code inserted for debug break slot. |
391 DEBUG_BREAK_SLOT_AT_POSITION, | 391 DEBUG_BREAK_SLOT_AT_POSITION, |
392 DEBUG_BREAK_SLOT_AT_RETURN, | 392 DEBUG_BREAK_SLOT_AT_RETURN, |
393 DEBUG_BREAK_SLOT_AT_CALL, | 393 DEBUG_BREAK_SLOT_AT_CALL, |
394 DEBUG_BREAK_SLOT_AT_CONSTRUCT_CALL, | |
395 | 394 |
396 EXTERNAL_REFERENCE, // The address of an external C++ function. | 395 EXTERNAL_REFERENCE, // The address of an external C++ function. |
397 INTERNAL_REFERENCE, // An address inside the same function. | 396 INTERNAL_REFERENCE, // An address inside the same function. |
398 | 397 |
399 // Encoded internal reference, used only on MIPS, MIPS64 and PPC. | 398 // Encoded internal reference, used only on MIPS, MIPS64 and PPC. |
400 INTERNAL_REFERENCE_ENCODED, | 399 INTERNAL_REFERENCE_ENCODED, |
401 | 400 |
402 // Continuation points for a generator yield. | 401 // Continuation points for a generator yield. |
403 GENERATOR_CONTINUATION, | 402 GENERATOR_CONTINUATION, |
404 | 403 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 return mode == EXTERNAL_REFERENCE; | 476 return mode == EXTERNAL_REFERENCE; |
478 } | 477 } |
479 static inline bool IsInternalReference(Mode mode) { | 478 static inline bool IsInternalReference(Mode mode) { |
480 return mode == INTERNAL_REFERENCE; | 479 return mode == INTERNAL_REFERENCE; |
481 } | 480 } |
482 static inline bool IsInternalReferenceEncoded(Mode mode) { | 481 static inline bool IsInternalReferenceEncoded(Mode mode) { |
483 return mode == INTERNAL_REFERENCE_ENCODED; | 482 return mode == INTERNAL_REFERENCE_ENCODED; |
484 } | 483 } |
485 static inline bool IsDebugBreakSlot(Mode mode) { | 484 static inline bool IsDebugBreakSlot(Mode mode) { |
486 return IsDebugBreakSlotAtPosition(mode) || IsDebugBreakSlotAtReturn(mode) || | 485 return IsDebugBreakSlotAtPosition(mode) || IsDebugBreakSlotAtReturn(mode) || |
487 IsDebugBreakSlotAtCall(mode) || | 486 IsDebugBreakSlotAtCall(mode); |
488 IsDebugBreakSlotAtConstructCall(mode); | |
489 } | 487 } |
490 static inline bool IsDebugBreakSlotAtPosition(Mode mode) { | 488 static inline bool IsDebugBreakSlotAtPosition(Mode mode) { |
491 return mode == DEBUG_BREAK_SLOT_AT_POSITION; | 489 return mode == DEBUG_BREAK_SLOT_AT_POSITION; |
492 } | 490 } |
493 static inline bool IsDebugBreakSlotAtReturn(Mode mode) { | 491 static inline bool IsDebugBreakSlotAtReturn(Mode mode) { |
494 return mode == DEBUG_BREAK_SLOT_AT_RETURN; | 492 return mode == DEBUG_BREAK_SLOT_AT_RETURN; |
495 } | 493 } |
496 static inline bool IsDebugBreakSlotAtCall(Mode mode) { | 494 static inline bool IsDebugBreakSlotAtCall(Mode mode) { |
497 return mode == DEBUG_BREAK_SLOT_AT_CALL; | 495 return mode == DEBUG_BREAK_SLOT_AT_CALL; |
498 } | 496 } |
499 static inline bool IsDebugBreakSlotAtConstructCall(Mode mode) { | |
500 return mode == DEBUG_BREAK_SLOT_AT_CONSTRUCT_CALL; | |
501 } | |
502 static inline bool IsDebuggerStatement(Mode mode) { | 497 static inline bool IsDebuggerStatement(Mode mode) { |
503 return mode == DEBUGGER_STATEMENT; | 498 return mode == DEBUGGER_STATEMENT; |
504 } | 499 } |
505 static inline bool IsNone(Mode mode) { | 500 static inline bool IsNone(Mode mode) { |
506 return mode == NONE32 || mode == NONE64; | 501 return mode == NONE32 || mode == NONE64; |
507 } | 502 } |
508 static inline bool IsCodeAgeSequence(Mode mode) { | 503 static inline bool IsCodeAgeSequence(Mode mode) { |
509 return mode == CODE_AGE_SEQUENCE; | 504 return mode == CODE_AGE_SEQUENCE; |
510 } | 505 } |
511 static inline bool IsGeneratorContinuation(Mode mode) { | 506 static inline bool IsGeneratorContinuation(Mode mode) { |
(...skipping 18 matching lines...) Expand all Loading... |
530 | 525 |
531 // Is the pointer this relocation info refers to coded like a plain pointer | 526 // Is the pointer this relocation info refers to coded like a plain pointer |
532 // or is it strange in some way (e.g. relative or patched into a series of | 527 // or is it strange in some way (e.g. relative or patched into a series of |
533 // instructions). | 528 // instructions). |
534 bool IsCodedSpecially(); | 529 bool IsCodedSpecially(); |
535 | 530 |
536 // If true, the pointer this relocation info refers to is an entry in the | 531 // If true, the pointer this relocation info refers to is an entry in the |
537 // constant pool, otherwise the pointer is embedded in the instruction stream. | 532 // constant pool, otherwise the pointer is embedded in the instruction stream. |
538 bool IsInConstantPool(); | 533 bool IsInConstantPool(); |
539 | 534 |
540 static int DebugBreakCallArgumentsCount(intptr_t data); | |
541 | |
542 // Read/modify the code target in the branch/call instruction | |
543 // this relocation applies to; | 535 // this relocation applies to; |
544 // can only be called if IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) | 536 // can only be called if IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) |
545 INLINE(Address target_address()); | 537 INLINE(Address target_address()); |
546 INLINE(void set_target_address(Address target, | 538 INLINE(void set_target_address(Address target, |
547 WriteBarrierMode write_barrier_mode = | 539 WriteBarrierMode write_barrier_mode = |
548 UPDATE_WRITE_BARRIER, | 540 UPDATE_WRITE_BARRIER, |
549 ICacheFlushMode icache_flush_mode = | 541 ICacheFlushMode icache_flush_mode = |
550 FLUSH_ICACHE_IF_NEEDED)); | 542 FLUSH_ICACHE_IF_NEEDED)); |
551 INLINE(Object* target_object()); | 543 INLINE(Object* target_object()); |
552 INLINE(Handle<Object> target_object_handle(Assembler* origin)); | 544 INLINE(Handle<Object> target_object_handle(Assembler* origin)); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 void Print(Isolate* isolate, std::ostream& os); // NOLINT | 634 void Print(Isolate* isolate, std::ostream& os); // NOLINT |
643 #endif // ENABLE_DISASSEMBLER | 635 #endif // ENABLE_DISASSEMBLER |
644 #ifdef VERIFY_HEAP | 636 #ifdef VERIFY_HEAP |
645 void Verify(Isolate* isolate); | 637 void Verify(Isolate* isolate); |
646 #endif | 638 #endif |
647 | 639 |
648 static const int kCodeTargetMask = (1 << (LAST_CODE_ENUM + 1)) - 1; | 640 static const int kCodeTargetMask = (1 << (LAST_CODE_ENUM + 1)) - 1; |
649 static const int kPositionMask = 1 << POSITION | 1 << STATEMENT_POSITION; | 641 static const int kPositionMask = 1 << POSITION | 1 << STATEMENT_POSITION; |
650 static const int kDataMask = | 642 static const int kDataMask = |
651 (1 << CODE_TARGET_WITH_ID) | kPositionMask | (1 << COMMENT); | 643 (1 << CODE_TARGET_WITH_ID) | kPositionMask | (1 << COMMENT); |
652 static const int kDebugBreakSlotMask = | 644 static const int kDebugBreakSlotMask = 1 << DEBUG_BREAK_SLOT_AT_POSITION | |
653 1 << DEBUG_BREAK_SLOT_AT_POSITION | 1 << DEBUG_BREAK_SLOT_AT_RETURN | | 645 1 << DEBUG_BREAK_SLOT_AT_RETURN | |
654 1 << DEBUG_BREAK_SLOT_AT_CALL | 1 << DEBUG_BREAK_SLOT_AT_CONSTRUCT_CALL; | 646 1 << DEBUG_BREAK_SLOT_AT_CALL; |
655 static const int kApplyMask; // Modes affected by apply. Depends on arch. | 647 static const int kApplyMask; // Modes affected by apply. Depends on arch. |
656 | 648 |
657 private: | 649 private: |
658 Isolate* isolate_; | 650 Isolate* isolate_; |
659 // On ARM, note that pc_ is the address of the constant pool entry | 651 // On ARM, note that pc_ is the address of the constant pool entry |
660 // to be relocated and not the address of the instruction | 652 // to be relocated and not the address of the instruction |
661 // referencing the constant pool entry (except when rmode_ == | 653 // referencing the constant pool entry (except when rmode_ == |
662 // comment). | 654 // comment). |
663 byte* pc_; | 655 byte* pc_; |
664 Mode rmode_; | 656 Mode rmode_; |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 std::vector<ConstantPoolEntry> shared_entries; | 1280 std::vector<ConstantPoolEntry> shared_entries; |
1289 }; | 1281 }; |
1290 | 1282 |
1291 Label emitted_label_; // Records pc_offset of emitted pool | 1283 Label emitted_label_; // Records pc_offset of emitted pool |
1292 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES]; | 1284 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES]; |
1293 }; | 1285 }; |
1294 | 1286 |
1295 } // namespace internal | 1287 } // namespace internal |
1296 } // namespace v8 | 1288 } // namespace v8 |
1297 #endif // V8_ASSEMBLER_H_ | 1289 #endif // V8_ASSEMBLER_H_ |
OLD | NEW |