| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 Address slot_address_; | 55 Address slot_address_; |
| 56 double val_; | 56 double val_; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 | 59 |
| 60 class OptimizedFunctionVisitor BASE_EMBEDDED { | 60 class OptimizedFunctionVisitor BASE_EMBEDDED { |
| 61 public: | 61 public: |
| 62 virtual ~OptimizedFunctionVisitor() {} | 62 virtual ~OptimizedFunctionVisitor() {} |
| 63 | 63 |
| 64 // Function which is called before iteration of any optimized functions | 64 // Function which is called before iteration of any optimized functions |
| 65 // from given native context. | 65 // from given global context. |
| 66 virtual void EnterContext(Context* context) = 0; | 66 virtual void EnterContext(Context* context) = 0; |
| 67 | 67 |
| 68 virtual void VisitFunction(JSFunction* function) = 0; | 68 virtual void VisitFunction(JSFunction* function) = 0; |
| 69 | 69 |
| 70 // Function which is called after iteration of all optimized functions | 70 // Function which is called after iteration of all optimized functions |
| 71 // from given native context. | 71 // from given global context. |
| 72 virtual void LeaveContext(Context* context) = 0; | 72 virtual void LeaveContext(Context* context) = 0; |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 | 75 |
| 76 class Deoptimizer; | 76 class Deoptimizer; |
| 77 | 77 |
| 78 | 78 |
| 79 class DeoptimizerData { | 79 class DeoptimizerData { |
| 80 public: | 80 public: |
| 81 DeoptimizerData(); | 81 DeoptimizerData(); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 Code* optimized_code); | 277 Code* optimized_code); |
| 278 void DeleteFrameDescriptions(); | 278 void DeleteFrameDescriptions(); |
| 279 | 279 |
| 280 void DoComputeOutputFrames(); | 280 void DoComputeOutputFrames(); |
| 281 void DoComputeOsrOutputFrame(); | 281 void DoComputeOsrOutputFrame(); |
| 282 void DoComputeJSFrame(TranslationIterator* iterator, int frame_index); | 282 void DoComputeJSFrame(TranslationIterator* iterator, int frame_index); |
| 283 void DoComputeArgumentsAdaptorFrame(TranslationIterator* iterator, | 283 void DoComputeArgumentsAdaptorFrame(TranslationIterator* iterator, |
| 284 int frame_index); | 284 int frame_index); |
| 285 void DoComputeConstructStubFrame(TranslationIterator* iterator, | 285 void DoComputeConstructStubFrame(TranslationIterator* iterator, |
| 286 int frame_index); | 286 int frame_index); |
| 287 void DoComputeSetterStubFrame(TranslationIterator* iterator, | |
| 288 int frame_index); | |
| 289 void DoTranslateCommand(TranslationIterator* iterator, | 287 void DoTranslateCommand(TranslationIterator* iterator, |
| 290 int frame_index, | 288 int frame_index, |
| 291 unsigned output_offset); | 289 unsigned output_offset); |
| 292 // Translate a command for OSR. Updates the input offset to be used for | 290 // Translate a command for OSR. Updates the input offset to be used for |
| 293 // the next command. Returns false if translation of the command failed | 291 // the next command. Returns false if translation of the command failed |
| 294 // (e.g., a number conversion failed) and may or may not have updated the | 292 // (e.g., a number conversion failed) and may or may not have updated the |
| 295 // input offset. | 293 // input offset. |
| 296 bool DoOsrTranslateCommand(TranslationIterator* iterator, | 294 bool DoOsrTranslateCommand(TranslationIterator* iterator, |
| 297 int* input_offset); | 295 int* input_offset); |
| 298 | 296 |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 int index_; | 552 int index_; |
| 555 }; | 553 }; |
| 556 | 554 |
| 557 | 555 |
| 558 class Translation BASE_EMBEDDED { | 556 class Translation BASE_EMBEDDED { |
| 559 public: | 557 public: |
| 560 enum Opcode { | 558 enum Opcode { |
| 561 BEGIN, | 559 BEGIN, |
| 562 JS_FRAME, | 560 JS_FRAME, |
| 563 CONSTRUCT_STUB_FRAME, | 561 CONSTRUCT_STUB_FRAME, |
| 564 SETTER_STUB_FRAME, | |
| 565 ARGUMENTS_ADAPTOR_FRAME, | 562 ARGUMENTS_ADAPTOR_FRAME, |
| 566 REGISTER, | 563 REGISTER, |
| 567 INT32_REGISTER, | 564 INT32_REGISTER, |
| 568 DOUBLE_REGISTER, | 565 DOUBLE_REGISTER, |
| 569 STACK_SLOT, | 566 STACK_SLOT, |
| 570 INT32_STACK_SLOT, | 567 INT32_STACK_SLOT, |
| 571 DOUBLE_STACK_SLOT, | 568 DOUBLE_STACK_SLOT, |
| 572 LITERAL, | 569 LITERAL, |
| 573 ARGUMENTS_OBJECT, | 570 ARGUMENTS_OBJECT, |
| 574 | 571 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 586 buffer_->Add(frame_count, zone); | 583 buffer_->Add(frame_count, zone); |
| 587 buffer_->Add(jsframe_count, zone); | 584 buffer_->Add(jsframe_count, zone); |
| 588 } | 585 } |
| 589 | 586 |
| 590 int index() const { return index_; } | 587 int index() const { return index_; } |
| 591 | 588 |
| 592 // Commands. | 589 // Commands. |
| 593 void BeginJSFrame(BailoutId node_id, int literal_id, unsigned height); | 590 void BeginJSFrame(BailoutId node_id, int literal_id, unsigned height); |
| 594 void BeginArgumentsAdaptorFrame(int literal_id, unsigned height); | 591 void BeginArgumentsAdaptorFrame(int literal_id, unsigned height); |
| 595 void BeginConstructStubFrame(int literal_id, unsigned height); | 592 void BeginConstructStubFrame(int literal_id, unsigned height); |
| 596 void BeginSetterStubFrame(int literal_id); | |
| 597 void StoreRegister(Register reg); | 593 void StoreRegister(Register reg); |
| 598 void StoreInt32Register(Register reg); | 594 void StoreInt32Register(Register reg); |
| 599 void StoreDoubleRegister(DoubleRegister reg); | 595 void StoreDoubleRegister(DoubleRegister reg); |
| 600 void StoreStackSlot(int index); | 596 void StoreStackSlot(int index); |
| 601 void StoreInt32StackSlot(int index); | 597 void StoreInt32StackSlot(int index); |
| 602 void StoreDoubleStackSlot(int index); | 598 void StoreDoubleStackSlot(int index); |
| 603 void StoreLiteral(int literal_id); | 599 void StoreLiteral(int literal_id); |
| 604 void StoreArgumentsObject(); | 600 void StoreArgumentsObject(); |
| 605 void MarkDuplicate(); | 601 void MarkDuplicate(); |
| 606 | 602 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 Object** expression_stack_; | 789 Object** expression_stack_; |
| 794 int source_position_; | 790 int source_position_; |
| 795 | 791 |
| 796 friend class Deoptimizer; | 792 friend class Deoptimizer; |
| 797 }; | 793 }; |
| 798 #endif | 794 #endif |
| 799 | 795 |
| 800 } } // namespace v8::internal | 796 } } // namespace v8::internal |
| 801 | 797 |
| 802 #endif // V8_DEOPTIMIZER_H_ | 798 #endif // V8_DEOPTIMIZER_H_ |
| OLD | NEW |