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); | 217 Code* replacement_code); |
218 | 218 |
219 // Patch stack guard check at instruction before pc_after in | 219 // Patch interrupts at instruction before pc_after in |
220 // the unoptimized code to unconditionally call replacement_code. | 220 // the unoptimized code to unconditionally call replacement_code. |
221 static void PatchStackCheckCodeAt(Code* unoptimized_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 a normal interrupts. | |
Jakob Kummerow
2013/04/09 17:23:25
nit: s/interrupts/interrupt/
Yang
2013/04/10 08:08:30
Done.
| |
228 static void RevertInterruptCode(Code* unoptimized_code, | |
229 Code* interrupt_code, | |
Jakob Kummerow
2013/04/09 17:23:25
nit: indentation
Yang
2013/04/10 08:08:30
Done.
| |
230 Code* replacement_code); | |
231 | |
232 // Change patched interrupt in the unoptimized code | |
233 // back to a normal interrupts. | |
Jakob Kummerow
2013/04/09 17:23:25
nit: s/interrupts/interrupt/
Yang
2013/04/10 08:08:30
Done.
| |
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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
430 // Array of output frame descriptions. | 443 // Array of output frame descriptions. |
431 FrameDescription** output_; | 444 FrameDescription** output_; |
432 | 445 |
433 List<Object*> deferred_arguments_objects_values_; | 446 List<Object*> deferred_arguments_objects_values_; |
434 List<ArgumentsObjectMaterializationDescriptor> deferred_arguments_objects_; | 447 List<ArgumentsObjectMaterializationDescriptor> deferred_arguments_objects_; |
435 List<HeapNumberMaterializationDescriptor> deferred_heap_numbers_; | 448 List<HeapNumberMaterializationDescriptor> deferred_heap_numbers_; |
436 | 449 |
437 bool trace_; | 450 bool trace_; |
438 | 451 |
439 static const int table_entry_size_; | 452 static const int table_entry_size_; |
453 static const int kBackEdgeEntrySize = 2 * kIntSize + kOneByteSize; | |
Jakob Kummerow
2013/04/09 17:23:25
This constant belongs close to the definition of t
Yang
2013/04/10 08:08:30
Done.
| |
440 | 454 |
441 friend class FrameDescription; | 455 friend class FrameDescription; |
442 friend class DeoptimizingCodeListNode; | 456 friend class DeoptimizingCodeListNode; |
443 friend class DeoptimizedFrameInfo; | 457 friend class DeoptimizedFrameInfo; |
444 }; | 458 }; |
445 | 459 |
446 | 460 |
447 class FrameDescription { | 461 class FrameDescription { |
448 public: | 462 public: |
449 FrameDescription(uint32_t frame_size, | 463 FrameDescription(uint32_t frame_size, |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
903 Object** expression_stack_; | 917 Object** expression_stack_; |
904 int source_position_; | 918 int source_position_; |
905 | 919 |
906 friend class Deoptimizer; | 920 friend class Deoptimizer; |
907 }; | 921 }; |
908 #endif | 922 #endif |
909 | 923 |
910 } } // namespace v8::internal | 924 } } // namespace v8::internal |
911 | 925 |
912 #endif // V8_DEOPTIMIZER_H_ | 926 #endif // V8_DEOPTIMIZER_H_ |
OLD | NEW |