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 1222093007: Debugger: use debug break slot to break on call. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased and addressed comments Created 5 years, 5 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
« no previous file with comments | « src/arm64/full-codegen-arm64.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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 499
500 // Is the pointer this relocation info refers to coded like a plain pointer 500 // Is the pointer this relocation info refers to coded like a plain pointer
501 // or is it strange in some way (e.g. relative or patched into a series of 501 // or is it strange in some way (e.g. relative or patched into a series of
502 // instructions). 502 // instructions).
503 bool IsCodedSpecially(); 503 bool IsCodedSpecially();
504 504
505 // If true, the pointer this relocation info refers to is an entry in the 505 // If true, the pointer this relocation info refers to is an entry in the
506 // constant pool, otherwise the pointer is embedded in the instruction stream. 506 // constant pool, otherwise the pointer is embedded in the instruction stream.
507 bool IsInConstantPool(); 507 bool IsInConstantPool();
508 508
509 static bool DebugBreakIsConstructCall(intptr_t data);
510 static bool DebugBreakIsCall(intptr_t data);
511 static int DebugBreakCallArgumentsCount(intptr_t data);
512
509 // Read/modify the code target in the branch/call instruction 513 // Read/modify the code target in the branch/call instruction
510 // this relocation applies to; 514 // this relocation applies to;
511 // can only be called if IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) 515 // can only be called if IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)
512 INLINE(Address target_address()); 516 INLINE(Address target_address());
513 INLINE(void set_target_address(Address target, 517 INLINE(void set_target_address(Address target,
514 WriteBarrierMode write_barrier_mode = 518 WriteBarrierMode write_barrier_mode =
515 UPDATE_WRITE_BARRIER, 519 UPDATE_WRITE_BARRIER,
516 ICacheFlushMode icache_flush_mode = 520 ICacheFlushMode icache_flush_mode =
517 FLUSH_ICACHE_IF_NEEDED)); 521 FLUSH_ICACHE_IF_NEEDED));
518 INLINE(Object* target_object()); 522 INLINE(Object* target_object());
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 #endif // ENABLE_DISASSEMBLER 620 #endif // ENABLE_DISASSEMBLER
617 #ifdef VERIFY_HEAP 621 #ifdef VERIFY_HEAP
618 void Verify(Isolate* isolate); 622 void Verify(Isolate* isolate);
619 #endif 623 #endif
620 624
621 static const int kCodeTargetMask = (1 << (LAST_CODE_ENUM + 1)) - 1; 625 static const int kCodeTargetMask = (1 << (LAST_CODE_ENUM + 1)) - 1;
622 static const int kPositionMask = 1 << POSITION | 1 << STATEMENT_POSITION; 626 static const int kPositionMask = 1 << POSITION | 1 << STATEMENT_POSITION;
623 static const int kDataMask = 627 static const int kDataMask =
624 (1 << CODE_TARGET_WITH_ID) | kPositionMask | (1 << COMMENT); 628 (1 << CODE_TARGET_WITH_ID) | kPositionMask | (1 << COMMENT);
625 static const int kApplyMask; // Modes affected by apply. Depends on arch. 629 static const int kApplyMask; // Modes affected by apply. Depends on arch.
630 static const int kDebugBreakNonCallSentinel = -2;
631 static const int kDebugBreakConstructCallSentinel = -1;
626 632
627 private: 633 private:
628 // On ARM, note that pc_ is the address of the constant pool entry 634 // On ARM, note that pc_ is the address of the constant pool entry
629 // to be relocated and not the address of the instruction 635 // to be relocated and not the address of the instruction
630 // referencing the constant pool entry (except when rmode_ == 636 // referencing the constant pool entry (except when rmode_ ==
631 // comment). 637 // comment).
632 byte* pc_; 638 byte* pc_;
633 Mode rmode_; 639 Mode rmode_;
634 intptr_t data_; 640 intptr_t data_;
635 Code* host_; 641 Code* host_;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 // ExtraTag, VariableLengthPCJump, ExtraTag, pc_delta, ExtraTag, data_delta. 689 // ExtraTag, VariableLengthPCJump, ExtraTag, pc_delta, ExtraTag, data_delta.
684 // On ia32 and arm this is 1 + 4 + 1 + 1 + 1 + 4 = 12. 690 // On ia32 and arm this is 1 + 4 + 1 + 1 + 1 + 4 = 12.
685 // On x64 this is 1 + 4 + 1 + 1 + 1 + 8 == 16; 691 // On x64 this is 1 + 4 + 1 + 1 + 1 + 8 == 16;
686 // Here we use the maximum of the two. 692 // Here we use the maximum of the two.
687 static const int kMaxSize = 16; 693 static const int kMaxSize = 16;
688 694
689 private: 695 private:
690 inline uint32_t WriteVariableLengthPCJump(uint32_t pc_delta); 696 inline uint32_t WriteVariableLengthPCJump(uint32_t pc_delta);
691 inline void WriteTaggedPC(uint32_t pc_delta, int tag); 697 inline void WriteTaggedPC(uint32_t pc_delta, int tag);
692 inline void WriteExtraTaggedPC(uint32_t pc_delta, int extra_tag); 698 inline void WriteExtraTaggedPC(uint32_t pc_delta, int extra_tag);
699 inline void WriteInt(int number);
700 inline void WriteDebugBreakSlotData(int data);
693 inline void WriteExtraTaggedIntData(int data_delta, int top_tag); 701 inline void WriteExtraTaggedIntData(int data_delta, int top_tag);
694 inline void WriteExtraTaggedPoolData(int data, int pool_type); 702 inline void WriteExtraTaggedPoolData(int data, int pool_type);
695 inline void WriteExtraTaggedData(intptr_t data_delta, int top_tag); 703 inline void WriteExtraTaggedData(intptr_t data_delta, int top_tag);
696 inline void WriteTaggedData(intptr_t data_delta, int tag); 704 inline void WriteTaggedData(intptr_t data_delta, int tag);
697 inline void WriteExtraTag(int extra_tag, int top_tag); 705 inline void WriteExtraTag(int extra_tag, int top_tag);
698 inline void WritePosition(int pc_delta, int pos_delta, RelocInfo::Mode rmode); 706 inline void WritePosition(int pc_delta, int pos_delta, RelocInfo::Mode rmode);
699 707
700 void FlushPosition(); 708 void FlushPosition();
701 709
702 byte* pos_; 710 byte* pos_;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 // Advance* moves the position before/after reading. 751 // Advance* moves the position before/after reading.
744 // *Read* reads from current byte(s) into rinfo_. 752 // *Read* reads from current byte(s) into rinfo_.
745 // *Get* just reads and returns info on current byte. 753 // *Get* just reads and returns info on current byte.
746 void Advance(int bytes = 1) { pos_ -= bytes; } 754 void Advance(int bytes = 1) { pos_ -= bytes; }
747 int AdvanceGetTag(); 755 int AdvanceGetTag();
748 int GetExtraTag(); 756 int GetExtraTag();
749 int GetTopTag(); 757 int GetTopTag();
750 void ReadTaggedPC(); 758 void ReadTaggedPC();
751 void AdvanceReadPC(); 759 void AdvanceReadPC();
752 void AdvanceReadId(); 760 void AdvanceReadId();
761 void AdvanceReadInt();
753 void AdvanceReadPoolData(); 762 void AdvanceReadPoolData();
763 void AdvanceReadDebugBreakSlotData();
754 void AdvanceReadPosition(); 764 void AdvanceReadPosition();
755 void AdvanceReadData(); 765 void AdvanceReadData();
756 void AdvanceReadVariableLengthPCJump(); 766 void AdvanceReadVariableLengthPCJump();
757 int GetLocatableTypeTag(); 767 int GetLocatableTypeTag();
758 void ReadTaggedId(); 768 void ReadTaggedId();
759 void ReadTaggedPosition(); 769 void ReadTaggedPosition();
760 void ReadTaggedData(); 770 void ReadTaggedData();
761 771
762 // If the given mode is wanted, set it in rinfo_ and return true. 772 // If the given mode is wanted, set it in rinfo_ and return true.
763 // Else return false. Used for efficiently skipping unwanted modes. 773 // Else return false. Used for efficiently skipping unwanted modes.
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 }; 1257 };
1248 1258
1249 Label emitted_label_; // Records pc_offset of emitted pool 1259 Label emitted_label_; // Records pc_offset of emitted pool
1250 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES]; 1260 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES];
1251 }; 1261 };
1252 1262
1253 1263
1254 } } // namespace v8::internal 1264 } } // namespace v8::internal
1255 1265
1256 #endif // V8_ASSEMBLER_H_ 1266 #endif // V8_ASSEMBLER_H_
OLDNEW
« no previous file with comments | « src/arm64/full-codegen-arm64.cc ('k') | src/assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698