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

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: fix remaining brokenness in throw resuming Created 4 years, 8 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 | « src/factory.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('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/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!
868 // Should probably be a better way to keep functions from being included in
869 // stack trace.
870 if (code == *function()->GetIsolate()->builtins()->AsyncFunctionNext() ||
caitp (gmail) 2016/04/16 20:09:30 other than the off-by-one bug mentioned and fixed
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 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
1748 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { 1756 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) {
1749 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); 1757 StackFrame* frame = AllocateFrameCopy(it.frame(), zone);
1750 list.Add(frame, zone); 1758 list.Add(frame, zone);
1751 } 1759 }
1752 return list.ToVector(); 1760 return list.ToVector();
1753 } 1761 }
1754 1762
1755 1763
1756 } // namespace internal 1764 } // namespace internal
1757 } // namespace v8 1765 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698