Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: src/debug/liveedit.cc

Issue 2058733002: [liveedit]: fail to patch if target is outside of async function on stack (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/harmony/debug-async-liveedit.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/liveedit.h" 5 #include "src/debug/liveedit.h"
6 6
7 #include "src/ast/scopeinfo.h" 7 #include "src/ast/scopeinfo.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/compilation-cache.h" 10 #include "src/compilation-cache.h"
(...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after
1619 Smi::FromInt( 1619 Smi::FromInt(
1620 LiveEdit::FUNCTION_BLOCKED_NO_NEW_TARGET_ON_RESTART), 1620 LiveEdit::FUNCTION_BLOCKED_NO_NEW_TARGET_ON_RESTART),
1621 isolate)); 1621 isolate));
1622 return true; 1622 return true;
1623 } 1623 }
1624 return false; 1624 return false;
1625 } 1625 }
1626 return false; 1626 return false;
1627 } 1627 }
1628 1628
1629 void set_status(LiveEdit::FunctionPatchabilityStatus status) {
caitp (gmail) 2016/06/10 13:08:16 this stuff might actually not be necessary, since
Dan Ehrenberg 2016/06/10 13:14:41 What do you mean the test turned out to be wrong?
caitp (gmail) 2016/06/10 13:18:45 The assertion that the last promise value would be
1630 Isolate* isolate = old_shared_array_->GetIsolate();
1631 int len = GetArrayLength(old_shared_array_);
1632 for (int i = 0; i < len; ++i) {
1633 Handle<Object> old_element =
1634 JSReceiver::GetElement(isolate, result_, i).ToHandleChecked();
1635 if (!old_element->IsSmi() ||
1636 Smi::cast(*old_element)->value() ==
1637 LiveEdit::FUNCTION_AVAILABLE_FOR_PATCH) {
1638 SetElementSloppy(result_, i,
1639 Handle<Smi>(Smi::FromInt(status), isolate));
1640 }
1641 }
1642 }
1643
1629 private: 1644 private:
1630 Handle<JSArray> old_shared_array_; 1645 Handle<JSArray> old_shared_array_;
1631 Handle<JSArray> new_shared_array_; 1646 Handle<JSArray> new_shared_array_;
1632 Handle<JSArray> result_; 1647 Handle<JSArray> result_;
1633 }; 1648 };
1634 1649
1635 1650
1636 // Drops all call frame matched by target and all frames above them. 1651 // Drops all call frame matched by target and all frames above them.
1637 template <typename TARGET> 1652 template <typename TARGET>
1638 static const char* DropActivationsInActiveThreadImpl(Isolate* isolate, 1653 static const char* DropActivationsInActiveThreadImpl(Isolate* isolate,
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1696 // There is a C or generator frame on stack. We can't drop C frames, and we 1711 // There is a C or generator frame on stack. We can't drop C frames, and we
1697 // can't restart generators. Check that there are no target frames below 1712 // can't restart generators. Check that there are no target frames below
1698 // them. 1713 // them.
1699 for (; frame_index < frames.length(); frame_index++) { 1714 for (; frame_index < frames.length(); frame_index++) {
1700 StackFrame* frame = frames[frame_index]; 1715 StackFrame* frame = frames[frame_index];
1701 if (frame->is_java_script()) { 1716 if (frame->is_java_script()) {
1702 if (target.MatchActivation(frame, non_droppable_reason)) { 1717 if (target.MatchActivation(frame, non_droppable_reason)) {
1703 // Fail. 1718 // Fail.
1704 return NULL; 1719 return NULL;
1705 } 1720 }
1721 if (non_droppable_reason ==
1722 LiveEdit::FUNCTION_BLOCKED_UNDER_GENERATOR &&
1723 !target_frame_found) {
1724 // Fail.
1725 target.set_status(non_droppable_reason);
1726 return NULL;
1727 }
1706 } 1728 }
1707 } 1729 }
1708 } 1730 }
1709 1731
1710 // We cannot restart a frame that uses new.target. 1732 // We cannot restart a frame that uses new.target.
1711 if (target.FrameUsesNewTarget(frames[bottom_js_frame_index])) return NULL; 1733 if (target.FrameUsesNewTarget(frames[bottom_js_frame_index])) return NULL;
1712 1734
1713 if (!do_drop) { 1735 if (!do_drop) {
1714 // We are in check-only mode. 1736 // We are in check-only mode.
1715 return NULL; 1737 return NULL;
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
2042 scope_info_length++; 2064 scope_info_length++;
2043 2065
2044 current_scope = current_scope->outer_scope(); 2066 current_scope = current_scope->outer_scope();
2045 } 2067 }
2046 2068
2047 return scope_info_list; 2069 return scope_info_list;
2048 } 2070 }
2049 2071
2050 } // namespace internal 2072 } // namespace internal
2051 } // namespace v8 2073 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/harmony/debug-async-liveedit.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698