Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 Isolate::Current()->debug()->debug_break_slot()->entry(), | 84 Isolate::Current()->debug()->debug_break_slot()->entry(), |
| 85 Assembler::kDebugBreakSlotLength - Assembler::kCallInstructionLength); | 85 Assembler::kDebugBreakSlotLength - Assembler::kCallInstructionLength); |
| 86 } | 86 } |
| 87 | 87 |
| 88 | 88 |
| 89 void BreakLocationIterator::ClearDebugBreakAtSlot() { | 89 void BreakLocationIterator::ClearDebugBreakAtSlot() { |
| 90 ASSERT(IsDebugBreakSlot()); | 90 ASSERT(IsDebugBreakSlot()); |
| 91 rinfo()->PatchCode(original_rinfo()->pc(), Assembler::kDebugBreakSlotLength); | 91 rinfo()->PatchCode(original_rinfo()->pc(), Assembler::kDebugBreakSlotLength); |
| 92 } | 92 } |
| 93 | 93 |
| 94 const bool Debug::FramePaddingLayout::kIsSupported = false; | 94 const bool Debug::FramePaddingLayout::kIsSupported = true; |
| 95 | 95 |
| 96 | 96 |
| 97 #define __ ACCESS_MASM(masm) | 97 #define __ ACCESS_MASM(masm) |
| 98 | 98 |
| 99 | 99 |
| 100 static void Generate_DebugBreakCallHelper(MacroAssembler* masm, | 100 static void Generate_DebugBreakCallHelper(MacroAssembler* masm, |
| 101 RegList object_regs, | 101 RegList object_regs, |
| 102 RegList non_object_regs, | 102 RegList non_object_regs, |
| 103 bool convert_call_to_jmp) { | 103 bool convert_call_to_jmp) { |
| 104 // Enter an internal frame. | 104 // Enter an internal frame. |
| 105 { | 105 { |
| 106 FrameScope scope(masm, StackFrame::INTERNAL); | 106 FrameScope scope(masm, StackFrame::INTERNAL); |
| 107 | 107 |
| 108 // Load padding words on stack. | |
| 109 __ movq(kScratchRegister, | |
| 110 Immediate(Debug::FramePaddingLayout::kPaddingValue)); | |
| 111 __ Integer32ToSmi(kScratchRegister, kScratchRegister); | |
| 112 for (int i = 0; i < Debug::FramePaddingLayout::kInitialSize; i++) { | |
| 113 __ push(kScratchRegister); | |
| 114 } | |
| 115 __ movq(kScratchRegister, | |
| 116 Immediate(Debug::FramePaddingLayout::kInitialSize)); | |
| 117 __ Integer32ToSmi(kScratchRegister, kScratchRegister); | |
|
Yang
2012/05/16 09:59:01
You can convert those values to smi using
Smi*
Peter Rybin
2012/05/16 21:14:57
And this is 2-6 times shorter in terms of generate
| |
| 118 __ push(kScratchRegister); | |
| 119 | |
| 108 // Store the registers containing live values on the expression stack to | 120 // Store the registers containing live values on the expression stack to |
| 109 // make sure that these are correctly updated during GC. Non object values | 121 // make sure that these are correctly updated during GC. Non object values |
| 110 // are stored as as two smis causing it to be untouched by GC. | 122 // are stored as as two smis causing it to be untouched by GC. |
| 111 ASSERT((object_regs & ~kJSCallerSaved) == 0); | 123 ASSERT((object_regs & ~kJSCallerSaved) == 0); |
| 112 ASSERT((non_object_regs & ~kJSCallerSaved) == 0); | 124 ASSERT((non_object_regs & ~kJSCallerSaved) == 0); |
| 113 ASSERT((object_regs & non_object_regs) == 0); | 125 ASSERT((object_regs & non_object_regs) == 0); |
| 114 for (int i = 0; i < kNumJSCallerSaved; i++) { | 126 for (int i = 0; i < kNumJSCallerSaved; i++) { |
| 115 int r = JSCallerSavedCode(i); | 127 int r = JSCallerSavedCode(i); |
| 116 Register reg = { r }; | 128 Register reg = { r }; |
| 117 ASSERT(!reg.is(kScratchRegister)); | 129 ASSERT(!reg.is(kScratchRegister)); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 if ((non_object_regs & (1 << r)) != 0) { | 164 if ((non_object_regs & (1 << r)) != 0) { |
| 153 __ pop(kScratchRegister); | 165 __ pop(kScratchRegister); |
| 154 __ SmiToInteger32(kScratchRegister, kScratchRegister); | 166 __ SmiToInteger32(kScratchRegister, kScratchRegister); |
| 155 __ shl(kScratchRegister, Immediate(32)); | 167 __ shl(kScratchRegister, Immediate(32)); |
| 156 __ pop(reg); | 168 __ pop(reg); |
| 157 __ SmiToInteger32(reg, reg); | 169 __ SmiToInteger32(reg, reg); |
| 158 __ or_(reg, kScratchRegister); | 170 __ or_(reg, kScratchRegister); |
| 159 } | 171 } |
| 160 } | 172 } |
| 161 | 173 |
| 174 // Read current padding counter and skip corresponding number of words. | |
| 175 __ pop(kScratchRegister); | |
| 176 __ SmiToInteger32(kScratchRegister, kScratchRegister); | |
| 177 __ lea(rsp, Operand(rsp, kScratchRegister, times_pointer_size, 0)); | |
| 178 | |
| 162 // Get rid of the internal frame. | 179 // Get rid of the internal frame. |
| 163 } | 180 } |
| 164 | 181 |
| 165 // If this call did not replace a call but patched other code then there will | 182 // If this call did not replace a call but patched other code then there will |
| 166 // be an unwanted return address left on the stack. Here we get rid of that. | 183 // be an unwanted return address left on the stack. Here we get rid of that. |
| 167 if (convert_call_to_jmp) { | 184 if (convert_call_to_jmp) { |
| 168 __ addq(rsp, Immediate(kPointerSize)); | 185 __ addq(rsp, Immediate(kPointerSize)); |
| 169 } | 186 } |
| 170 | 187 |
| 171 // Now that the break point has been handled, resume normal execution by | 188 // Now that the break point has been handled, resume normal execution by |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 334 | 351 |
| 335 const bool Debug::kFrameDropperSupported = true; | 352 const bool Debug::kFrameDropperSupported = true; |
| 336 | 353 |
| 337 #undef __ | 354 #undef __ |
| 338 | 355 |
| 339 #endif // ENABLE_DEBUGGER_SUPPORT | 356 #endif // ENABLE_DEBUGGER_SUPPORT |
| 340 | 357 |
| 341 } } // namespace v8::internal | 358 } } // namespace v8::internal |
| 342 | 359 |
| 343 #endif // V8_TARGET_ARCH_X64 | 360 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |