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/debug/debug.h" | 5 #include "src/debug/debug.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
(...skipping 1600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1611 | 1611 |
1612 // Create debug info and add it to the list. | 1612 // Create debug info and add it to the list. |
1613 Handle<DebugInfo> debug_info = isolate_->factory()->NewDebugInfo(shared); | 1613 Handle<DebugInfo> debug_info = isolate_->factory()->NewDebugInfo(shared); |
1614 DebugInfoListNode* node = new DebugInfoListNode(*debug_info); | 1614 DebugInfoListNode* node = new DebugInfoListNode(*debug_info); |
1615 node->set_next(debug_info_list_); | 1615 node->set_next(debug_info_list_); |
1616 debug_info_list_ = node; | 1616 debug_info_list_ = node; |
1617 | 1617 |
1618 return debug_info; | 1618 return debug_info; |
1619 } | 1619 } |
1620 | 1620 |
| 1621 void Debug::InstallCoverageInfo(Handle<SharedFunctionInfo> shared, |
| 1622 Handle<CoverageInfo> coverage_info) { |
| 1623 DCHECK(FLAG_block_coverage); |
| 1624 DCHECK(!coverage_info.is_null()); |
| 1625 |
| 1626 Handle<DebugInfo> debug_info = GetOrCreateDebugInfo(shared); |
| 1627 |
| 1628 DCHECK(!debug_info->HasCoverageInfo()); |
| 1629 |
| 1630 debug_info->set_flags(debug_info->flags() | DebugInfo::kHasCoverageInfo); |
| 1631 debug_info->set_coverage_info(*coverage_info); |
| 1632 } |
| 1633 |
1621 void Debug::FindDebugInfo(Handle<DebugInfo> debug_info, | 1634 void Debug::FindDebugInfo(Handle<DebugInfo> debug_info, |
1622 DebugInfoListNode** prev, DebugInfoListNode** curr) { | 1635 DebugInfoListNode** prev, DebugInfoListNode** curr) { |
1623 HandleScope scope(isolate_); | 1636 HandleScope scope(isolate_); |
1624 *prev = nullptr; | 1637 *prev = nullptr; |
1625 *curr = debug_info_list_; | 1638 *curr = debug_info_list_; |
1626 while (*curr != nullptr) { | 1639 while (*curr != nullptr) { |
1627 if ((*curr)->debug_info().is_identical_to(debug_info)) return; | 1640 if ((*curr)->debug_info().is_identical_to(debug_info)) return; |
1628 *prev = *curr; | 1641 *prev = *curr; |
1629 *curr = (*curr)->next(); | 1642 *curr = (*curr)->next(); |
1630 } | 1643 } |
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2501 isolate_->Throw(*isolate_->factory()->NewEvalError( | 2514 isolate_->Throw(*isolate_->factory()->NewEvalError( |
2502 MessageTemplate::kNoSideEffectDebugEvaluate)); | 2515 MessageTemplate::kNoSideEffectDebugEvaluate)); |
2503 } | 2516 } |
2504 isolate_->set_needs_side_effect_check(old_needs_side_effect_check_); | 2517 isolate_->set_needs_side_effect_check(old_needs_side_effect_check_); |
2505 isolate_->debug()->UpdateHookOnFunctionCall(); | 2518 isolate_->debug()->UpdateHookOnFunctionCall(); |
2506 isolate_->debug()->side_effect_check_failed_ = false; | 2519 isolate_->debug()->side_effect_check_failed_ = false; |
2507 } | 2520 } |
2508 | 2521 |
2509 } // namespace internal | 2522 } // namespace internal |
2510 } // namespace v8 | 2523 } // namespace v8 |
OLD | NEW |