| 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/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 1912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1923 | 1923 |
| 1924 DCHECK(i == kNumJSCallerSaved); | 1924 DCHECK(i == kNumJSCallerSaved); |
| 1925 } | 1925 } |
| 1926 | 1926 |
| 1927 | 1927 |
| 1928 int JSCallerSavedCode(int n) { | 1928 int JSCallerSavedCode(int n) { |
| 1929 DCHECK(0 <= n && n < kNumJSCallerSaved); | 1929 DCHECK(0 <= n && n < kNumJSCallerSaved); |
| 1930 return caller_saved_code_data.reg_code[n]; | 1930 return caller_saved_code_data.reg_code[n]; |
| 1931 } | 1931 } |
| 1932 | 1932 |
| 1933 | |
| 1934 #define DEFINE_WRAPPER(type, field) \ | 1933 #define DEFINE_WRAPPER(type, field) \ |
| 1935 class field##_Wrapper : public ZoneObject { \ | 1934 class field##_Wrapper : public ZoneObject { \ |
| 1936 public: /* NOLINT */ \ | 1935 public: /* NOLINT */ \ |
| 1937 field##_Wrapper(const field& original) : frame_(original) { \ | 1936 field##_Wrapper(const field& original) : frame_(original) {} \ |
| 1938 } \ | 1937 field frame_; \ |
| 1939 field frame_; \ | 1938 }; |
| 1940 }; | |
| 1941 STACK_FRAME_TYPE_LIST(DEFINE_WRAPPER) | 1939 STACK_FRAME_TYPE_LIST(DEFINE_WRAPPER) |
| 1942 #undef DEFINE_WRAPPER | 1940 #undef DEFINE_WRAPPER |
| 1943 | 1941 |
| 1944 static StackFrame* AllocateFrameCopy(StackFrame* frame, Zone* zone) { | 1942 static StackFrame* AllocateFrameCopy(StackFrame* frame, Zone* zone) { |
| 1945 #define FRAME_TYPE_CASE(type, field) \ | 1943 #define FRAME_TYPE_CASE(type, field) \ |
| 1946 case StackFrame::type: { \ | 1944 case StackFrame::type: { \ |
| 1947 field##_Wrapper* wrapper = \ | 1945 field##_Wrapper* wrapper = \ |
| 1948 new(zone) field##_Wrapper(*(reinterpret_cast<field*>(frame))); \ | 1946 new(zone) field##_Wrapper(*(reinterpret_cast<field*>(frame))); \ |
| 1949 return &wrapper->frame_; \ | 1947 return &wrapper->frame_; \ |
| 1950 } | 1948 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1963 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1961 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
| 1964 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1962 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
| 1965 list.Add(frame, zone); | 1963 list.Add(frame, zone); |
| 1966 } | 1964 } |
| 1967 return list.ToVector(); | 1965 return list.ToVector(); |
| 1968 } | 1966 } |
| 1969 | 1967 |
| 1970 | 1968 |
| 1971 } // namespace internal | 1969 } // namespace internal |
| 1972 } // namespace v8 | 1970 } // namespace v8 |
| OLD | NEW |