| OLD | NEW |
| 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 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 4579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4590 // exception or cause a re-throw to outside the code boundary. Since this is | 4590 // exception or cause a re-throw to outside the code boundary. Since this is |
| 4591 // undecidable it is merely an approximation (e.g. useful for debugger). | 4591 // undecidable it is merely an approximation (e.g. useful for debugger). |
| 4592 enum CatchPrediction { | 4592 enum CatchPrediction { |
| 4593 UNCAUGHT, // The handler will (likely) rethrow the exception. | 4593 UNCAUGHT, // The handler will (likely) rethrow the exception. |
| 4594 CAUGHT, // The exception will be caught by the handler. | 4594 CAUGHT, // The exception will be caught by the handler. |
| 4595 PROMISE, // The exception will be caught and cause a promise rejection. | 4595 PROMISE, // The exception will be caught and cause a promise rejection. |
| 4596 DESUGARING, // The exception will be caught, but both the exception and the | 4596 DESUGARING, // The exception will be caught, but both the exception and the |
| 4597 // catching are part of a desugaring and should therefore not | 4597 // catching are part of a desugaring and should therefore not |
| 4598 // be visible to the user (we won't notify the debugger of such | 4598 // be visible to the user (we won't notify the debugger of such |
| 4599 // exceptions). | 4599 // exceptions). |
| 4600 ASYNC_AWAIT, // The exception will be caught and cause a promise rejection |
| 4601 // in the desugaring of an async function, so special |
| 4602 // async/await handling in the debugger can take place. |
| 4600 }; | 4603 }; |
| 4601 | 4604 |
| 4602 // Getters for handler table based on ranges. | 4605 // Getters for handler table based on ranges. |
| 4603 inline int GetRangeStart(int index) const; | 4606 inline int GetRangeStart(int index) const; |
| 4604 inline int GetRangeEnd(int index) const; | 4607 inline int GetRangeEnd(int index) const; |
| 4605 inline int GetRangeHandler(int index) const; | 4608 inline int GetRangeHandler(int index) const; |
| 4606 inline int GetRangeData(int index) const; | 4609 inline int GetRangeData(int index) const; |
| 4607 | 4610 |
| 4608 // Setters for handler table based on ranges. | 4611 // Setters for handler table based on ranges. |
| 4609 inline void SetRangeStart(int index, int value); | 4612 inline void SetRangeStart(int index, int value); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4642 static const int kRangeHandlerIndex = 2; | 4645 static const int kRangeHandlerIndex = 2; |
| 4643 static const int kRangeDataIndex = 3; | 4646 static const int kRangeDataIndex = 3; |
| 4644 static const int kRangeEntrySize = 4; | 4647 static const int kRangeEntrySize = 4; |
| 4645 | 4648 |
| 4646 // Layout description for handler table based on return addresses. | 4649 // Layout description for handler table based on return addresses. |
| 4647 static const int kReturnOffsetIndex = 0; | 4650 static const int kReturnOffsetIndex = 0; |
| 4648 static const int kReturnHandlerIndex = 1; | 4651 static const int kReturnHandlerIndex = 1; |
| 4649 static const int kReturnEntrySize = 2; | 4652 static const int kReturnEntrySize = 2; |
| 4650 | 4653 |
| 4651 // Encoding of the {handler} field. | 4654 // Encoding of the {handler} field. |
| 4652 class HandlerPredictionField : public BitField<CatchPrediction, 0, 2> {}; | 4655 class HandlerPredictionField : public BitField<CatchPrediction, 0, 3> {}; |
| 4653 class HandlerOffsetField : public BitField<int, 2, 30> {}; | 4656 class HandlerOffsetField : public BitField<int, 3, 29> {}; |
| 4654 }; | 4657 }; |
| 4655 | 4658 |
| 4656 // ByteArray represents fixed sized byte arrays. Used for the relocation info | 4659 // ByteArray represents fixed sized byte arrays. Used for the relocation info |
| 4657 // that is attached to code objects. | 4660 // that is attached to code objects. |
| 4658 class ByteArray: public FixedArrayBase { | 4661 class ByteArray: public FixedArrayBase { |
| 4659 public: | 4662 public: |
| 4660 inline int Size(); | 4663 inline int Size(); |
| 4661 | 4664 |
| 4662 // Setter and getter. | 4665 // Setter and getter. |
| 4663 inline byte get(int index); | 4666 inline byte get(int index); |
| (...skipping 6562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11226 } | 11229 } |
| 11227 return value; | 11230 return value; |
| 11228 } | 11231 } |
| 11229 }; | 11232 }; |
| 11230 | 11233 |
| 11231 | 11234 |
| 11232 } // NOLINT, false-positive due to second-order macros. | 11235 } // NOLINT, false-positive due to second-order macros. |
| 11233 } // NOLINT, false-positive due to second-order macros. | 11236 } // NOLINT, false-positive due to second-order macros. |
| 11234 | 11237 |
| 11235 #endif // V8_OBJECTS_H_ | 11238 #endif // V8_OBJECTS_H_ |
| OLD | NEW |