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

Side by Side Diff: src/frames.cc

Issue 1895603002: [esnext] prototype runtime implementation for async functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@AsyncFunction
Patch Set: Try new strategy (Option C) Created 4 years, 7 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
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/frames.h" 5 #include "src/frames.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/ast/scopeinfo.h" 10 #include "src/ast/scopeinfo.h"
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 856
857 857
858 void JavaScriptFrame::GetFunctions(List<JSFunction*>* functions) const { 858 void JavaScriptFrame::GetFunctions(List<JSFunction*>* functions) const {
859 DCHECK(functions->length() == 0); 859 DCHECK(functions->length() == 0);
860 functions->Add(function()); 860 functions->Add(function());
861 } 861 }
862 862
863 void JavaScriptFrame::Summarize(List<FrameSummary>* functions) const { 863 void JavaScriptFrame::Summarize(List<FrameSummary>* functions) const {
864 DCHECK(functions->length() == 0); 864 DCHECK(functions->length() == 0);
865 Code* code = LookupCode(); 865 Code* code = LookupCode();
866
867 // TODO(caitp): these builtins cause crashes here --- that's not good!
caitp (gmail) 2016/04/26 22:01:30 unfortunately still needed in Option C, for reason
868 // Should probably be a better way to keep functions from being included in
869 // stack trace.
870 if (code == *function()->GetIsolate()->builtins()->AsyncFunctionNext() ||
871 code == *function()->GetIsolate()->builtins()->AsyncFunctionThrow())
872 return;
873
866 int offset = static_cast<int>(pc() - code->instruction_start()); 874 int offset = static_cast<int>(pc() - code->instruction_start());
867 AbstractCode* abstract_code = AbstractCode::cast(code); 875 AbstractCode* abstract_code = AbstractCode::cast(code);
868 FrameSummary summary(receiver(), function(), abstract_code, offset, 876 FrameSummary summary(receiver(), function(), abstract_code, offset,
869 IsConstructor()); 877 IsConstructor());
870 functions->Add(summary); 878 functions->Add(summary);
871 } 879 }
872 880
873 JSFunction* JavaScriptFrame::function() const { 881 JSFunction* JavaScriptFrame::function() const {
874 return JSFunction::cast(function_slot_object()); 882 return JSFunction::cast(function_slot_object());
875 } 883 }
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
1763 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { 1771 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) {
1764 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); 1772 StackFrame* frame = AllocateFrameCopy(it.frame(), zone);
1765 list.Add(frame, zone); 1773 list.Add(frame, zone);
1766 } 1774 }
1767 return list.ToVector(); 1775 return list.ToVector();
1768 } 1776 }
1769 1777
1770 1778
1771 } // namespace internal 1779 } // namespace internal
1772 } // namespace v8 1780 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698