OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 bool BreakLocationIterator::IsDebugBreakAtReturn() { | 39 bool BreakLocationIterator::IsDebugBreakAtReturn() { |
40 return Debug::IsDebugBreakAtReturn(rinfo()); | 40 return Debug::IsDebugBreakAtReturn(rinfo()); |
41 } | 41 } |
42 | 42 |
43 | 43 |
44 // Patch the JS frame exit code with a debug break call. See | 44 // Patch the JS frame exit code with a debug break call. See |
45 // CodeGenerator::VisitReturnStatement and VirtualFrame::Exit in codegen-ia32.cc | 45 // CodeGenerator::VisitReturnStatement and VirtualFrame::Exit in codegen-ia32.cc |
46 // for the precise return instructions sequence. | 46 // for the precise return instructions sequence. |
47 void BreakLocationIterator::SetDebugBreakAtReturn() { | 47 void BreakLocationIterator::SetDebugBreakAtReturn() { |
48 ASSERT(Debug::kIa32JSReturnSequenceLength >= | 48 ASSERT(Assembler::kJSReturnSequenceLength >= |
49 Debug::kIa32CallInstructionLength); | 49 Assembler::kCallInstructionLength); |
50 rinfo()->PatchCodeWithCall(Debug::debug_break_return()->entry(), | 50 rinfo()->PatchCodeWithCall(Debug::debug_break_return()->entry(), |
51 Debug::kIa32JSReturnSequenceLength - Debug::kIa32CallInstructionLength); | 51 Assembler::kJSReturnSequenceLength - Assembler::kCallInstructionLength); |
52 } | 52 } |
53 | 53 |
54 | 54 |
55 // Restore the JS frame exit code. | 55 // Restore the JS frame exit code. |
56 void BreakLocationIterator::ClearDebugBreakAtReturn() { | 56 void BreakLocationIterator::ClearDebugBreakAtReturn() { |
57 rinfo()->PatchCode(original_rinfo()->pc(), | 57 rinfo()->PatchCode(original_rinfo()->pc(), |
58 Debug::kIa32JSReturnSequenceLength); | 58 Assembler::kJSReturnSequenceLength); |
59 } | 59 } |
60 | 60 |
61 | 61 |
62 // A debug break in the frame exit code is identified by the JS frame exit code | 62 // A debug break in the frame exit code is identified by the JS frame exit code |
63 // having been patched with a call instruction. | 63 // having been patched with a call instruction. |
64 bool Debug::IsDebugBreakAtReturn(RelocInfo* rinfo) { | 64 bool Debug::IsDebugBreakAtReturn(RelocInfo* rinfo) { |
65 ASSERT(RelocInfo::IsJSReturn(rinfo->rmode())); | 65 ASSERT(RelocInfo::IsJSReturn(rinfo->rmode())); |
66 return rinfo->IsPatchedReturnSequence(); | 66 return rinfo->IsPatchedReturnSequence(); |
67 } | 67 } |
68 | 68 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // ----------------------------------- | 199 // ----------------------------------- |
200 Generate_DebugBreakCallHelper(masm, 0, false); | 200 Generate_DebugBreakCallHelper(masm, 0, false); |
201 } | 201 } |
202 | 202 |
203 | 203 |
204 #undef __ | 204 #undef __ |
205 | 205 |
206 #endif // ENABLE_DEBUGGER_SUPPORT | 206 #endif // ENABLE_DEBUGGER_SUPPORT |
207 | 207 |
208 } } // namespace v8::internal | 208 } } // namespace v8::internal |
OLD | NEW |