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

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

Issue 7891042: Add asserts to ensure that we: (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 3 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/arm/codegen-arm.cc ('k') | src/arm/deoptimizer-arm.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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 Assembler::kDebugBreakSlotInstructions); 125 Assembler::kDebugBreakSlotInstructions);
126 } 126 }
127 127
128 128
129 #define __ ACCESS_MASM(masm) 129 #define __ ACCESS_MASM(masm)
130 130
131 131
132 static void Generate_DebugBreakCallHelper(MacroAssembler* masm, 132 static void Generate_DebugBreakCallHelper(MacroAssembler* masm,
133 RegList object_regs, 133 RegList object_regs,
134 RegList non_object_regs) { 134 RegList non_object_regs) {
135 __ EnterInternalFrame(); 135 {
136 FrameScope scope(masm, StackFrame::INTERNAL);
136 137
137 // Store the registers containing live values on the expression stack to 138 // Store the registers containing live values on the expression stack to
138 // make sure that these are correctly updated during GC. Non object values 139 // make sure that these are correctly updated during GC. Non object values
139 // are stored as a smi causing it to be untouched by GC. 140 // are stored as a smi causing it to be untouched by GC.
140 ASSERT((object_regs & ~kJSCallerSaved) == 0); 141 ASSERT((object_regs & ~kJSCallerSaved) == 0);
141 ASSERT((non_object_regs & ~kJSCallerSaved) == 0); 142 ASSERT((non_object_regs & ~kJSCallerSaved) == 0);
142 ASSERT((object_regs & non_object_regs) == 0); 143 ASSERT((object_regs & non_object_regs) == 0);
143 if ((object_regs | non_object_regs) != 0) { 144 if ((object_regs | non_object_regs) != 0) {
144 for (int i = 0; i < kNumJSCallerSaved; i++) { 145 for (int i = 0; i < kNumJSCallerSaved; i++) {
145 int r = JSCallerSavedCode(i); 146 int r = JSCallerSavedCode(i);
146 Register reg = { r }; 147 Register reg = { r };
147 if ((non_object_regs & (1 << r)) != 0) { 148 if ((non_object_regs & (1 << r)) != 0) {
148 if (FLAG_debug_code) { 149 if (FLAG_debug_code) {
149 __ tst(reg, Operand(0xc0000000)); 150 __ tst(reg, Operand(0xc0000000));
150 __ Assert(eq, "Unable to encode value as smi"); 151 __ Assert(eq, "Unable to encode value as smi");
152 }
153 __ mov(reg, Operand(reg, LSL, kSmiTagSize));
151 } 154 }
152 __ mov(reg, Operand(reg, LSL, kSmiTagSize)); 155 }
156 __ stm(db_w, sp, object_regs | non_object_regs);
157 }
158
159 #ifdef DEBUG
160 __ RecordComment("// Calling from debug break to runtime - come in - over");
161 #endif
162 __ mov(r0, Operand(0, RelocInfo::NONE)); // no arguments
163 __ mov(r1, Operand(ExternalReference::debug_break(masm->isolate())));
164
165 CEntryStub ceb(1);
166 __ CallStub(&ceb);
167
168 // Restore the register values from the expression stack.
169 if ((object_regs | non_object_regs) != 0) {
170 __ ldm(ia_w, sp, object_regs | non_object_regs);
171 for (int i = 0; i < kNumJSCallerSaved; i++) {
172 int r = JSCallerSavedCode(i);
173 Register reg = { r };
174 if ((non_object_regs & (1 << r)) != 0) {
175 __ mov(reg, Operand(reg, LSR, kSmiTagSize));
176 }
177 if (FLAG_debug_code &&
178 (((object_regs |non_object_regs) & (1 << r)) == 0)) {
179 __ mov(reg, Operand(kDebugZapValue));
180 }
153 } 181 }
154 } 182 }
155 __ stm(db_w, sp, object_regs | non_object_regs); 183
184 // Leave the internal frame.
156 } 185 }
157 186
158 #ifdef DEBUG
159 __ RecordComment("// Calling from debug break to runtime - come in - over");
160 #endif
161 __ mov(r0, Operand(0, RelocInfo::NONE)); // no arguments
162 __ mov(r1, Operand(ExternalReference::debug_break(masm->isolate())));
163
164 CEntryStub ceb(1);
165 __ CallStub(&ceb);
166
167 // Restore the register values from the expression stack.
168 if ((object_regs | non_object_regs) != 0) {
169 __ ldm(ia_w, sp, object_regs | non_object_regs);
170 for (int i = 0; i < kNumJSCallerSaved; i++) {
171 int r = JSCallerSavedCode(i);
172 Register reg = { r };
173 if ((non_object_regs & (1 << r)) != 0) {
174 __ mov(reg, Operand(reg, LSR, kSmiTagSize));
175 }
176 if (FLAG_debug_code &&
177 (((object_regs |non_object_regs) & (1 << r)) == 0)) {
178 __ mov(reg, Operand(kDebugZapValue));
179 }
180 }
181 }
182
183 __ LeaveInternalFrame();
184
185 // Now that the break point has been handled, resume normal execution by 187 // Now that the break point has been handled, resume normal execution by
186 // jumping to the target address intended by the caller and that was 188 // jumping to the target address intended by the caller and that was
187 // overwritten by the address of DebugBreakXXX. 189 // overwritten by the address of DebugBreakXXX.
188 ExternalReference after_break_target = 190 ExternalReference after_break_target =
189 ExternalReference(Debug_Address::AfterBreakTarget(), masm->isolate()); 191 ExternalReference(Debug_Address::AfterBreakTarget(), masm->isolate());
190 __ mov(ip, Operand(after_break_target)); 192 __ mov(ip, Operand(after_break_target));
191 __ ldr(ip, MemOperand(ip)); 193 __ ldr(ip, MemOperand(ip));
192 __ Jump(ip); 194 __ Jump(ip);
193 } 195 }
194 196
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 310
309 #undef __ 311 #undef __
310 312
311 313
312 314
313 #endif // ENABLE_DEBUGGER_SUPPORT 315 #endif // ENABLE_DEBUGGER_SUPPORT
314 316
315 } } // namespace v8::internal 317 } } // namespace v8::internal
316 318
317 #endif // V8_TARGET_ARCH_ARM 319 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/arm/deoptimizer-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698