| 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/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/deoptimize-reason.h" | 9 #include "src/deoptimize-reason.h" |
| 10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 public: | 152 public: |
| 153 enum Kind { | 153 enum Kind { |
| 154 kFunction, | 154 kFunction, |
| 155 kInterpretedFunction, | 155 kInterpretedFunction, |
| 156 kGetter, | 156 kGetter, |
| 157 kSetter, | 157 kSetter, |
| 158 kTailCallerFunction, | 158 kTailCallerFunction, |
| 159 kArgumentsAdaptor, | 159 kArgumentsAdaptor, |
| 160 kConstructStub, | 160 kConstructStub, |
| 161 kCompiledStub, | 161 kCompiledStub, |
| 162 kBuiltinContinuation, |
| 162 kInvalid | 163 kInvalid |
| 163 }; | 164 }; |
| 164 | 165 |
| 165 int GetValueCount(); | 166 int GetValueCount(); |
| 166 | 167 |
| 167 Kind kind() const { return kind_; } | 168 Kind kind() const { return kind_; } |
| 168 BailoutId node_id() const { return node_id_; } | 169 BailoutId node_id() const { return node_id_; } |
| 169 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } | 170 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } |
| 170 int height() const { return height_; } | 171 int height() const { return height_; } |
| 171 | 172 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 SharedFunctionInfo* shared_info, | 224 SharedFunctionInfo* shared_info, |
| 224 int height); | 225 int height); |
| 225 static TranslatedFrame AccessorFrame(Kind kind, | 226 static TranslatedFrame AccessorFrame(Kind kind, |
| 226 SharedFunctionInfo* shared_info); | 227 SharedFunctionInfo* shared_info); |
| 227 static TranslatedFrame ArgumentsAdaptorFrame(SharedFunctionInfo* shared_info, | 228 static TranslatedFrame ArgumentsAdaptorFrame(SharedFunctionInfo* shared_info, |
| 228 int height); | 229 int height); |
| 229 static TranslatedFrame TailCallerFrame(SharedFunctionInfo* shared_info); | 230 static TranslatedFrame TailCallerFrame(SharedFunctionInfo* shared_info); |
| 230 static TranslatedFrame ConstructStubFrame(BailoutId bailout_id, | 231 static TranslatedFrame ConstructStubFrame(BailoutId bailout_id, |
| 231 SharedFunctionInfo* shared_info, | 232 SharedFunctionInfo* shared_info, |
| 232 int height); | 233 int height); |
| 234 static TranslatedFrame BuiltinContinuationFrame( |
| 235 BailoutId bailout_id, SharedFunctionInfo* shared_info, int height); |
| 233 static TranslatedFrame CompiledStubFrame(int height, Isolate* isolate) { | 236 static TranslatedFrame CompiledStubFrame(int height, Isolate* isolate) { |
| 234 return TranslatedFrame(kCompiledStub, isolate, nullptr, height); | 237 return TranslatedFrame(kCompiledStub, isolate, nullptr, height); |
| 235 } | 238 } |
| 236 static TranslatedFrame InvalidFrame() { | 239 static TranslatedFrame InvalidFrame() { |
| 237 return TranslatedFrame(kInvalid, nullptr); | 240 return TranslatedFrame(kInvalid, nullptr); |
| 238 } | 241 } |
| 239 | 242 |
| 240 static void AdvanceIterator(std::deque<TranslatedValue>::iterator* iter); | 243 static void AdvanceIterator(std::deque<TranslatedValue>::iterator* iter); |
| 241 | 244 |
| 242 TranslatedFrame(Kind kind, Isolate* isolate, | 245 TranslatedFrame(Kind kind, Isolate* isolate, |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 void DoComputeArgumentsAdaptorFrame(TranslatedFrame* translated_frame, | 565 void DoComputeArgumentsAdaptorFrame(TranslatedFrame* translated_frame, |
| 563 int frame_index); | 566 int frame_index); |
| 564 void DoComputeTailCallerFrame(TranslatedFrame* translated_frame, | 567 void DoComputeTailCallerFrame(TranslatedFrame* translated_frame, |
| 565 int frame_index); | 568 int frame_index); |
| 566 void DoComputeConstructStubFrame(TranslatedFrame* translated_frame, | 569 void DoComputeConstructStubFrame(TranslatedFrame* translated_frame, |
| 567 int frame_index); | 570 int frame_index); |
| 568 void DoComputeAccessorStubFrame(TranslatedFrame* translated_frame, | 571 void DoComputeAccessorStubFrame(TranslatedFrame* translated_frame, |
| 569 int frame_index, bool is_setter_stub_frame); | 572 int frame_index, bool is_setter_stub_frame); |
| 570 void DoComputeCompiledStubFrame(TranslatedFrame* translated_frame, | 573 void DoComputeCompiledStubFrame(TranslatedFrame* translated_frame, |
| 571 int frame_index); | 574 int frame_index); |
| 575 void DoComputeBuiltinContinuation(TranslatedFrame* translated_frame, |
| 576 int frame_index); |
| 572 | 577 |
| 573 void WriteTranslatedValueToOutput( | 578 void WriteTranslatedValueToOutput( |
| 574 TranslatedFrame::iterator* iterator, int* input_index, int frame_index, | 579 TranslatedFrame::iterator* iterator, int* input_index, int frame_index, |
| 575 unsigned output_offset, const char* debug_hint_string = nullptr, | 580 unsigned output_offset, const char* debug_hint_string = nullptr, |
| 576 Address output_address_for_materialization = nullptr); | 581 Address output_address_for_materialization = nullptr); |
| 577 void WriteValueToOutput(Object* value, int input_index, int frame_index, | 582 void WriteValueToOutput(Object* value, int input_index, int frame_index, |
| 578 unsigned output_offset, | 583 unsigned output_offset, |
| 579 const char* debug_hint_string); | 584 const char* debug_hint_string); |
| 580 void DebugPrintOutputSlot(intptr_t value, int frame_index, | 585 void DebugPrintOutputSlot(intptr_t value, int frame_index, |
| 581 unsigned output_offset, | 586 unsigned output_offset, |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 | 924 |
| 920 private: | 925 private: |
| 921 ByteArray* buffer_; | 926 ByteArray* buffer_; |
| 922 int index_; | 927 int index_; |
| 923 }; | 928 }; |
| 924 | 929 |
| 925 #define TRANSLATION_OPCODE_LIST(V) \ | 930 #define TRANSLATION_OPCODE_LIST(V) \ |
| 926 V(BEGIN) \ | 931 V(BEGIN) \ |
| 927 V(JS_FRAME) \ | 932 V(JS_FRAME) \ |
| 928 V(INTERPRETED_FRAME) \ | 933 V(INTERPRETED_FRAME) \ |
| 934 V(BUILTIN_CONTINUATION_FRAME) \ |
| 929 V(CONSTRUCT_STUB_FRAME) \ | 935 V(CONSTRUCT_STUB_FRAME) \ |
| 930 V(GETTER_STUB_FRAME) \ | 936 V(GETTER_STUB_FRAME) \ |
| 931 V(SETTER_STUB_FRAME) \ | 937 V(SETTER_STUB_FRAME) \ |
| 932 V(ARGUMENTS_ADAPTOR_FRAME) \ | 938 V(ARGUMENTS_ADAPTOR_FRAME) \ |
| 933 V(TAIL_CALLER_FRAME) \ | 939 V(TAIL_CALLER_FRAME) \ |
| 934 V(COMPILED_STUB_FRAME) \ | 940 V(COMPILED_STUB_FRAME) \ |
| 935 V(DUPLICATED_OBJECT) \ | 941 V(DUPLICATED_OBJECT) \ |
| 936 V(ARGUMENTS_OBJECT) \ | 942 V(ARGUMENTS_OBJECT) \ |
| 937 V(ARGUMENTS_ELEMENTS) \ | 943 V(ARGUMENTS_ELEMENTS) \ |
| 938 V(ARGUMENTS_LENGTH) \ | 944 V(ARGUMENTS_LENGTH) \ |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 | 980 |
| 975 // Commands. | 981 // Commands. |
| 976 void BeginJSFrame(BailoutId node_id, int literal_id, unsigned height); | 982 void BeginJSFrame(BailoutId node_id, int literal_id, unsigned height); |
| 977 void BeginInterpretedFrame(BailoutId bytecode_offset, int literal_id, | 983 void BeginInterpretedFrame(BailoutId bytecode_offset, int literal_id, |
| 978 unsigned height); | 984 unsigned height); |
| 979 void BeginCompiledStubFrame(int height); | 985 void BeginCompiledStubFrame(int height); |
| 980 void BeginArgumentsAdaptorFrame(int literal_id, unsigned height); | 986 void BeginArgumentsAdaptorFrame(int literal_id, unsigned height); |
| 981 void BeginTailCallerFrame(int literal_id); | 987 void BeginTailCallerFrame(int literal_id); |
| 982 void BeginConstructStubFrame(BailoutId bailout_id, int literal_id, | 988 void BeginConstructStubFrame(BailoutId bailout_id, int literal_id, |
| 983 unsigned height); | 989 unsigned height); |
| 990 void BeginBuiltinContinuationFrame(BailoutId bailout_id, int literal_id, |
| 991 unsigned height); |
| 984 void BeginGetterStubFrame(int literal_id); | 992 void BeginGetterStubFrame(int literal_id); |
| 985 void BeginSetterStubFrame(int literal_id); | 993 void BeginSetterStubFrame(int literal_id); |
| 986 void BeginArgumentsObject(int args_length); | 994 void BeginArgumentsObject(int args_length); |
| 987 void ArgumentsElements(bool is_rest); | 995 void ArgumentsElements(bool is_rest); |
| 988 void ArgumentsLength(bool is_rest); | 996 void ArgumentsLength(bool is_rest); |
| 989 void BeginCapturedObject(int length); | 997 void BeginCapturedObject(int length); |
| 990 void DuplicateObject(int object_index); | 998 void DuplicateObject(int object_index); |
| 991 void StoreRegister(Register reg); | 999 void StoreRegister(Register reg); |
| 992 void StoreInt32Register(Register reg); | 1000 void StoreInt32Register(Register reg); |
| 993 void StoreUint32Register(Register reg); | 1001 void StoreUint32Register(Register reg); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1105 std::vector<Handle<Object> > expression_stack_; | 1113 std::vector<Handle<Object> > expression_stack_; |
| 1106 int source_position_; | 1114 int source_position_; |
| 1107 | 1115 |
| 1108 friend class Deoptimizer; | 1116 friend class Deoptimizer; |
| 1109 }; | 1117 }; |
| 1110 | 1118 |
| 1111 } // namespace internal | 1119 } // namespace internal |
| 1112 } // namespace v8 | 1120 } // namespace v8 |
| 1113 | 1121 |
| 1114 #endif // V8_DEOPTIMIZER_H_ | 1122 #endif // V8_DEOPTIMIZER_H_ |
| OLD | NEW |