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

Side by Side Diff: src/frames.h

Issue 1605633003: [interpreter] First implementation of stack unwinding. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_int-5
Patch Set: Created 4 years, 11 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/builtins.h ('k') | src/frames.cc » ('j') | src/frames.cc » ('J')
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 #ifndef V8_FRAMES_H_ 5 #ifndef V8_FRAMES_H_
6 #define V8_FRAMES_H_ 6 #define V8_FRAMES_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/handles.h" 9 #include "src/handles.h"
10 #include "src/safepoint-table.h" 10 #include "src/safepoint-table.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 176
177 class InterpreterFrameConstants : public AllStatic { 177 class InterpreterFrameConstants : public AllStatic {
178 public: 178 public:
179 // Fixed frame includes new.target and bytecode offset. 179 // Fixed frame includes new.target and bytecode offset.
180 static const int kFixedFrameSize = 180 static const int kFixedFrameSize =
181 StandardFrameConstants::kFixedFrameSize + 2 * kPointerSize; 181 StandardFrameConstants::kFixedFrameSize + 2 * kPointerSize;
182 static const int kFixedFrameSizeFromFp = 182 static const int kFixedFrameSizeFromFp =
183 StandardFrameConstants::kFixedFrameSizeFromFp + 2 * kPointerSize; 183 StandardFrameConstants::kFixedFrameSizeFromFp + 2 * kPointerSize;
184 184
185 // FP-relative. 185 // FP-relative.
186 static const int kBytecodeOffsetFromFp =
187 -StandardFrameConstants::kFixedFrameSizeFromFp - 2 * kPointerSize;
186 static const int kRegisterFilePointerFromFp = 188 static const int kRegisterFilePointerFromFp =
187 -StandardFrameConstants::kFixedFrameSizeFromFp - 3 * kPointerSize; 189 -StandardFrameConstants::kFixedFrameSizeFromFp - 3 * kPointerSize;
188 190
189 // Register file pointer relative. 191 // Register file pointer relative.
190 static const int kLastParamFromRegisterPointer = 192 static const int kLastParamFromRegisterPointer =
191 StandardFrameConstants::kFixedFrameSize + 3 * kPointerSize; 193 StandardFrameConstants::kFixedFrameSize + 3 * kPointerSize;
192 194
193 static const int kBytecodeOffsetFromRegisterPointer = 1 * kPointerSize; 195 static const int kBytecodeOffsetFromRegisterPointer = 1 * kPointerSize;
194 static const int kNewTargetFromRegisterPointer = 2 * kPointerSize; 196 static const int kNewTargetFromRegisterPointer = 2 * kPointerSize;
195 static const int kFunctionFromRegisterPointer = 3 * kPointerSize; 197 static const int kFunctionFromRegisterPointer = 3 * kPointerSize;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 this->state_ = original.state_; 244 this->state_ = original.state_;
243 this->iterator_ = NULL; 245 this->iterator_ = NULL;
244 this->isolate_ = original.isolate_; 246 this->isolate_ = original.isolate_;
245 } 247 }
246 248
247 // Type testers. 249 // Type testers.
248 bool is_entry() const { return type() == ENTRY; } 250 bool is_entry() const { return type() == ENTRY; }
249 bool is_entry_construct() const { return type() == ENTRY_CONSTRUCT; } 251 bool is_entry_construct() const { return type() == ENTRY_CONSTRUCT; }
250 bool is_exit() const { return type() == EXIT; } 252 bool is_exit() const { return type() == EXIT; }
251 bool is_optimized() const { return type() == OPTIMIZED; } 253 bool is_optimized() const { return type() == OPTIMIZED; }
254 bool is_interpreted() const { return type() == INTERPRETED; }
252 bool is_arguments_adaptor() const { return type() == ARGUMENTS_ADAPTOR; } 255 bool is_arguments_adaptor() const { return type() == ARGUMENTS_ADAPTOR; }
253 bool is_internal() const { return type() == INTERNAL; } 256 bool is_internal() const { return type() == INTERNAL; }
254 bool is_stub_failure_trampoline() const { 257 bool is_stub_failure_trampoline() const {
255 return type() == STUB_FAILURE_TRAMPOLINE; 258 return type() == STUB_FAILURE_TRAMPOLINE;
256 } 259 }
257 bool is_construct() const { return type() == CONSTRUCT; } 260 bool is_construct() const { return type() == CONSTRUCT; }
258 virtual bool is_standard() const { return false; } 261 virtual bool is_standard() const { return false; }
259 262
260 bool is_java_script() const { 263 bool is_java_script() const {
261 Type type = this->type(); 264 Type type = this->type();
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 inline explicit OptimizedFrame(StackFrameIteratorBase* iterator); 707 inline explicit OptimizedFrame(StackFrameIteratorBase* iterator);
705 708
706 private: 709 private:
707 friend class StackFrameIteratorBase; 710 friend class StackFrameIteratorBase;
708 711
709 Object* StackSlotAt(int index) const; 712 Object* StackSlotAt(int index) const;
710 }; 713 };
711 714
712 715
713 class InterpretedFrame : public JavaScriptFrame { 716 class InterpretedFrame : public JavaScriptFrame {
717 public:
714 Type type() const override { return INTERPRETED; } 718 Type type() const override { return INTERPRETED; }
715 719
720 // Lookup exception handler for current {pc}, returns -1 if none found. Also
721 // returns the expected number of stack slots at the handler site.
722 int LookupExceptionHandlerInTable(
723 int* stack_slots, HandlerTable::CatchPrediction* prediction) override;
724
725 // Returns the current offset into the bytecode stream.
726 int GetBytecodeOffset() const;
727
728 // Updates the current offset into the bytecode stream, mainly used for stack
729 // unwinding to continue execution at a different bytecode offset.
730 void PatchBytecodeOffset(int new_offset);
731
716 protected: 732 protected:
717 inline explicit InterpretedFrame(StackFrameIteratorBase* iterator); 733 inline explicit InterpretedFrame(StackFrameIteratorBase* iterator);
718 734
719 private: 735 private:
720 friend class StackFrameIteratorBase; 736 friend class StackFrameIteratorBase;
721 }; 737 };
722 738
723 739
724 // Arguments adaptor frames are automatically inserted below 740 // Arguments adaptor frames are automatically inserted below
725 // JavaScript frames when the actual number of parameters does not 741 // JavaScript frames when the actual number of parameters does not
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 981
966 982
967 // Reads all frames on the current stack and copies them into the current 983 // Reads all frames on the current stack and copies them into the current
968 // zone memory. 984 // zone memory.
969 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); 985 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone);
970 986
971 } // namespace internal 987 } // namespace internal
972 } // namespace v8 988 } // namespace v8
973 989
974 #endif // V8_FRAMES_H_ 990 #endif // V8_FRAMES_H_
OLDNEW
« no previous file with comments | « src/builtins.h ('k') | src/frames.cc » ('j') | src/frames.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698