| OLD | NEW |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef V8_OBJECTS_FRAME_ARRAY_H_ | 5 #ifndef V8_OBJECTS_FRAME_ARRAY_H_ |
| 6 #define V8_OBJECTS_FRAME_ARRAY_H_ | 6 #define V8_OBJECTS_FRAME_ARRAY_H_ |
| 7 | 7 |
| 8 #include "src/objects.h" | 8 #include "src/objects.h" |
| 9 #include "src/wasm/wasm-objects.h" | 9 #include "src/wasm/wasm-objects.h" |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 V(WasmFunctionIndex, Smi) \ | 22 V(WasmFunctionIndex, Smi) \ |
| 23 V(Receiver, Object) \ | 23 V(Receiver, Object) \ |
| 24 V(Function, JSFunction) \ | 24 V(Function, JSFunction) \ |
| 25 V(Code, AbstractCode) \ | 25 V(Code, AbstractCode) \ |
| 26 V(Offset, Smi) \ | 26 V(Offset, Smi) \ |
| 27 V(Flags, Smi) | 27 V(Flags, Smi) |
| 28 | 28 |
| 29 // Container object for data collected during simple stack trace captures. | 29 // Container object for data collected during simple stack trace captures. |
| 30 class FrameArray : public FixedArray { | 30 class FrameArray : public FixedArray { |
| 31 public: | 31 public: |
| 32 #define DECLARE_FRAME_ARRAY_ACCESSORS(name, type) \ | 32 #define DECL_FRAME_ARRAY_ACCESSORS(name, type) \ |
| 33 inline type* name(int frame_ix) const; \ | 33 inline type* name(int frame_ix) const; \ |
| 34 inline void Set##name(int frame_ix, type* value); | 34 inline void Set##name(int frame_ix, type* value); |
| 35 FRAME_ARRAY_FIELD_LIST(DECLARE_FRAME_ARRAY_ACCESSORS) | 35 FRAME_ARRAY_FIELD_LIST(DECL_FRAME_ARRAY_ACCESSORS) |
| 36 #undef DECLARE_FRAME_ARRAY_ACCESSORS | 36 #undef DECL_FRAME_ARRAY_ACCESSORS |
| 37 | 37 |
| 38 inline bool IsWasmFrame(int frame_ix) const; | 38 inline bool IsWasmFrame(int frame_ix) const; |
| 39 inline bool IsWasmInterpretedFrame(int frame_ix) const; | 39 inline bool IsWasmInterpretedFrame(int frame_ix) const; |
| 40 inline bool IsAsmJsWasmFrame(int frame_ix) const; | 40 inline bool IsAsmJsWasmFrame(int frame_ix) const; |
| 41 inline int FrameCount() const; | 41 inline int FrameCount() const; |
| 42 | 42 |
| 43 void ShrinkToFit(); | 43 void ShrinkToFit(); |
| 44 | 44 |
| 45 // Flags. | 45 // Flags. |
| 46 enum Flag { | 46 enum Flag { |
| 47 kIsWasmFrame = 1 << 0, | 47 kIsWasmFrame = 1 << 0, |
| 48 kIsWasmInterpretedFrame = 1 << 1, | 48 kIsWasmInterpretedFrame = 1 << 1, |
| 49 kIsAsmJsWasmFrame = 1 << 2, | 49 kIsAsmJsWasmFrame = 1 << 2, |
| 50 kIsStrict = 1 << 3, | 50 kIsStrict = 1 << 3, |
| 51 kIsConstructor = 1 << 4, | 51 kIsConstructor = 1 << 4, |
| 52 kAsmJsAtNumberConversion = 1 << 5 | 52 kAsmJsAtNumberConversion = 1 << 5 |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 static Handle<FrameArray> AppendJSFrame(Handle<FrameArray> in, | 55 static Handle<FrameArray> AppendJSFrame(Handle<FrameArray> in, |
| 56 Handle<Object> receiver, | 56 Handle<Object> receiver, |
| 57 Handle<JSFunction> function, | 57 Handle<JSFunction> function, |
| 58 Handle<AbstractCode> code, int offset, | 58 Handle<AbstractCode> code, int offset, |
| 59 int flags); | 59 int flags); |
| 60 static Handle<FrameArray> AppendWasmFrame( | 60 static Handle<FrameArray> AppendWasmFrame( |
| 61 Handle<FrameArray> in, Handle<WasmInstanceObject> wasm_instance, | 61 Handle<FrameArray> in, Handle<WasmInstanceObject> wasm_instance, |
| 62 int wasm_function_index, Handle<AbstractCode> code, int offset, | 62 int wasm_function_index, Handle<AbstractCode> code, int offset, |
| 63 int flags); | 63 int flags); |
| 64 | 64 |
| 65 DECLARE_CAST(FrameArray) | 65 DECL_CAST(FrameArray) |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 // The underlying fixed array embodies a captured stack trace. Frame i | 68 // The underlying fixed array embodies a captured stack trace. Frame i |
| 69 // occupies indices | 69 // occupies indices |
| 70 // | 70 // |
| 71 // kFirstIndex + 1 + [i * kElementsPerFrame, (i + 1) * kElementsPerFrame[, | 71 // kFirstIndex + 1 + [i * kElementsPerFrame, (i + 1) * kElementsPerFrame[, |
| 72 // | 72 // |
| 73 // with internal offsets as below: | 73 // with internal offsets as below: |
| 74 | 74 |
| 75 static const int kWasmInstanceOffset = 0; | 75 static const int kWasmInstanceOffset = 0; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 99 friend class Factory; | 99 friend class Factory; |
| 100 DISALLOW_IMPLICIT_CONSTRUCTORS(FrameArray); | 100 DISALLOW_IMPLICIT_CONSTRUCTORS(FrameArray); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 } // namespace internal | 103 } // namespace internal |
| 104 } // namespace v8 | 104 } // namespace v8 |
| 105 | 105 |
| 106 #include "src/objects/object-macros-undef.h" | 106 #include "src/objects/object-macros-undef.h" |
| 107 | 107 |
| 108 #endif // V8_OBJECTS_FRAME_ARRAY_H_ | 108 #endif // V8_OBJECTS_FRAME_ARRAY_H_ |
| OLD | NEW |