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/macro-assembler.h" | 9 #include "src/macro-assembler.h" |
10 | 10 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 kInvalid | 121 kInvalid |
122 }; | 122 }; |
123 | 123 |
124 int GetValueCount(); | 124 int GetValueCount(); |
125 | 125 |
126 Kind kind() const { return kind_; } | 126 Kind kind() const { return kind_; } |
127 BailoutId node_id() const { return node_id_; } | 127 BailoutId node_id() const { return node_id_; } |
128 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } | 128 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } |
129 int height() const { return height_; } | 129 int height() const { return height_; } |
130 | 130 |
| 131 SharedFunctionInfo* raw_shared_info() const { |
| 132 CHECK_NOT_NULL(raw_shared_info_); |
| 133 return raw_shared_info_; |
| 134 } |
| 135 |
131 class iterator { | 136 class iterator { |
132 public: | 137 public: |
133 iterator& operator++() { | 138 iterator& operator++() { |
134 AdvanceIterator(&position_); | 139 AdvanceIterator(&position_); |
135 return *this; | 140 return *this; |
136 } | 141 } |
137 | 142 |
138 iterator operator++(int) { | 143 iterator operator++(int) { |
139 iterator original(position_); | 144 iterator original(position_); |
140 AdvanceIterator(&position_); | 145 AdvanceIterator(&position_); |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 unsigned output_offset, const char* debug_hint_string = nullptr, | 609 unsigned output_offset, const char* debug_hint_string = nullptr, |
605 Address output_address_for_materialization = nullptr); | 610 Address output_address_for_materialization = nullptr); |
606 void WriteValueToOutput(Object* value, int input_index, int frame_index, | 611 void WriteValueToOutput(Object* value, int input_index, int frame_index, |
607 unsigned output_offset, | 612 unsigned output_offset, |
608 const char* debug_hint_string); | 613 const char* debug_hint_string); |
609 void DebugPrintOutputSlot(intptr_t value, int frame_index, | 614 void DebugPrintOutputSlot(intptr_t value, int frame_index, |
610 unsigned output_offset, | 615 unsigned output_offset, |
611 const char* debug_hint_string); | 616 const char* debug_hint_string); |
612 | 617 |
613 unsigned ComputeInputFrameSize() const; | 618 unsigned ComputeInputFrameSize() const; |
614 unsigned ComputeJavascriptFixedSize(JSFunction* function) const; | 619 static unsigned ComputeJavascriptFixedSize(SharedFunctionInfo* shared); |
615 unsigned ComputeInterpretedFixedSize(JSFunction* function) const; | 620 static unsigned ComputeInterpretedFixedSize(SharedFunctionInfo* shared); |
616 | 621 |
617 unsigned ComputeIncomingArgumentSize(JSFunction* function) const; | 622 static unsigned ComputeIncomingArgumentSize(SharedFunctionInfo* shared); |
618 static unsigned ComputeOutgoingArgumentSize(Code* code, unsigned bailout_id); | 623 static unsigned ComputeOutgoingArgumentSize(Code* code, unsigned bailout_id); |
619 | 624 |
620 Object* ComputeLiteral(int index) const; | 625 Object* ComputeLiteral(int index) const; |
621 | 626 |
622 static void GenerateDeoptimizationEntries( | 627 static void GenerateDeoptimizationEntries( |
623 MacroAssembler* masm, int count, BailoutType type); | 628 MacroAssembler* masm, int count, BailoutType type); |
624 | 629 |
625 // Marks all the code in the given context for deoptimization. | 630 // Marks all the code in the given context for deoptimization. |
626 static void MarkAllCodeForContext(Context* native_context); | 631 static void MarkAllCodeForContext(Context* native_context); |
627 | 632 |
(...skipping 21 matching lines...) Expand all Loading... |
649 // address and the number of parameters for a stub failure trampoline. | 654 // address and the number of parameters for a stub failure trampoline. |
650 void SetPlatformCompiledStubRegisters(FrameDescription* output_frame, | 655 void SetPlatformCompiledStubRegisters(FrameDescription* output_frame, |
651 CodeStubDescriptor* desc); | 656 CodeStubDescriptor* desc); |
652 | 657 |
653 // Fill the given output frame's double registers with the original values | 658 // Fill the given output frame's double registers with the original values |
654 // from the input frame's double registers. | 659 // from the input frame's double registers. |
655 void CopyDoubleRegisters(FrameDescription* output_frame); | 660 void CopyDoubleRegisters(FrameDescription* output_frame); |
656 | 661 |
657 // Determines whether the input frame contains alignment padding by looking | 662 // Determines whether the input frame contains alignment padding by looking |
658 // at the dynamic alignment state slot inside the frame. | 663 // at the dynamic alignment state slot inside the frame. |
659 bool HasAlignmentPadding(JSFunction* function); | 664 bool HasAlignmentPadding(SharedFunctionInfo* shared); |
660 | 665 |
661 Isolate* isolate_; | 666 Isolate* isolate_; |
662 JSFunction* function_; | 667 JSFunction* function_; |
663 Code* compiled_code_; | 668 Code* compiled_code_; |
664 unsigned bailout_id_; | 669 unsigned bailout_id_; |
665 BailoutType bailout_type_; | 670 BailoutType bailout_type_; |
666 Address from_; | 671 Address from_; |
667 int fp_to_sp_delta_; | 672 int fp_to_sp_delta_; |
668 int has_alignment_padding_; | 673 int has_alignment_padding_; |
669 | 674 |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1135 Object** expression_stack_; | 1140 Object** expression_stack_; |
1136 int source_position_; | 1141 int source_position_; |
1137 | 1142 |
1138 friend class Deoptimizer; | 1143 friend class Deoptimizer; |
1139 }; | 1144 }; |
1140 | 1145 |
1141 } // namespace internal | 1146 } // namespace internal |
1142 } // namespace v8 | 1147 } // namespace v8 |
1143 | 1148 |
1144 #endif // V8_DEOPTIMIZER_H_ | 1149 #endif // V8_DEOPTIMIZER_H_ |
OLD | NEW |