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

Side by Side Diff: src/objects.h

Issue 1641723002: [interpreter] Translate exception handlers into graph. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 4 years, 10 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/compiler/bytecode-graph-builder.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 4737 matching lines...) Expand 10 before | Expand all | Expand 10 after
4748 // 2) Based on return addresses: Used for turbofanned code. Contains one entry 4748 // 2) Based on return addresses: Used for turbofanned code. Contains one entry
4749 // per call-site that could throw an exception. Layout looks as follows: 4749 // per call-site that could throw an exception. Layout looks as follows:
4750 // [ return-address-offset , handler-offset ] 4750 // [ return-address-offset , handler-offset ]
4751 class HandlerTable : public FixedArray { 4751 class HandlerTable : public FixedArray {
4752 public: 4752 public:
4753 // Conservative prediction whether a given handler will locally catch an 4753 // Conservative prediction whether a given handler will locally catch an
4754 // exception or cause a re-throw to outside the code boundary. Since this is 4754 // exception or cause a re-throw to outside the code boundary. Since this is
4755 // undecidable it is merely an approximation (e.g. useful for debugger). 4755 // undecidable it is merely an approximation (e.g. useful for debugger).
4756 enum CatchPrediction { UNCAUGHT, CAUGHT }; 4756 enum CatchPrediction { UNCAUGHT, CAUGHT };
4757 4757
4758 // Accessors for handler table based on ranges. 4758 // Getters for handler table based on ranges.
4759 inline int GetRangeStart(int index) const;
4760 inline int GetRangeEnd(int index) const;
4761 inline int GetRangeHandler(int index) const;
4762
4763 // Setters for handler table based on ranges.
4759 inline void SetRangeStart(int index, int value); 4764 inline void SetRangeStart(int index, int value);
4760 inline void SetRangeEnd(int index, int value); 4765 inline void SetRangeEnd(int index, int value);
4761 inline void SetRangeHandler(int index, int offset, CatchPrediction pred); 4766 inline void SetRangeHandler(int index, int offset, CatchPrediction pred);
4762 inline void SetRangeDepth(int index, int value); 4767 inline void SetRangeDepth(int index, int value);
4763 4768
4764 // Accessors for handler table based on return addresses. 4769 // Setters for handler table based on return addresses.
4765 inline void SetReturnOffset(int index, int value); 4770 inline void SetReturnOffset(int index, int value);
4766 inline void SetReturnHandler(int index, int offset, CatchPrediction pred); 4771 inline void SetReturnHandler(int index, int offset, CatchPrediction pred);
4767 4772
4768 // Lookup handler in a table based on ranges. 4773 // Lookup handler in a table based on ranges.
4769 int LookupRange(int pc_offset, int* stack_depth, CatchPrediction* prediction); 4774 int LookupRange(int pc_offset, int* stack_depth, CatchPrediction* prediction);
4770 4775
4771 // Lookup handler in a table based on return addresses. 4776 // Lookup handler in a table based on return addresses.
4772 int LookupReturn(int pc_offset, CatchPrediction* prediction); 4777 int LookupReturn(int pc_offset, CatchPrediction* prediction);
4773 4778
4779 // Returns the number of entries in the table.
4780 inline int NumberOfRangeEntries() const;
4781
4774 // Returns the required length of the underlying fixed array. 4782 // Returns the required length of the underlying fixed array.
4775 static int LengthForRange(int entries) { return entries * kRangeEntrySize; } 4783 static int LengthForRange(int entries) { return entries * kRangeEntrySize; }
4776 static int LengthForReturn(int entries) { return entries * kReturnEntrySize; } 4784 static int LengthForReturn(int entries) { return entries * kReturnEntrySize; }
4777 4785
4778 DECLARE_CAST(HandlerTable) 4786 DECLARE_CAST(HandlerTable)
4779 4787
4780 #ifdef ENABLE_DISASSEMBLER 4788 #ifdef ENABLE_DISASSEMBLER
4781 void HandlerTableRangePrint(std::ostream& os); // NOLINT 4789 void HandlerTableRangePrint(std::ostream& os); // NOLINT
4782 void HandlerTableReturnPrint(std::ostream& os); // NOLINT 4790 void HandlerTableReturnPrint(std::ostream& os); // NOLINT
4783 #endif 4791 #endif
(...skipping 5994 matching lines...) Expand 10 before | Expand all | Expand 10 after
10778 } 10786 }
10779 return value; 10787 return value;
10780 } 10788 }
10781 }; 10789 };
10782 10790
10783 10791
10784 } // NOLINT, false-positive due to second-order macros. 10792 } // NOLINT, false-positive due to second-order macros.
10785 } // NOLINT, false-positive due to second-order macros. 10793 } // NOLINT, false-positive due to second-order macros.
10786 10794
10787 #endif // V8_OBJECTS_H_ 10795 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/compiler/bytecode-graph-builder.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698