| 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 4607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4618 // exception or cause a re-throw to outside the code boundary. Since this is | 4618 // exception or cause a re-throw to outside the code boundary. Since this is |
| 4619 // undecidable it is merely an approximation (e.g. useful for debugger). | 4619 // undecidable it is merely an approximation (e.g. useful for debugger). |
| 4620 enum CatchPrediction { | 4620 enum CatchPrediction { |
| 4621 UNCAUGHT, // The handler will (likely) rethrow the exception. | 4621 UNCAUGHT, // The handler will (likely) rethrow the exception. |
| 4622 CAUGHT, // The exception will be caught by the handler. | 4622 CAUGHT, // The exception will be caught by the handler. |
| 4623 PROMISE, // The exception will be caught and cause a promise rejection. | 4623 PROMISE, // The exception will be caught and cause a promise rejection. |
| 4624 DESUGARING, // The exception will be caught, but both the exception and the | 4624 DESUGARING, // The exception will be caught, but both the exception and the |
| 4625 // catching are part of a desugaring and should therefore not | 4625 // catching are part of a desugaring and should therefore not |
| 4626 // be visible to the user (we won't notify the debugger of such | 4626 // be visible to the user (we won't notify the debugger of such |
| 4627 // exceptions). | 4627 // exceptions). |
| 4628 ASYNC_AWAIT, // The exception will be caught and cause a promise rejection |
| 4629 // in the desugaring of an async function, so special |
| 4630 // async/await handling in the debugger can take place. |
| 4628 }; | 4631 }; |
| 4629 | 4632 |
| 4630 // Getters for handler table based on ranges. | 4633 // Getters for handler table based on ranges. |
| 4631 inline int GetRangeStart(int index) const; | 4634 inline int GetRangeStart(int index) const; |
| 4632 inline int GetRangeEnd(int index) const; | 4635 inline int GetRangeEnd(int index) const; |
| 4633 inline int GetRangeHandler(int index) const; | 4636 inline int GetRangeHandler(int index) const; |
| 4634 inline int GetRangeData(int index) const; | 4637 inline int GetRangeData(int index) const; |
| 4635 | 4638 |
| 4636 // Setters for handler table based on ranges. | 4639 // Setters for handler table based on ranges. |
| 4637 inline void SetRangeStart(int index, int value); | 4640 inline void SetRangeStart(int index, int value); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4670 static const int kRangeHandlerIndex = 2; | 4673 static const int kRangeHandlerIndex = 2; |
| 4671 static const int kRangeDataIndex = 3; | 4674 static const int kRangeDataIndex = 3; |
| 4672 static const int kRangeEntrySize = 4; | 4675 static const int kRangeEntrySize = 4; |
| 4673 | 4676 |
| 4674 // Layout description for handler table based on return addresses. | 4677 // Layout description for handler table based on return addresses. |
| 4675 static const int kReturnOffsetIndex = 0; | 4678 static const int kReturnOffsetIndex = 0; |
| 4676 static const int kReturnHandlerIndex = 1; | 4679 static const int kReturnHandlerIndex = 1; |
| 4677 static const int kReturnEntrySize = 2; | 4680 static const int kReturnEntrySize = 2; |
| 4678 | 4681 |
| 4679 // Encoding of the {handler} field. | 4682 // Encoding of the {handler} field. |
| 4680 class HandlerPredictionField : public BitField<CatchPrediction, 0, 2> {}; | 4683 class HandlerPredictionField : public BitField<CatchPrediction, 0, 3> {}; |
| 4681 class HandlerOffsetField : public BitField<int, 2, 30> {}; | 4684 class HandlerOffsetField : public BitField<int, 3, 29> {}; |
| 4682 }; | 4685 }; |
| 4683 | 4686 |
| 4684 // ByteArray represents fixed sized byte arrays. Used for the relocation info | 4687 // ByteArray represents fixed sized byte arrays. Used for the relocation info |
| 4685 // that is attached to code objects. | 4688 // that is attached to code objects. |
| 4686 class ByteArray: public FixedArrayBase { | 4689 class ByteArray: public FixedArrayBase { |
| 4687 public: | 4690 public: |
| 4688 inline int Size(); | 4691 inline int Size(); |
| 4689 | 4692 |
| 4690 // Setter and getter. | 4693 // Setter and getter. |
| 4691 inline byte get(int index); | 4694 inline byte get(int index); |
| (...skipping 6578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11270 } | 11273 } |
| 11271 return value; | 11274 return value; |
| 11272 } | 11275 } |
| 11273 }; | 11276 }; |
| 11274 | 11277 |
| 11275 | 11278 |
| 11276 } // NOLINT, false-positive due to second-order macros. | 11279 } // NOLINT, false-positive due to second-order macros. |
| 11277 } // NOLINT, false-positive due to second-order macros. | 11280 } // NOLINT, false-positive due to second-order macros. |
| 11278 | 11281 |
| 11279 #endif // V8_OBJECTS_H_ | 11282 #endif // V8_OBJECTS_H_ |
| OLD | NEW |