OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1886 reinterpret_cast<intptr_t>(new_code->instruction_start()) + | 1886 reinterpret_cast<intptr_t>(new_code->instruction_start()) + |
1887 new_code->instruction_size(), | 1887 new_code->instruction_size(), |
1888 new_code->instruction_size(), | 1888 new_code->instruction_size(), |
1889 reinterpret_cast<intptr_t>(frame->pc()), | 1889 reinterpret_cast<intptr_t>(frame->pc()), |
1890 reinterpret_cast<intptr_t>(new_pc)); | 1890 reinterpret_cast<intptr_t>(new_pc)); |
1891 } | 1891 } |
1892 | 1892 |
1893 // Patch the return address to return into the code with | 1893 // Patch the return address to return into the code with |
1894 // debug break slots. | 1894 // debug break slots. |
1895 frame->set_pc(new_pc); | 1895 frame->set_pc(new_pc); |
1896 if (FLAG_enable_ool_constant_pool) { | |
danno
2014/07/29 13:24:08
Is this a change that is unrelated to the port (se
andrew_low
2014/07/30 13:27:05
Created https://codereview.chromium.org/430523002
| |
1897 frame->set_constant_pool(new_code->constant_pool()); | |
1898 } | |
1896 } | 1899 } |
1897 } | 1900 } |
1898 | 1901 |
1899 | 1902 |
1900 class ActiveFunctionsCollector : public ThreadVisitor { | 1903 class ActiveFunctionsCollector : public ThreadVisitor { |
1901 public: | 1904 public: |
1902 explicit ActiveFunctionsCollector(List<Handle<JSFunction> >* active_functions, | 1905 explicit ActiveFunctionsCollector(List<Handle<JSFunction> >* active_functions, |
1903 Object* active_code_marker) | 1906 Object* active_code_marker) |
1904 : active_functions_(active_functions), | 1907 : active_functions_(active_functions), |
1905 active_code_marker_(active_code_marker) { } | 1908 active_code_marker_(active_code_marker) { } |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2310 Handle<Code> original_code(debug_info->original_code()); | 2313 Handle<Code> original_code(debug_info->original_code()); |
2311 #ifdef DEBUG | 2314 #ifdef DEBUG |
2312 // Get the code which is actually executing. | 2315 // Get the code which is actually executing. |
2313 Handle<Code> frame_code(frame->LookupCode()); | 2316 Handle<Code> frame_code(frame->LookupCode()); |
2314 ASSERT(frame_code.is_identical_to(code)); | 2317 ASSERT(frame_code.is_identical_to(code)); |
2315 #endif | 2318 #endif |
2316 | 2319 |
2317 // Find the call address in the running code. This address holds the call to | 2320 // Find the call address in the running code. This address holds the call to |
2318 // either a DebugBreakXXX or to the debug break return entry code if the | 2321 // either a DebugBreakXXX or to the debug break return entry code if the |
2319 // break point is still active after processing the break point. | 2322 // break point is still active after processing the break point. |
2323 #if V8_TARGET_ARCH_PPC | |
2324 // PPC has variable length call sequence | |
2325 Address addr = Assembler::target_address_from_return_address(frame->pc()); | |
2326 #else | |
2320 Address addr = frame->pc() - Assembler::kPatchDebugBreakSlotReturnOffset; | 2327 Address addr = frame->pc() - Assembler::kPatchDebugBreakSlotReturnOffset; |
danno
2014/07/29 13:24:08
Could you please abstract this to Assembler? There
andrew_low
2014/07/30 13:27:05
Done.
| |
2328 #endif | |
2321 | 2329 |
2322 // Check if the location is at JS exit or debug break slot. | 2330 // Check if the location is at JS exit or debug break slot. |
2323 bool at_js_return = false; | 2331 bool at_js_return = false; |
2324 bool break_at_js_return_active = false; | 2332 bool break_at_js_return_active = false; |
2325 bool at_debug_break_slot = false; | 2333 bool at_debug_break_slot = false; |
2326 RelocIterator it(debug_info->code()); | 2334 RelocIterator it(debug_info->code()); |
2327 while (!it.done() && !at_js_return && !at_debug_break_slot) { | 2335 while (!it.done() && !at_js_return && !at_debug_break_slot) { |
2328 if (RelocInfo::IsJSReturn(it.rinfo()->rmode())) { | 2336 if (RelocInfo::IsJSReturn(it.rinfo()->rmode())) { |
2329 at_js_return = (it.rinfo()->pc() == | 2337 at_js_return = (it.rinfo()->pc() == |
2330 addr - Assembler::kPatchReturnSequenceAddressOffset); | 2338 addr - Assembler::kPatchReturnSequenceAddressOffset); |
2331 break_at_js_return_active = it.rinfo()->IsPatchedReturnSequence(); | 2339 break_at_js_return_active = it.rinfo()->IsPatchedReturnSequence(); |
2332 } | 2340 } |
2333 if (RelocInfo::IsDebugBreakSlot(it.rinfo()->rmode())) { | 2341 if (RelocInfo::IsDebugBreakSlot(it.rinfo()->rmode())) { |
2334 at_debug_break_slot = (it.rinfo()->pc() == | 2342 at_debug_break_slot = (it.rinfo()->pc() == |
2335 addr - Assembler::kPatchDebugBreakSlotAddressOffset); | 2343 addr - Assembler::kPatchDebugBreakSlotAddressOffset); |
2336 } | 2344 } |
2337 it.next(); | 2345 it.next(); |
2338 } | 2346 } |
2339 | 2347 |
2340 // Handle the jump to continue execution after break point depending on the | 2348 // Handle the jump to continue execution after break point depending on the |
2341 // break location. | 2349 // break location. |
2342 if (at_js_return) { | 2350 if (at_js_return) { |
2343 // If the break point as return is still active jump to the corresponding | 2351 // If the break point at return is still active jump to the corresponding |
2344 // place in the original code. If not the break point was removed during | 2352 // place in the original code. If not the break point was removed during |
2345 // break point processing. | 2353 // break point processing. |
2346 if (break_at_js_return_active) { | 2354 if (break_at_js_return_active) { |
2347 addr += original_code->instruction_start() - code->instruction_start(); | 2355 addr += original_code->instruction_start() - code->instruction_start(); |
2348 } | 2356 } |
2349 | 2357 |
2350 // Move back to where the call instruction sequence started. | 2358 // Move back to where the call instruction sequence started. |
2351 after_break_target_ = addr - Assembler::kPatchReturnSequenceAddressOffset; | 2359 after_break_target_ = addr - Assembler::kPatchReturnSequenceAddressOffset; |
2352 } else if (at_debug_break_slot) { | 2360 } else if (at_debug_break_slot) { |
2353 // Address of where the debug break slot starts. | 2361 // Address of where the debug break slot starts. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2401 } | 2409 } |
2402 Handle<DebugInfo> debug_info = GetDebugInfo(shared); | 2410 Handle<DebugInfo> debug_info = GetDebugInfo(shared); |
2403 Handle<Code> code(debug_info->code()); | 2411 Handle<Code> code(debug_info->code()); |
2404 #ifdef DEBUG | 2412 #ifdef DEBUG |
2405 // Get the code which is actually executing. | 2413 // Get the code which is actually executing. |
2406 Handle<Code> frame_code(frame->LookupCode()); | 2414 Handle<Code> frame_code(frame->LookupCode()); |
2407 ASSERT(frame_code.is_identical_to(code)); | 2415 ASSERT(frame_code.is_identical_to(code)); |
2408 #endif | 2416 #endif |
2409 | 2417 |
2410 // Find the call address in the running code. | 2418 // Find the call address in the running code. |
2419 #if V8_TARGET_ARCH_PPC | |
danno
2014/07/29 13:24:08
See above
andrew_low
2014/07/30 13:27:05
Done.
| |
2420 // PPC has variable length call sequence | |
2421 Address addr = Assembler::target_address_from_return_address(frame->pc()); | |
2422 #else | |
2411 Address addr = frame->pc() - Assembler::kPatchDebugBreakSlotReturnOffset; | 2423 Address addr = frame->pc() - Assembler::kPatchDebugBreakSlotReturnOffset; |
2424 #endif | |
2412 | 2425 |
2413 // Check if the location is at JS return. | 2426 // Check if the location is at JS return. |
2414 RelocIterator it(debug_info->code()); | 2427 RelocIterator it(debug_info->code()); |
2415 while (!it.done()) { | 2428 while (!it.done()) { |
2416 if (RelocInfo::IsJSReturn(it.rinfo()->rmode())) { | 2429 if (RelocInfo::IsJSReturn(it.rinfo()->rmode())) { |
2417 return (it.rinfo()->pc() == | 2430 return (it.rinfo()->pc() == |
2418 addr - Assembler::kPatchReturnSequenceAddressOffset); | 2431 addr - Assembler::kPatchReturnSequenceAddressOffset); |
2419 } | 2432 } |
2420 it.next(); | 2433 it.next(); |
2421 } | 2434 } |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3397 logger_->DebugEvent("Put", message.text()); | 3410 logger_->DebugEvent("Put", message.text()); |
3398 } | 3411 } |
3399 | 3412 |
3400 | 3413 |
3401 void LockingCommandMessageQueue::Clear() { | 3414 void LockingCommandMessageQueue::Clear() { |
3402 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 3415 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
3403 queue_.Clear(); | 3416 queue_.Clear(); |
3404 } | 3417 } |
3405 | 3418 |
3406 } } // namespace v8::internal | 3419 } } // namespace v8::internal |
OLD | NEW |