| OLD | NEW |
| 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 1859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1870 | 1870 |
| 1871 // Find the function and patch return address. | 1871 // Find the function and patch return address. |
| 1872 for (JavaScriptFrameIterator it(isolate_); !it.done(); it.Advance()) { | 1872 for (JavaScriptFrameIterator it(isolate_); !it.done(); it.Advance()) { |
| 1873 JavaScriptFrame* frame = it.frame(); | 1873 JavaScriptFrame* frame = it.frame(); |
| 1874 // If the current frame is for this function in its | 1874 // If the current frame is for this function in its |
| 1875 // non-optimized form rewrite the return address to continue | 1875 // non-optimized form rewrite the return address to continue |
| 1876 // in the newly compiled full code with debug break slots. | 1876 // in the newly compiled full code with debug break slots. |
| 1877 if (frame->function()->IsJSFunction() && | 1877 if (frame->function()->IsJSFunction() && |
| 1878 frame->function() == *function && | 1878 frame->function() == *function && |
| 1879 frame->LookupCode()->kind() == Code::FUNCTION) { | 1879 frame->LookupCode()->kind() == Code::FUNCTION) { |
| 1880 int delta = frame->pc() - current_code->instruction_start(); | 1880 intptr_t delta = frame->pc() - current_code->instruction_start(); |
| 1881 int debug_break_slot_count = 0; | 1881 int debug_break_slot_count = 0; |
| 1882 int mask = RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT); | 1882 int mask = RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT); |
| 1883 for (RelocIterator it(*new_code, mask); !it.done(); it.next()) { | 1883 for (RelocIterator it(*new_code, mask); !it.done(); it.next()) { |
| 1884 // Check if the pc in the new code with debug break | 1884 // Check if the pc in the new code with debug break |
| 1885 // slots is before this slot. | 1885 // slots is before this slot. |
| 1886 RelocInfo* info = it.rinfo(); | 1886 RelocInfo* info = it.rinfo(); |
| 1887 int debug_break_slot_bytes = | 1887 int debug_break_slot_bytes = |
| 1888 debug_break_slot_count * Assembler::kDebugBreakSlotLength; | 1888 debug_break_slot_count * Assembler::kDebugBreakSlotLength; |
| 1889 int new_delta = | 1889 intptr_t new_delta = |
| 1890 info->pc() - | 1890 info->pc() - |
| 1891 new_code->instruction_start() - | 1891 new_code->instruction_start() - |
| 1892 debug_break_slot_bytes; | 1892 debug_break_slot_bytes; |
| 1893 if (new_delta > delta) { | 1893 if (new_delta > delta) { |
| 1894 break; | 1894 break; |
| 1895 } | 1895 } |
| 1896 | 1896 |
| 1897 // Passed a debug break slot in the full code with debug | 1897 // Passed a debug break slot in the full code with debug |
| 1898 // break slots. | 1898 // break slots. |
| 1899 debug_break_slot_count++; | 1899 debug_break_slot_count++; |
| (...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3387 { | 3387 { |
| 3388 Locker locker; | 3388 Locker locker; |
| 3389 Isolate::Current()->debugger()->CallMessageDispatchHandler(); | 3389 Isolate::Current()->debugger()->CallMessageDispatchHandler(); |
| 3390 } | 3390 } |
| 3391 } | 3391 } |
| 3392 } | 3392 } |
| 3393 | 3393 |
| 3394 #endif // ENABLE_DEBUGGER_SUPPORT | 3394 #endif // ENABLE_DEBUGGER_SUPPORT |
| 3395 | 3395 |
| 3396 } } // namespace v8::internal | 3396 } } // namespace v8::internal |
| OLD | NEW |