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 <memory> | 7 #include <memory> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/ast/ast.h" | 10 #include "src/ast/ast.h" |
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 | 872 |
873 void StubFrame::Iterate(ObjectVisitor* v) const { | 873 void StubFrame::Iterate(ObjectVisitor* v) const { |
874 IterateCompiledFrame(v); | 874 IterateCompiledFrame(v); |
875 } | 875 } |
876 | 876 |
877 | 877 |
878 Code* StubFrame::unchecked_code() const { | 878 Code* StubFrame::unchecked_code() const { |
879 return static_cast<Code*>(isolate()->FindCodeObject(pc())); | 879 return static_cast<Code*>(isolate()->FindCodeObject(pc())); |
880 } | 880 } |
881 | 881 |
| 882 int StubFrame::LookupExceptionHandlerInTable( |
| 883 int* stack_slots, HandlerTable::CatchPrediction* prediction) { |
| 884 DCHECK_NULL(prediction); |
| 885 Code* code = LookupCode(); |
| 886 |
| 887 // Only support catch handlers in TFJ builtins. |
| 888 if (!code->is_turbofanned()) return -1; |
| 889 if (code->kind() != Code::BUILTIN) return -1; |
| 890 |
| 891 HandlerTable* table = HandlerTable::cast(code->handler_table()); |
| 892 int pc_offset = static_cast<int>(pc() - code->entry()); |
| 893 if (stack_slots) *stack_slots = code->stack_slots(); |
| 894 return table->LookupReturn(pc_offset); |
| 895 } |
882 | 896 |
883 Address StubFrame::GetCallerStackPointer() const { | 897 Address StubFrame::GetCallerStackPointer() const { |
884 return fp() + ExitFrameConstants::kCallerSPOffset; | 898 return fp() + ExitFrameConstants::kCallerSPOffset; |
885 } | 899 } |
886 | 900 |
887 | 901 |
888 int StubFrame::GetNumberOfIncomingArguments() const { | 902 int StubFrame::GetNumberOfIncomingArguments() const { |
889 return 0; | 903 return 0; |
890 } | 904 } |
891 | 905 |
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1910 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1924 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
1911 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1925 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
1912 list.Add(frame, zone); | 1926 list.Add(frame, zone); |
1913 } | 1927 } |
1914 return list.ToVector(); | 1928 return list.ToVector(); |
1915 } | 1929 } |
1916 | 1930 |
1917 | 1931 |
1918 } // namespace internal | 1932 } // namespace internal |
1919 } // namespace v8 | 1933 } // namespace v8 |
OLD | NEW |