| 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     for (int i = 0; i < Debug::FramePaddingLayout::kInitialSize; i++) { | 
 |  110       __ Push(Smi::FromInt(Debug::FramePaddingLayout::kPaddingValue)); | 
 |  111     } | 
 |  112     __ Push(Smi::FromInt(Debug::FramePaddingLayout::kInitialSize)); | 
 |  113  | 
|  108     // Store the registers containing live values on the expression stack to |  114     // Store the registers containing live values on the expression stack to | 
|  109     // make sure that these are correctly updated during GC. Non object values |  115     // 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. |  116     // are stored as as two smis causing it to be untouched by GC. | 
|  111     ASSERT((object_regs & ~kJSCallerSaved) == 0); |  117     ASSERT((object_regs & ~kJSCallerSaved) == 0); | 
|  112     ASSERT((non_object_regs & ~kJSCallerSaved) == 0); |  118     ASSERT((non_object_regs & ~kJSCallerSaved) == 0); | 
|  113     ASSERT((object_regs & non_object_regs) == 0); |  119     ASSERT((object_regs & non_object_regs) == 0); | 
|  114     for (int i = 0; i < kNumJSCallerSaved; i++) { |  120     for (int i = 0; i < kNumJSCallerSaved; i++) { | 
|  115       int r = JSCallerSavedCode(i); |  121       int r = JSCallerSavedCode(i); | 
|  116       Register reg = { r }; |  122       Register reg = { r }; | 
|  117       ASSERT(!reg.is(kScratchRegister)); |  123       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) { |  158       if ((non_object_regs & (1 << r)) != 0) { | 
|  153         __ pop(kScratchRegister); |  159         __ pop(kScratchRegister); | 
|  154         __ SmiToInteger32(kScratchRegister, kScratchRegister); |  160         __ SmiToInteger32(kScratchRegister, kScratchRegister); | 
|  155         __ shl(kScratchRegister, Immediate(32)); |  161         __ shl(kScratchRegister, Immediate(32)); | 
|  156         __ pop(reg); |  162         __ pop(reg); | 
|  157         __ SmiToInteger32(reg, reg); |  163         __ SmiToInteger32(reg, reg); | 
|  158         __ or_(reg, kScratchRegister); |  164         __ or_(reg, kScratchRegister); | 
|  159       } |  165       } | 
|  160     } |  166     } | 
|  161  |  167  | 
 |  168     // Read current padding counter and skip corresponding number of words. | 
 |  169     __ pop(kScratchRegister); | 
 |  170     __ SmiToInteger32(kScratchRegister, kScratchRegister); | 
 |  171     __ lea(rsp, Operand(rsp, kScratchRegister, times_pointer_size, 0)); | 
 |  172  | 
|  162     // Get rid of the internal frame. |  173     // Get rid of the internal frame. | 
|  163   } |  174   } | 
|  164  |  175  | 
|  165   // If this call did not replace a call but patched other code then there will |  176   // 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. |  177   // be an unwanted return address left on the stack. Here we get rid of that. | 
|  167   if (convert_call_to_jmp) { |  178   if (convert_call_to_jmp) { | 
|  168     __ addq(rsp, Immediate(kPointerSize)); |  179     __ addq(rsp, Immediate(kPointerSize)); | 
|  169   } |  180   } | 
|  170  |  181  | 
|  171   // Now that the break point has been handled, resume normal execution by |  182   // 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  |  345  | 
|  335 const bool Debug::kFrameDropperSupported = true; |  346 const bool Debug::kFrameDropperSupported = true; | 
|  336  |  347  | 
|  337 #undef __ |  348 #undef __ | 
|  338  |  349  | 
|  339 #endif  // ENABLE_DEBUGGER_SUPPORT |  350 #endif  // ENABLE_DEBUGGER_SUPPORT | 
|  340  |  351  | 
|  341 } }  // namespace v8::internal |  352 } }  // namespace v8::internal | 
|  342  |  353  | 
|  343 #endif  // V8_TARGET_ARCH_X64 |  354 #endif  // V8_TARGET_ARCH_X64 | 
| OLD | NEW |