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 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1344 i -= 1; | 1344 i -= 1; |
1345 } | 1345 } |
1346 } | 1346 } |
1347 | 1347 |
1348 if (fun->IsJSFunction()) { | 1348 if (fun->IsJSFunction()) { |
1349 Handle<JSFunction> js_function(JSFunction::cast(fun)); | 1349 Handle<JSFunction> js_function(JSFunction::cast(fun)); |
1350 FloodWithOneShotGeneric(js_function); | 1350 FloodWithOneShotGeneric(js_function); |
1351 } | 1351 } |
1352 } | 1352 } |
1353 | 1353 |
1354 ActivateStepIn(function, frame); | 1354 ActivateStepIn(frame); |
1355 } | 1355 } |
1356 | 1356 |
1357 // Fill the current function with one-shot break points even for step in on | 1357 // Fill the current function with one-shot break points even for step in on |
1358 // a call target as the function called might be a native function for | 1358 // a call target as the function called might be a native function for |
1359 // which step in will not stop. It also prepares for stepping in | 1359 // which step in will not stop. It also prepares for stepping in |
1360 // getters/setters. | 1360 // getters/setters. |
1361 // If we are stepping into another frame, only fill calls and returns. | 1361 // If we are stepping into another frame, only fill calls and returns. |
1362 FloodWithOneShot(function, step_action == StepFrame ? CALLS_AND_RETURNS | 1362 FloodWithOneShot(function, step_action == StepFrame ? CALLS_AND_RETURNS |
1363 : ALL_BREAK_LOCATIONS); | 1363 : ALL_BREAK_LOCATIONS); |
1364 | 1364 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1502 for (DebugInfoListNode* node = debug_info_list_; node != NULL; | 1502 for (DebugInfoListNode* node = debug_info_list_; node != NULL; |
1503 node = node->next()) { | 1503 node = node->next()) { |
1504 for (BreakLocation::Iterator it(node->debug_info(), ALL_BREAK_LOCATIONS); | 1504 for (BreakLocation::Iterator it(node->debug_info(), ALL_BREAK_LOCATIONS); |
1505 !it.Done(); it.Next()) { | 1505 !it.Done(); it.Next()) { |
1506 it.GetBreakLocation().ClearOneShot(); | 1506 it.GetBreakLocation().ClearOneShot(); |
1507 } | 1507 } |
1508 } | 1508 } |
1509 } | 1509 } |
1510 | 1510 |
1511 | 1511 |
1512 void Debug::ActivateStepIn(Handle<JSFunction> function, StackFrame* frame) { | 1512 void Debug::ActivateStepIn(StackFrame* frame) { |
1513 DCHECK(!StepOutActive()); | 1513 DCHECK(!StepOutActive()); |
1514 // Make sure IC state is clean. This is so that we correct flood | |
1515 // accessor pairs when stepping in. | |
1516 function->code()->ClearInlineCaches(); | |
1517 function->shared()->feedback_vector()->ClearICSlots(function->shared()); | |
1518 thread_local_.step_into_fp_ = frame->UnpaddedFP(); | 1514 thread_local_.step_into_fp_ = frame->UnpaddedFP(); |
1519 } | 1515 } |
1520 | 1516 |
1521 | 1517 |
1522 void Debug::ClearStepIn() { | 1518 void Debug::ClearStepIn() { |
1523 thread_local_.step_into_fp_ = 0; | 1519 thread_local_.step_into_fp_ = 0; |
1524 } | 1520 } |
1525 | 1521 |
1526 | 1522 |
1527 void Debug::ActivateStepOut(StackFrame* frame) { | 1523 void Debug::ActivateStepOut(StackFrame* frame) { |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2063 | 2059 |
2064 // There will be at least one break point when we are done. | 2060 // There will be at least one break point when we are done. |
2065 has_break_points_ = true; | 2061 has_break_points_ = true; |
2066 | 2062 |
2067 // Ensure function is compiled. Return false if this failed. | 2063 // Ensure function is compiled. Return false if this failed. |
2068 if (!function.is_null() && | 2064 if (!function.is_null() && |
2069 !Compiler::EnsureCompiled(function, CLEAR_EXCEPTION)) { | 2065 !Compiler::EnsureCompiled(function, CLEAR_EXCEPTION)) { |
2070 return false; | 2066 return false; |
2071 } | 2067 } |
2072 | 2068 |
| 2069 // Make sure IC state is clean. This is so that we correctly flood |
| 2070 // accessor pairs when stepping in. |
| 2071 shared->code()->ClearInlineCaches(); |
| 2072 shared->feedback_vector()->ClearICSlots(*shared); |
| 2073 |
2073 // Create the debug info object. | 2074 // Create the debug info object. |
2074 Handle<DebugInfo> debug_info = isolate->factory()->NewDebugInfo(shared); | 2075 Handle<DebugInfo> debug_info = isolate->factory()->NewDebugInfo(shared); |
2075 | 2076 |
2076 // Add debug info to the list. | 2077 // Add debug info to the list. |
2077 DebugInfoListNode* node = new DebugInfoListNode(*debug_info); | 2078 DebugInfoListNode* node = new DebugInfoListNode(*debug_info); |
2078 node->set_next(debug_info_list_); | 2079 node->set_next(debug_info_list_); |
2079 debug_info_list_ = node; | 2080 debug_info_list_ = node; |
2080 | 2081 |
2081 return true; | 2082 return true; |
2082 } | 2083 } |
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3326 } | 3327 } |
3327 | 3328 |
3328 | 3329 |
3329 void LockingCommandMessageQueue::Clear() { | 3330 void LockingCommandMessageQueue::Clear() { |
3330 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 3331 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
3331 queue_.Clear(); | 3332 queue_.Clear(); |
3332 } | 3333 } |
3333 | 3334 |
3334 } // namespace internal | 3335 } // namespace internal |
3335 } // namespace v8 | 3336 } // namespace v8 |
OLD | NEW |