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

Side by Side Diff: src/ia32/debug-ia32.cc

Issue 7084032: Add asserts and state tracking to ensure that we do not call (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | src/ia32/deoptimizer-ia32.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 94
95 #define __ ACCESS_MASM(masm) 95 #define __ ACCESS_MASM(masm)
96 96
97 97
98 static void Generate_DebugBreakCallHelper(MacroAssembler* masm, 98 static void Generate_DebugBreakCallHelper(MacroAssembler* masm,
99 RegList object_regs, 99 RegList object_regs,
100 RegList non_object_regs, 100 RegList non_object_regs,
101 bool convert_call_to_jmp) { 101 bool convert_call_to_jmp) {
102 // Enter an internal frame. 102 // Enter an internal frame.
103 __ EnterInternalFrame(); 103 {
104 FrameScope scope(masm, StackFrame::INTERNAL);
104 105
105 // Store the registers containing live values on the expression stack to 106 // Store the registers containing live values on the expression stack to
106 // make sure that these are correctly updated during GC. Non object values 107 // make sure that these are correctly updated during GC. Non object values
107 // are stored as a smi causing it to be untouched by GC. 108 // are stored as a smi causing it to be untouched by GC.
108 ASSERT((object_regs & ~kJSCallerSaved) == 0); 109 ASSERT((object_regs & ~kJSCallerSaved) == 0);
109 ASSERT((non_object_regs & ~kJSCallerSaved) == 0); 110 ASSERT((non_object_regs & ~kJSCallerSaved) == 0);
110 ASSERT((object_regs & non_object_regs) == 0); 111 ASSERT((object_regs & non_object_regs) == 0);
111 for (int i = 0; i < kNumJSCallerSaved; i++) { 112 for (int i = 0; i < kNumJSCallerSaved; i++) {
112 int r = JSCallerSavedCode(i); 113 int r = JSCallerSavedCode(i);
113 Register reg = { r }; 114 Register reg = { r };
(...skipping 12 matching lines...) Expand all
126 127
127 #ifdef DEBUG 128 #ifdef DEBUG
128 __ RecordComment("// Calling from debug break to runtime - come in - over"); 129 __ RecordComment("// Calling from debug break to runtime - come in - over");
129 #endif 130 #endif
130 __ Set(eax, Immediate(0)); // No arguments. 131 __ Set(eax, Immediate(0)); // No arguments.
131 __ mov(ebx, Immediate(ExternalReference::debug_break(masm->isolate()))); 132 __ mov(ebx, Immediate(ExternalReference::debug_break(masm->isolate())));
132 133
133 CEntryStub ceb(1); 134 CEntryStub ceb(1);
134 __ CallStub(&ceb); 135 __ CallStub(&ceb);
135 136
136 // Restore the register values containing object pointers from the expression 137 // Restore the register values containing object pointers from the
137 // stack. 138 // expression stack.
138 for (int i = kNumJSCallerSaved; --i >= 0;) { 139 for (int i = kNumJSCallerSaved; --i >= 0;) {
139 int r = JSCallerSavedCode(i); 140 int r = JSCallerSavedCode(i);
140 Register reg = { r }; 141 Register reg = { r };
141 if (FLAG_debug_code) { 142 if (FLAG_debug_code) {
142 __ Set(reg, Immediate(kDebugZapValue)); 143 __ Set(reg, Immediate(kDebugZapValue));
143 } 144 }
144 if ((object_regs & (1 << r)) != 0) { 145 if ((object_regs & (1 << r)) != 0) {
145 __ pop(reg); 146 __ pop(reg);
146 } 147 }
147 if ((non_object_regs & (1 << r)) != 0) { 148 if ((non_object_regs & (1 << r)) != 0) {
148 __ pop(reg); 149 __ pop(reg);
149 __ SmiUntag(reg); 150 __ SmiUntag(reg);
150 } 151 }
151 } 152 }
152 153
153 // Get rid of the internal frame. 154 // Get rid of the internal frame.
154 __ LeaveInternalFrame(); 155 }
155 156
156 // If this call did not replace a call but patched other code then there will 157 // If this call did not replace a call but patched other code then there will
157 // be an unwanted return address left on the stack. Here we get rid of that. 158 // be an unwanted return address left on the stack. Here we get rid of that.
158 if (convert_call_to_jmp) { 159 if (convert_call_to_jmp) {
159 __ add(Operand(esp), Immediate(kPointerSize)); 160 __ add(Operand(esp), Immediate(kPointerSize));
160 } 161 }
161 162
162 // Now that the break point has been handled, resume normal execution by 163 // Now that the break point has been handled, resume normal execution by
163 // jumping to the target address intended by the caller and that was 164 // jumping to the target address intended by the caller and that was
164 // overwritten by the address of DebugBreakXXX. 165 // overwritten by the address of DebugBreakXXX.
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 304
304 const bool Debug::kFrameDropperSupported = true; 305 const bool Debug::kFrameDropperSupported = true;
305 306
306 #undef __ 307 #undef __
307 308
308 #endif // ENABLE_DEBUGGER_SUPPORT 309 #endif // ENABLE_DEBUGGER_SUPPORT
309 310
310 } } // namespace v8::internal 311 } } // namespace v8::internal
311 312
312 #endif // V8_TARGET_ARCH_IA32 313 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | src/ia32/deoptimizer-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698