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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 203 |
204 static void VisitAllOptimizedFunctionsForContext( | 204 static void VisitAllOptimizedFunctionsForContext( |
205 Context* context, OptimizedFunctionVisitor* visitor); | 205 Context* context, OptimizedFunctionVisitor* visitor); |
206 | 206 |
207 static void VisitAllOptimizedFunctions(Isolate* isolate, | 207 static void VisitAllOptimizedFunctions(Isolate* isolate, |
208 OptimizedFunctionVisitor* visitor); | 208 OptimizedFunctionVisitor* visitor); |
209 | 209 |
210 // The size in bytes of the code required at a lazy deopt patch site. | 210 // The size in bytes of the code required at a lazy deopt patch site. |
211 static int patch_size(); | 211 static int patch_size(); |
212 | 212 |
213 // Patch all stack guard checks in the unoptimized code to | 213 // Patch all interrupts with allowed loop depth in the unoptimized code to |
214 // unconditionally call replacement_code. | 214 // unconditionally call replacement_code. |
215 static void PatchStackCheckCode(Code* unoptimized_code, | 215 static void PatchInterruptCode(Code* unoptimized_code, |
216 Code* check_code, | 216 Code* interrupt_code, |
| 217 Code* replacement_code); |
| 218 |
| 219 // Patch the interrupt at the instruction before pc_after in |
| 220 // the unoptimized code to unconditionally call replacement_code. |
| 221 static void PatchInterruptCodeAt(Code* unoptimized_code, |
| 222 Address pc_after, |
| 223 Code* interrupt_code, |
| 224 Code* replacement_code); |
| 225 |
| 226 // Change all patched interrupts patched in the unoptimized code |
| 227 // back to normal interrupts. |
| 228 static void RevertInterruptCode(Code* unoptimized_code, |
| 229 Code* interrupt_code, |
217 Code* replacement_code); | 230 Code* replacement_code); |
218 | 231 |
219 // Patch stack guard check at instruction before pc_after in | 232 // Change patched interrupt in the unoptimized code |
220 // the unoptimized code to unconditionally call replacement_code. | 233 // back to a normal interrupt. |
221 static void PatchStackCheckCodeAt(Code* unoptimized_code, | 234 static void RevertInterruptCodeAt(Code* unoptimized_code, |
222 Address pc_after, | 235 Address pc_after, |
223 Code* check_code, | 236 Code* interrupt_code, |
224 Code* replacement_code); | 237 Code* replacement_code); |
225 | 238 |
226 // Change all patched stack guard checks in the unoptimized code | 239 #ifdef DEBUG |
227 // back to a normal stack guard check. | 240 static bool InterruptCodeIsPatched(Code* unoptimized_code, |
228 static void RevertStackCheckCode(Code* unoptimized_code, | 241 Address pc_after, |
229 Code* check_code, | 242 Code* interrupt_code, |
230 Code* replacement_code); | 243 Code* replacement_code); |
231 | 244 |
232 // Change all patched stack guard checks in the unoptimized code | 245 // Verify that all back edges of a certain loop depth are patched. |
233 // back to a normal stack guard check. | 246 static void VerifyInterruptCode(Code* unoptimized_code, |
234 static void RevertStackCheckCodeAt(Code* unoptimized_code, | 247 Code* interrupt_code, |
235 Address pc_after, | 248 Code* replacement_code, |
236 Code* check_code, | 249 int loop_nesting_level); |
237 Code* replacement_code); | 250 #endif // DEBUG |
238 | 251 |
239 ~Deoptimizer(); | 252 ~Deoptimizer(); |
240 | 253 |
241 void MaterializeHeapObjects(JavaScriptFrameIterator* it); | 254 void MaterializeHeapObjects(JavaScriptFrameIterator* it); |
242 #ifdef ENABLE_DEBUGGER_SUPPORT | 255 #ifdef ENABLE_DEBUGGER_SUPPORT |
243 void MaterializeHeapNumbersForDebuggerInspectableFrame( | 256 void MaterializeHeapNumbersForDebuggerInspectableFrame( |
244 Address parameters_top, | 257 Address parameters_top, |
245 uint32_t parameters_size, | 258 uint32_t parameters_size, |
246 Address expressions_top, | 259 Address expressions_top, |
247 uint32_t expressions_size, | 260 uint32_t expressions_size, |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 Object** expression_stack_; | 916 Object** expression_stack_; |
904 int source_position_; | 917 int source_position_; |
905 | 918 |
906 friend class Deoptimizer; | 919 friend class Deoptimizer; |
907 }; | 920 }; |
908 #endif | 921 #endif |
909 | 922 |
910 } } // namespace v8::internal | 923 } } // namespace v8::internal |
911 | 924 |
912 #endif // V8_DEOPTIMIZER_H_ | 925 #endif // V8_DEOPTIMIZER_H_ |
OLD | NEW |