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/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 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 | 858 |
859 void JavaScriptFrame::GetFunctions(List<JSFunction*>* functions) const { | 859 void JavaScriptFrame::GetFunctions(List<JSFunction*>* functions) const { |
860 DCHECK(functions->length() == 0); | 860 DCHECK(functions->length() == 0); |
861 functions->Add(function()); | 861 functions->Add(function()); |
862 } | 862 } |
863 | 863 |
864 void JavaScriptFrame::Summarize(List<FrameSummary>* functions, | 864 void JavaScriptFrame::Summarize(List<FrameSummary>* functions, |
865 FrameSummary::Mode mode) const { | 865 FrameSummary::Mode mode) const { |
866 DCHECK(functions->length() == 0); | 866 DCHECK(functions->length() == 0); |
867 Code* code = LookupCode(); | 867 Code* code = LookupCode(); |
| 868 |
| 869 // TODO(caitp): these builtins cause crashes here --- that's not good! |
| 870 // Should probably be a better way to keep functions from being included in |
| 871 // stack trace. |
| 872 if (code == *function()->GetIsolate()->builtins()->AsyncFunctionNext() || |
| 873 code == *function()->GetIsolate()->builtins()->AsyncFunctionThrow()) |
| 874 return; |
| 875 |
868 int offset = static_cast<int>(pc() - code->instruction_start()); | 876 int offset = static_cast<int>(pc() - code->instruction_start()); |
869 AbstractCode* abstract_code = AbstractCode::cast(code); | 877 AbstractCode* abstract_code = AbstractCode::cast(code); |
870 FrameSummary summary(receiver(), function(), abstract_code, offset, | 878 FrameSummary summary(receiver(), function(), abstract_code, offset, |
871 IsConstructor(), mode); | 879 IsConstructor(), mode); |
872 functions->Add(summary); | 880 functions->Add(summary); |
873 } | 881 } |
874 | 882 |
875 JSFunction* JavaScriptFrame::function() const { | 883 JSFunction* JavaScriptFrame::function() const { |
876 return JSFunction::cast(function_slot_object()); | 884 return JSFunction::cast(function_slot_object()); |
877 } | 885 } |
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1798 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1806 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
1799 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1807 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
1800 list.Add(frame, zone); | 1808 list.Add(frame, zone); |
1801 } | 1809 } |
1802 return list.ToVector(); | 1810 return list.ToVector(); |
1803 } | 1811 } |
1804 | 1812 |
1805 | 1813 |
1806 } // namespace internal | 1814 } // namespace internal |
1807 } // namespace v8 | 1815 } // namespace v8 |
OLD | NEW |