| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 virtual void LeaveContext(Context* context) = 0; | 119 virtual void LeaveContext(Context* context) = 0; |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 | 122 |
| 123 class Deoptimizer : public Malloced { | 123 class Deoptimizer : public Malloced { |
| 124 public: | 124 public: |
| 125 enum BailoutType { | 125 enum BailoutType { |
| 126 EAGER, | 126 EAGER, |
| 127 LAZY, | 127 LAZY, |
| 128 SOFT, | 128 SOFT, |
| 129 OSR, | |
| 130 // This last bailout type is not really a bailout, but used by the | 129 // This last bailout type is not really a bailout, but used by the |
| 131 // debugger to deoptimize stack frames to allow inspection. | 130 // debugger to deoptimize stack frames to allow inspection. |
| 132 DEBUGGER | 131 DEBUGGER |
| 133 }; | 132 }; |
| 134 | 133 |
| 135 enum InterruptPatchState { | 134 enum InterruptPatchState { |
| 136 NOT_PATCHED, | 135 NOT_PATCHED, |
| 137 PATCHED_FOR_OSR | 136 PATCHED_FOR_OSR |
| 138 }; | 137 }; |
| 139 | 138 |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 BailoutType type, | 348 BailoutType type, |
| 350 unsigned bailout_id, | 349 unsigned bailout_id, |
| 351 Address from, | 350 Address from, |
| 352 int fp_to_sp_delta, | 351 int fp_to_sp_delta, |
| 353 Code* optimized_code); | 352 Code* optimized_code); |
| 354 Code* FindOptimizedCode(JSFunction* function, Code* optimized_code); | 353 Code* FindOptimizedCode(JSFunction* function, Code* optimized_code); |
| 355 void PrintFunctionName(); | 354 void PrintFunctionName(); |
| 356 void DeleteFrameDescriptions(); | 355 void DeleteFrameDescriptions(); |
| 357 | 356 |
| 358 void DoComputeOutputFrames(); | 357 void DoComputeOutputFrames(); |
| 359 void DoComputeOsrOutputFrame(); | |
| 360 void DoComputeJSFrame(TranslationIterator* iterator, int frame_index); | 358 void DoComputeJSFrame(TranslationIterator* iterator, int frame_index); |
| 361 void DoComputeArgumentsAdaptorFrame(TranslationIterator* iterator, | 359 void DoComputeArgumentsAdaptorFrame(TranslationIterator* iterator, |
| 362 int frame_index); | 360 int frame_index); |
| 363 void DoComputeConstructStubFrame(TranslationIterator* iterator, | 361 void DoComputeConstructStubFrame(TranslationIterator* iterator, |
| 364 int frame_index); | 362 int frame_index); |
| 365 void DoComputeAccessorStubFrame(TranslationIterator* iterator, | 363 void DoComputeAccessorStubFrame(TranslationIterator* iterator, |
| 366 int frame_index, | 364 int frame_index, |
| 367 bool is_setter_stub_frame); | 365 bool is_setter_stub_frame); |
| 368 void DoComputeCompiledStubFrame(TranslationIterator* iterator, | 366 void DoComputeCompiledStubFrame(TranslationIterator* iterator, |
| 369 int frame_index); | 367 int frame_index); |
| 370 | 368 |
| 371 void DoTranslateObject(TranslationIterator* iterator, | 369 void DoTranslateObject(TranslationIterator* iterator, |
| 372 int object_index, | 370 int object_index, |
| 373 int field_index); | 371 int field_index); |
| 374 | 372 |
| 375 enum DeoptimizerTranslatedValueType { | 373 enum DeoptimizerTranslatedValueType { |
| 376 TRANSLATED_VALUE_IS_NATIVE, | 374 TRANSLATED_VALUE_IS_NATIVE, |
| 377 TRANSLATED_VALUE_IS_TAGGED | 375 TRANSLATED_VALUE_IS_TAGGED |
| 378 }; | 376 }; |
| 379 | 377 |
| 380 void DoTranslateCommand(TranslationIterator* iterator, | 378 void DoTranslateCommand(TranslationIterator* iterator, |
| 381 int frame_index, | 379 int frame_index, |
| 382 unsigned output_offset, | 380 unsigned output_offset, |
| 383 DeoptimizerTranslatedValueType value_type = TRANSLATED_VALUE_IS_TAGGED); | 381 DeoptimizerTranslatedValueType value_type = TRANSLATED_VALUE_IS_TAGGED); |
| 384 | 382 |
| 385 // Translate a command for OSR. Updates the input offset to be used for | |
| 386 // the next command. Returns false if translation of the command failed | |
| 387 // (e.g., a number conversion failed) and may or may not have updated the | |
| 388 // input offset. | |
| 389 bool DoOsrTranslateCommand(TranslationIterator* iterator, | |
| 390 int* input_offset); | |
| 391 | |
| 392 unsigned ComputeInputFrameSize() const; | 383 unsigned ComputeInputFrameSize() const; |
| 393 unsigned ComputeFixedSize(JSFunction* function) const; | 384 unsigned ComputeFixedSize(JSFunction* function) const; |
| 394 | 385 |
| 395 unsigned ComputeIncomingArgumentSize(JSFunction* function) const; | 386 unsigned ComputeIncomingArgumentSize(JSFunction* function) const; |
| 396 unsigned ComputeOutgoingArgumentSize() const; | 387 unsigned ComputeOutgoingArgumentSize() const; |
| 397 | 388 |
| 398 Object* ComputeLiteral(int index) const; | 389 Object* ComputeLiteral(int index) const; |
| 399 | 390 |
| 400 void AddObjectStart(intptr_t slot_address, int argc, bool is_arguments); | 391 void AddObjectStart(intptr_t slot_address, int argc, bool is_arguments); |
| 401 void AddObjectDuplication(intptr_t slot, int object_index); | 392 void AddObjectDuplication(intptr_t slot, int object_index); |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 Object** expression_stack_; | 953 Object** expression_stack_; |
| 963 int source_position_; | 954 int source_position_; |
| 964 | 955 |
| 965 friend class Deoptimizer; | 956 friend class Deoptimizer; |
| 966 }; | 957 }; |
| 967 #endif | 958 #endif |
| 968 | 959 |
| 969 } } // namespace v8::internal | 960 } } // namespace v8::internal |
| 970 | 961 |
| 971 #endif // V8_DEOPTIMIZER_H_ | 962 #endif // V8_DEOPTIMIZER_H_ |
| OLD | NEW |