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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 void DoComputeArgumentsAdaptorFrame(TranslatedFrame* translated_frame, | 564 void DoComputeArgumentsAdaptorFrame(TranslatedFrame* translated_frame, |
562 int frame_index); | 565 int frame_index); |
563 void DoComputeTailCallerFrame(TranslatedFrame* translated_frame, | 566 void DoComputeTailCallerFrame(TranslatedFrame* translated_frame, |
564 int frame_index); | 567 int frame_index); |
565 void DoComputeConstructStubFrame(TranslatedFrame* translated_frame, | 568 void DoComputeConstructStubFrame(TranslatedFrame* translated_frame, |
566 int frame_index); | 569 int frame_index); |
567 void DoComputeAccessorStubFrame(TranslatedFrame* translated_frame, | 570 void DoComputeAccessorStubFrame(TranslatedFrame* translated_frame, |
568 int frame_index, bool is_setter_stub_frame); | 571 int frame_index, bool is_setter_stub_frame); |
569 void DoComputeCompiledStubFrame(TranslatedFrame* translated_frame, | 572 void DoComputeCompiledStubFrame(TranslatedFrame* translated_frame, |
570 int frame_index); | 573 int frame_index); |
| 574 void DoComputeBuiltinContinuation(TranslatedFrame* translated_frame, |
| 575 int frame_index); |
571 | 576 |
572 void WriteTranslatedValueToOutput( | 577 void WriteTranslatedValueToOutput( |
573 TranslatedFrame::iterator* iterator, int* input_index, int frame_index, | 578 TranslatedFrame::iterator* iterator, int* input_index, int frame_index, |
574 unsigned output_offset, const char* debug_hint_string = nullptr, | 579 unsigned output_offset, const char* debug_hint_string = nullptr, |
575 Address output_address_for_materialization = nullptr); | 580 Address output_address_for_materialization = nullptr); |
576 void WriteValueToOutput(Object* value, int input_index, int frame_index, | 581 void WriteValueToOutput(Object* value, int input_index, int frame_index, |
577 unsigned output_offset, | 582 unsigned output_offset, |
578 const char* debug_hint_string); | 583 const char* debug_hint_string); |
579 void DebugPrintOutputSlot(intptr_t value, int frame_index, | 584 void DebugPrintOutputSlot(intptr_t value, int frame_index, |
580 unsigned output_offset, | 585 unsigned output_offset, |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 | 923 |
919 private: | 924 private: |
920 ByteArray* buffer_; | 925 ByteArray* buffer_; |
921 int index_; | 926 int index_; |
922 }; | 927 }; |
923 | 928 |
924 #define TRANSLATION_OPCODE_LIST(V) \ | 929 #define TRANSLATION_OPCODE_LIST(V) \ |
925 V(BEGIN) \ | 930 V(BEGIN) \ |
926 V(JS_FRAME) \ | 931 V(JS_FRAME) \ |
927 V(INTERPRETED_FRAME) \ | 932 V(INTERPRETED_FRAME) \ |
| 933 V(BUILTIN_CONTINUATION_FRAME) \ |
928 V(CONSTRUCT_STUB_FRAME) \ | 934 V(CONSTRUCT_STUB_FRAME) \ |
929 V(GETTER_STUB_FRAME) \ | 935 V(GETTER_STUB_FRAME) \ |
930 V(SETTER_STUB_FRAME) \ | 936 V(SETTER_STUB_FRAME) \ |
931 V(ARGUMENTS_ADAPTOR_FRAME) \ | 937 V(ARGUMENTS_ADAPTOR_FRAME) \ |
932 V(TAIL_CALLER_FRAME) \ | 938 V(TAIL_CALLER_FRAME) \ |
933 V(COMPILED_STUB_FRAME) \ | 939 V(COMPILED_STUB_FRAME) \ |
934 V(DUPLICATED_OBJECT) \ | 940 V(DUPLICATED_OBJECT) \ |
935 V(ARGUMENTS_OBJECT) \ | 941 V(ARGUMENTS_OBJECT) \ |
936 V(ARGUMENTS_ELEMENTS) \ | 942 V(ARGUMENTS_ELEMENTS) \ |
937 V(ARGUMENTS_LENGTH) \ | 943 V(ARGUMENTS_LENGTH) \ |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 | 979 |
974 // Commands. | 980 // Commands. |
975 void BeginJSFrame(BailoutId node_id, int literal_id, unsigned height); | 981 void BeginJSFrame(BailoutId node_id, int literal_id, unsigned height); |
976 void BeginInterpretedFrame(BailoutId bytecode_offset, int literal_id, | 982 void BeginInterpretedFrame(BailoutId bytecode_offset, int literal_id, |
977 unsigned height); | 983 unsigned height); |
978 void BeginCompiledStubFrame(int height); | 984 void BeginCompiledStubFrame(int height); |
979 void BeginArgumentsAdaptorFrame(int literal_id, unsigned height); | 985 void BeginArgumentsAdaptorFrame(int literal_id, unsigned height); |
980 void BeginTailCallerFrame(int literal_id); | 986 void BeginTailCallerFrame(int literal_id); |
981 void BeginConstructStubFrame(BailoutId bailout_id, int literal_id, | 987 void BeginConstructStubFrame(BailoutId bailout_id, int literal_id, |
982 unsigned height); | 988 unsigned height); |
| 989 void BeginBuiltinContinuationFrame(BailoutId bailout_id, int literal_id, |
| 990 unsigned height); |
983 void BeginGetterStubFrame(int literal_id); | 991 void BeginGetterStubFrame(int literal_id); |
984 void BeginSetterStubFrame(int literal_id); | 992 void BeginSetterStubFrame(int literal_id); |
985 void BeginArgumentsObject(int args_length); | 993 void BeginArgumentsObject(int args_length); |
986 void ArgumentsElements(bool is_rest); | 994 void ArgumentsElements(bool is_rest); |
987 void ArgumentsLength(bool is_rest); | 995 void ArgumentsLength(bool is_rest); |
988 void BeginCapturedObject(int length); | 996 void BeginCapturedObject(int length); |
989 void DuplicateObject(int object_index); | 997 void DuplicateObject(int object_index); |
990 void StoreRegister(Register reg); | 998 void StoreRegister(Register reg); |
991 void StoreInt32Register(Register reg); | 999 void StoreInt32Register(Register reg); |
992 void StoreUint32Register(Register reg); | 1000 void StoreUint32Register(Register reg); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 std::vector<Handle<Object> > expression_stack_; | 1112 std::vector<Handle<Object> > expression_stack_; |
1105 int source_position_; | 1113 int source_position_; |
1106 | 1114 |
1107 friend class Deoptimizer; | 1115 friend class Deoptimizer; |
1108 }; | 1116 }; |
1109 | 1117 |
1110 } // namespace internal | 1118 } // namespace internal |
1111 } // namespace v8 | 1119 } // namespace v8 |
1112 | 1120 |
1113 #endif // V8_DEOPTIMIZER_H_ | 1121 #endif // V8_DEOPTIMIZER_H_ |
OLD | NEW |