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

Side by Side Diff: src/arm64/assembler-arm64.h

Issue 1234833003: Debugger: use debug break slots to break at function exit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix for arm 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/arm/macro-assembler-arm.h ('k') | src/arm64/assembler-arm64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_ARM64_ASSEMBLER_ARM64_H_ 5 #ifndef V8_ARM64_ASSEMBLER_ARM64_H_
6 #define V8_ARM64_ASSEMBLER_ARM64_H_ 6 #define V8_ARM64_ASSEMBLER_ARM64_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 FLUSH_ICACHE_IF_NEEDED); 886 FLUSH_ICACHE_IF_NEEDED);
887 887
888 // Return the code target address at a call site from the return address of 888 // Return the code target address at a call site from the return address of
889 // that call in the instruction stream. 889 // that call in the instruction stream.
890 inline static Address target_address_from_return_address(Address pc); 890 inline static Address target_address_from_return_address(Address pc);
891 891
892 // Given the address of the beginning of a call, return the address in the 892 // Given the address of the beginning of a call, return the address in the
893 // instruction stream that call will return from. 893 // instruction stream that call will return from.
894 inline static Address return_address_from_call_start(Address pc); 894 inline static Address return_address_from_call_start(Address pc);
895 895
896 // Return the code target address of the patch debug break slot
897 inline static Address break_address_from_return_address(Address pc);
898
899 // This sets the branch destination (which is in the constant pool on ARM). 896 // This sets the branch destination (which is in the constant pool on ARM).
900 // This is for calls and branches within generated code. 897 // This is for calls and branches within generated code.
901 inline static void deserialization_set_special_target_at( 898 inline static void deserialization_set_special_target_at(
902 Address constant_pool_entry, Code* code, Address target); 899 Address constant_pool_entry, Code* code, Address target);
903 900
904 // This sets the internal reference at the pc. 901 // This sets the internal reference at the pc.
905 inline static void deserialization_set_target_internal_reference_at( 902 inline static void deserialization_set_target_internal_reference_at(
906 Address pc, Address target, 903 Address pc, Address target,
907 RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE); 904 RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE);
908 905
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 DCHECK(size >= 0); 945 DCHECK(size >= 0);
949 DCHECK(static_cast<uint64_t>(size) == SizeOfCodeGeneratedSince(label)); 946 DCHECK(static_cast<uint64_t>(size) == SizeOfCodeGeneratedSince(label));
950 } 947 }
951 948
952 // Return the number of instructions generated from label to the 949 // Return the number of instructions generated from label to the
953 // current position. 950 // current position.
954 uint64_t InstructionsGeneratedSince(const Label* label) { 951 uint64_t InstructionsGeneratedSince(const Label* label) {
955 return SizeOfCodeGeneratedSince(label) / kInstructionSize; 952 return SizeOfCodeGeneratedSince(label) / kInstructionSize;
956 } 953 }
957 954
958 // Number of instructions generated for the return sequence in
959 // FullCodeGenerator::EmitReturnSequence.
960 static const int kJSReturnSequenceInstructions = 7;
961 static const int kJSReturnSequenceLength =
962 kJSReturnSequenceInstructions * kInstructionSize;
963 // Distance between start of patched return sequence and the emitted address
964 // to jump to.
965 static const int kPatchReturnSequenceAddressOffset = 0;
966 static const int kPatchDebugBreakSlotAddressOffset = 0; 955 static const int kPatchDebugBreakSlotAddressOffset = 0;
967 956
968 // Number of instructions necessary to be able to later patch it to a call. 957 // Number of instructions necessary to be able to later patch it to a call.
969 // See DebugCodegen::GenerateSlot() and 958 static const int kDebugBreakSlotInstructions = 5;
970 // BreakLocation::SetDebugBreakAtSlot().
971 static const int kDebugBreakSlotInstructions = 4;
972 static const int kDebugBreakSlotLength = 959 static const int kDebugBreakSlotLength =
973 kDebugBreakSlotInstructions * kInstructionSize; 960 kDebugBreakSlotInstructions * kInstructionSize;
974 961
975 static const int kPatchDebugBreakSlotReturnOffset = 2 * kInstructionSize;
976
977 // Prevent contant pool emission until EndBlockConstPool is called. 962 // Prevent contant pool emission until EndBlockConstPool is called.
978 // Call to this function can be nested but must be followed by an equal 963 // Call to this function can be nested but must be followed by an equal
979 // number of call to EndBlockConstpool. 964 // number of call to EndBlockConstpool.
980 void StartBlockConstPool(); 965 void StartBlockConstPool();
981 966
982 // Resume constant pool emission. Need to be called as many time as 967 // Resume constant pool emission. Need to be called as many time as
983 // StartBlockConstPool to have an effect. 968 // StartBlockConstPool to have an effect.
984 void EndBlockConstPool(); 969 void EndBlockConstPool();
985 970
986 bool is_const_pool_blocked() const; 971 bool is_const_pool_blocked() const;
(...skipping 28 matching lines...) Expand all
1015 // Debugging ---------------------------------------------------------------- 1000 // Debugging ----------------------------------------------------------------
1016 PositionsRecorder* positions_recorder() { return &positions_recorder_; } 1001 PositionsRecorder* positions_recorder() { return &positions_recorder_; }
1017 void RecordComment(const char* msg); 1002 void RecordComment(const char* msg);
1018 1003
1019 // Record a deoptimization reason that can be used by a log or cpu profiler. 1004 // Record a deoptimization reason that can be used by a log or cpu profiler.
1020 // Use --trace-deopt to enable. 1005 // Use --trace-deopt to enable.
1021 void RecordDeoptReason(const int reason, const SourcePosition position); 1006 void RecordDeoptReason(const int reason, const SourcePosition position);
1022 1007
1023 int buffer_space() const; 1008 int buffer_space() const;
1024 1009
1025 // Mark address of the ExitJSFrame code.
1026 void RecordJSReturn();
1027
1028 // Mark generator continuation. 1010 // Mark generator continuation.
1029 void RecordGeneratorContinuation(); 1011 void RecordGeneratorContinuation();
1030 1012
1031 // Mark address of a debug break slot. 1013 // Mark address of a debug break slot.
1032 void RecordDebugBreakSlot(); 1014 void RecordDebugBreakSlot(RelocInfo::Mode mode, int argc = 0);
1033 void RecordDebugBreakSlotForCall(int argc);
1034 void RecordDebugBreakSlotForConstructCall();
1035 1015
1036 // Record the emission of a constant pool. 1016 // Record the emission of a constant pool.
1037 // 1017 //
1038 // The emission of constant and veneer pools depends on the size of the code 1018 // The emission of constant and veneer pools depends on the size of the code
1039 // generated and the number of RelocInfo recorded. 1019 // generated and the number of RelocInfo recorded.
1040 // The Debug mechanism needs to map code offsets between two versions of a 1020 // The Debug mechanism needs to map code offsets between two versions of a
1041 // function, compiled with and without debugger support (see for example 1021 // function, compiled with and without debugger support (see for example
1042 // Debug::PrepareForBreakPoints()). 1022 // Debug::PrepareForBreakPoints()).
1043 // Compiling functions with debugger support generates additional code 1023 // Compiling functions with debugger support generates additional code
1044 // (DebugCodegen::GenerateSlot()). This may affect the emission of the pools 1024 // (DebugCodegen::GenerateSlot()). This may affect the emission of the pools
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
2328 class EnsureSpace BASE_EMBEDDED { 2308 class EnsureSpace BASE_EMBEDDED {
2329 public: 2309 public:
2330 explicit EnsureSpace(Assembler* assembler) { 2310 explicit EnsureSpace(Assembler* assembler) {
2331 assembler->CheckBufferSpace(); 2311 assembler->CheckBufferSpace();
2332 } 2312 }
2333 }; 2313 };
2334 2314
2335 } } // namespace v8::internal 2315 } } // namespace v8::internal
2336 2316
2337 #endif // V8_ARM64_ASSEMBLER_ARM64_H_ 2317 #endif // V8_ARM64_ASSEMBLER_ARM64_H_
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/arm64/assembler-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698