OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 class DeoptimizerData { | 79 class DeoptimizerData { |
80 public: | 80 public: |
81 DeoptimizerData(); | 81 DeoptimizerData(); |
82 ~DeoptimizerData(); | 82 ~DeoptimizerData(); |
83 | 83 |
84 #ifdef ENABLE_DEBUGGER_SUPPORT | 84 #ifdef ENABLE_DEBUGGER_SUPPORT |
85 void Iterate(ObjectVisitor* v); | 85 void Iterate(ObjectVisitor* v); |
86 #endif | 86 #endif |
87 | 87 |
88 private: | 88 private: |
89 LargeObjectChunk* eager_deoptimization_entry_code_; | 89 MemoryChunk* eager_deoptimization_entry_code_; |
90 LargeObjectChunk* lazy_deoptimization_entry_code_; | 90 MemoryChunk* lazy_deoptimization_entry_code_; |
91 Deoptimizer* current_; | 91 Deoptimizer* current_; |
92 | 92 |
93 #ifdef ENABLE_DEBUGGER_SUPPORT | 93 #ifdef ENABLE_DEBUGGER_SUPPORT |
94 DeoptimizedFrameInfo* deoptimized_frame_info_; | 94 DeoptimizedFrameInfo* deoptimized_frame_info_; |
95 #endif | 95 #endif |
96 | 96 |
97 // List of deoptimized code which still have references from active stack | 97 // List of deoptimized code which still have references from active stack |
98 // frames. These code objects are needed by the deoptimizer when deoptimizing | 98 // frames. These code objects are needed by the deoptimizer when deoptimizing |
99 // a frame for which the code object for the function function has been | 99 // a frame for which the code object for the function function has been |
100 // changed from the code present when deoptimizing was done. | 100 // changed from the code present when deoptimizing was done. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 static int patch_size(); | 166 static int patch_size(); |
167 | 167 |
168 // Patch all stack guard checks in the unoptimized code to | 168 // Patch all stack guard checks in the unoptimized code to |
169 // unconditionally call replacement_code. | 169 // unconditionally call replacement_code. |
170 static void PatchStackCheckCode(Code* unoptimized_code, | 170 static void PatchStackCheckCode(Code* unoptimized_code, |
171 Code* check_code, | 171 Code* check_code, |
172 Code* replacement_code); | 172 Code* replacement_code); |
173 | 173 |
174 // Patch stack guard check at instruction before pc_after in | 174 // Patch stack guard check at instruction before pc_after in |
175 // the unoptimized code to unconditionally call replacement_code. | 175 // the unoptimized code to unconditionally call replacement_code. |
176 static void PatchStackCheckCodeAt(Address pc_after, | 176 static void PatchStackCheckCodeAt(Code* unoptimized_code, |
| 177 Address pc_after, |
177 Code* check_code, | 178 Code* check_code, |
178 Code* replacement_code); | 179 Code* replacement_code); |
179 | 180 |
180 // Change all patched stack guard checks in the unoptimized code | 181 // Change all patched stack guard checks in the unoptimized code |
181 // back to a normal stack guard check. | 182 // back to a normal stack guard check. |
182 static void RevertStackCheckCode(Code* unoptimized_code, | 183 static void RevertStackCheckCode(Code* unoptimized_code, |
183 Code* check_code, | 184 Code* check_code, |
184 Code* replacement_code); | 185 Code* replacement_code); |
185 | 186 |
186 // Change all patched stack guard checks in the unoptimized code | 187 // Change all patched stack guard checks in the unoptimized code |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 unsigned ComputeInputFrameSize() const; | 279 unsigned ComputeInputFrameSize() const; |
279 unsigned ComputeFixedSize(JSFunction* function) const; | 280 unsigned ComputeFixedSize(JSFunction* function) const; |
280 | 281 |
281 unsigned ComputeIncomingArgumentSize(JSFunction* function) const; | 282 unsigned ComputeIncomingArgumentSize(JSFunction* function) const; |
282 unsigned ComputeOutgoingArgumentSize() const; | 283 unsigned ComputeOutgoingArgumentSize() const; |
283 | 284 |
284 Object* ComputeLiteral(int index) const; | 285 Object* ComputeLiteral(int index) const; |
285 | 286 |
286 void AddDoubleValue(intptr_t slot_address, double value); | 287 void AddDoubleValue(intptr_t slot_address, double value); |
287 | 288 |
288 static LargeObjectChunk* CreateCode(BailoutType type); | 289 static MemoryChunk* CreateCode(BailoutType type); |
289 static void GenerateDeoptimizationEntries( | 290 static void GenerateDeoptimizationEntries( |
290 MacroAssembler* masm, int count, BailoutType type); | 291 MacroAssembler* masm, int count, BailoutType type); |
291 | 292 |
292 // Weak handle callback for deoptimizing code objects. | 293 // Weak handle callback for deoptimizing code objects. |
293 static void HandleWeakDeoptimizedCode( | 294 static void HandleWeakDeoptimizedCode( |
294 v8::Persistent<v8::Value> obj, void* data); | 295 v8::Persistent<v8::Value> obj, void* data); |
295 static Code* FindDeoptimizingCodeFromAddress(Address addr); | 296 static Code* FindDeoptimizingCodeFromAddress(Address addr); |
296 static void RemoveDeoptimizingCode(Code* code); | 297 static void RemoveDeoptimizingCode(Code* code); |
297 | 298 |
298 // Fill the input from from a JavaScript frame. This is used when | 299 // Fill the input from from a JavaScript frame. This is used when |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 Object** parameters_; | 718 Object** parameters_; |
718 Object** expression_stack_; | 719 Object** expression_stack_; |
719 | 720 |
720 friend class Deoptimizer; | 721 friend class Deoptimizer; |
721 }; | 722 }; |
722 #endif | 723 #endif |
723 | 724 |
724 } } // namespace v8::internal | 725 } } // namespace v8::internal |
725 | 726 |
726 #endif // V8_DEOPTIMIZER_H_ | 727 #endif // V8_DEOPTIMIZER_H_ |
OLD | NEW |