| OLD | NEW |
| 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_DEOPTIMIZER_H_ | 5 #ifndef V8_DEOPTIMIZER_H_ |
| 6 #define V8_DEOPTIMIZER_H_ | 6 #define V8_DEOPTIMIZER_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 void Skip(int n) { | 748 void Skip(int n) { |
| 749 for (int i = 0; i < n; i++) Next(); | 749 for (int i = 0; i < n; i++) Next(); |
| 750 } | 750 } |
| 751 | 751 |
| 752 private: | 752 private: |
| 753 ByteArray* buffer_; | 753 ByteArray* buffer_; |
| 754 int index_; | 754 int index_; |
| 755 }; | 755 }; |
| 756 | 756 |
| 757 | 757 |
| 758 #define TRANSLATION_OPCODE_LIST(V) \ | 758 #define TRANSLATION_OPCODE_LIST(V) \ |
| 759 V(BEGIN) \ | 759 V(BEGIN) \ |
| 760 V(JS_FRAME) \ | 760 V(JS_FRAME) \ |
| 761 V(CONSTRUCT_STUB_FRAME) \ | 761 V(CONSTRUCT_STUB_FRAME) \ |
| 762 V(GETTER_STUB_FRAME) \ | 762 V(GETTER_STUB_FRAME) \ |
| 763 V(SETTER_STUB_FRAME) \ | 763 V(SETTER_STUB_FRAME) \ |
| 764 V(ARGUMENTS_ADAPTOR_FRAME) \ | 764 V(ARGUMENTS_ADAPTOR_FRAME) \ |
| 765 V(COMPILED_STUB_FRAME) \ | 765 V(COMPILED_STUB_FRAME) \ |
| 766 V(DUPLICATED_OBJECT) \ | 766 V(DUPLICATED_OBJECT) \ |
| 767 V(ARGUMENTS_OBJECT) \ | 767 V(ARGUMENTS_OBJECT) \ |
| 768 V(CAPTURED_OBJECT) \ | 768 V(CAPTURED_OBJECT) \ |
| 769 V(REGISTER) \ | 769 V(REGISTER) \ |
| 770 V(INT32_REGISTER) \ | 770 V(INT32_REGISTER) \ |
| 771 V(UINT32_REGISTER) \ | 771 V(UINT32_REGISTER) \ |
| 772 V(DOUBLE_REGISTER) \ | 772 V(BOOL_REGISTER) \ |
| 773 V(STACK_SLOT) \ | 773 V(DOUBLE_REGISTER) \ |
| 774 V(INT32_STACK_SLOT) \ | 774 V(STACK_SLOT) \ |
| 775 V(UINT32_STACK_SLOT) \ | 775 V(INT32_STACK_SLOT) \ |
| 776 V(DOUBLE_STACK_SLOT) \ | 776 V(UINT32_STACK_SLOT) \ |
| 777 V(BOOL_STACK_SLOT) \ |
| 778 V(DOUBLE_STACK_SLOT) \ |
| 777 V(LITERAL) | 779 V(LITERAL) |
| 778 | 780 |
| 779 | 781 |
| 780 class Translation BASE_EMBEDDED { | 782 class Translation BASE_EMBEDDED { |
| 781 public: | 783 public: |
| 782 #define DECLARE_TRANSLATION_OPCODE_ENUM(item) item, | 784 #define DECLARE_TRANSLATION_OPCODE_ENUM(item) item, |
| 783 enum Opcode { | 785 enum Opcode { |
| 784 TRANSLATION_OPCODE_LIST(DECLARE_TRANSLATION_OPCODE_ENUM) | 786 TRANSLATION_OPCODE_LIST(DECLARE_TRANSLATION_OPCODE_ENUM) |
| 785 LAST = LITERAL | 787 LAST = LITERAL |
| 786 }; | 788 }; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 804 void BeginArgumentsAdaptorFrame(int literal_id, unsigned height); | 806 void BeginArgumentsAdaptorFrame(int literal_id, unsigned height); |
| 805 void BeginConstructStubFrame(int literal_id, unsigned height); | 807 void BeginConstructStubFrame(int literal_id, unsigned height); |
| 806 void BeginGetterStubFrame(int literal_id); | 808 void BeginGetterStubFrame(int literal_id); |
| 807 void BeginSetterStubFrame(int literal_id); | 809 void BeginSetterStubFrame(int literal_id); |
| 808 void BeginArgumentsObject(int args_length); | 810 void BeginArgumentsObject(int args_length); |
| 809 void BeginCapturedObject(int length); | 811 void BeginCapturedObject(int length); |
| 810 void DuplicateObject(int object_index); | 812 void DuplicateObject(int object_index); |
| 811 void StoreRegister(Register reg); | 813 void StoreRegister(Register reg); |
| 812 void StoreInt32Register(Register reg); | 814 void StoreInt32Register(Register reg); |
| 813 void StoreUint32Register(Register reg); | 815 void StoreUint32Register(Register reg); |
| 816 void StoreBoolRegister(Register reg); |
| 814 void StoreDoubleRegister(DoubleRegister reg); | 817 void StoreDoubleRegister(DoubleRegister reg); |
| 815 void StoreStackSlot(int index); | 818 void StoreStackSlot(int index); |
| 816 void StoreInt32StackSlot(int index); | 819 void StoreInt32StackSlot(int index); |
| 817 void StoreUint32StackSlot(int index); | 820 void StoreUint32StackSlot(int index); |
| 821 void StoreBoolStackSlot(int index); |
| 818 void StoreDoubleStackSlot(int index); | 822 void StoreDoubleStackSlot(int index); |
| 819 void StoreLiteral(int literal_id); | 823 void StoreLiteral(int literal_id); |
| 820 void StoreArgumentsObject(bool args_known, int args_index, int args_length); | 824 void StoreArgumentsObject(bool args_known, int args_index, int args_length); |
| 821 | 825 |
| 822 Zone* zone() const { return zone_; } | 826 Zone* zone() const { return zone_; } |
| 823 | 827 |
| 824 static int NumberOfOperandsFor(Opcode opcode); | 828 static int NumberOfOperandsFor(Opcode opcode); |
| 825 | 829 |
| 826 #if defined(OBJECT_PRINT) || defined(ENABLE_DISASSEMBLER) | 830 #if defined(OBJECT_PRINT) || defined(ENABLE_DISASSEMBLER) |
| 827 static const char* StringFor(Opcode opcode); | 831 static const char* StringFor(Opcode opcode); |
| 828 #endif | 832 #endif |
| 829 | 833 |
| 830 // A literal id which refers to the JSFunction itself. | 834 // A literal id which refers to the JSFunction itself. |
| 831 static const int kSelfLiteralId = -239; | 835 static const int kSelfLiteralId = -239; |
| 832 | 836 |
| 833 private: | 837 private: |
| 834 TranslationBuffer* buffer_; | 838 TranslationBuffer* buffer_; |
| 835 int index_; | 839 int index_; |
| 836 Zone* zone_; | 840 Zone* zone_; |
| 837 }; | 841 }; |
| 838 | 842 |
| 839 | 843 |
| 840 class SlotRef BASE_EMBEDDED { | 844 class SlotRef BASE_EMBEDDED { |
| 841 public: | 845 public: |
| 842 enum SlotRepresentation { | 846 enum SlotRepresentation { |
| 843 UNKNOWN, | 847 UNKNOWN, |
| 844 TAGGED, | 848 TAGGED, |
| 845 INT32, | 849 INT32, |
| 846 UINT32, | 850 UINT32, |
| 851 BOOLBIT, |
| 847 DOUBLE, | 852 DOUBLE, |
| 848 LITERAL, | 853 LITERAL, |
| 849 DEFERRED_OBJECT, // Object captured by the escape analysis. | 854 DEFERRED_OBJECT, // Object captured by the escape analysis. |
| 850 // The number of nested objects can be obtained | 855 // The number of nested objects can be obtained |
| 851 // with the DeferredObjectLength() method | 856 // with the DeferredObjectLength() method |
| 852 // (the SlotRefs of the nested objects follow | 857 // (the SlotRefs of the nested objects follow |
| 853 // this SlotRef in the depth-first order.) | 858 // this SlotRef in the depth-first order.) |
| 854 DUPLICATE_OBJECT, // Duplicated object of a deferred object. | 859 DUPLICATE_OBJECT, // Duplicated object of a deferred object. |
| 855 ARGUMENTS_OBJECT // Arguments object - only used to keep indexing | 860 ARGUMENTS_OBJECT // Arguments object - only used to keep indexing |
| 856 // in sync, it should not be materialized. | 861 // in sync, it should not be materialized. |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 Object** parameters_; | 1054 Object** parameters_; |
| 1050 Object** expression_stack_; | 1055 Object** expression_stack_; |
| 1051 int source_position_; | 1056 int source_position_; |
| 1052 | 1057 |
| 1053 friend class Deoptimizer; | 1058 friend class Deoptimizer; |
| 1054 }; | 1059 }; |
| 1055 | 1060 |
| 1056 } } // namespace v8::internal | 1061 } } // namespace v8::internal |
| 1057 | 1062 |
| 1058 #endif // V8_DEOPTIMIZER_H_ | 1063 #endif // V8_DEOPTIMIZER_H_ |
| OLD | NEW |