| OLD | NEW |
| 1 // Copyright 2010 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 |
| 11 // with the distribution. | 11 // with the distribution. |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 static void DeoptimizeGlobalObject(JSObject* object); | 121 static void DeoptimizeGlobalObject(JSObject* object); |
| 122 | 122 |
| 123 static void VisitAllOptimizedFunctionsForContext( | 123 static void VisitAllOptimizedFunctionsForContext( |
| 124 Context* context, OptimizedFunctionVisitor* visitor); | 124 Context* context, OptimizedFunctionVisitor* visitor); |
| 125 | 125 |
| 126 static void VisitAllOptimizedFunctionsForGlobalObject( | 126 static void VisitAllOptimizedFunctionsForGlobalObject( |
| 127 JSObject* object, OptimizedFunctionVisitor* visitor); | 127 JSObject* object, OptimizedFunctionVisitor* visitor); |
| 128 | 128 |
| 129 static void VisitAllOptimizedFunctions(OptimizedFunctionVisitor* visitor); | 129 static void VisitAllOptimizedFunctions(OptimizedFunctionVisitor* visitor); |
| 130 | 130 |
| 131 // Given the relocation info of a call to the stack check stub, patch the | 131 // The size in bytes of the code required at a lazy deopt patch site. |
| 132 // code so as to go unconditionally to the on-stack replacement builtin | 132 static int patch_size(); |
| 133 // instead. | |
| 134 static void PatchStackCheckCode(RelocInfo* rinfo, Code* replacement_code); | |
| 135 | 133 |
| 136 // Given the relocation info of a call to the on-stack replacement | 134 // Patch all stack guard checks in the unoptimized code to |
| 137 // builtin, patch the code back to the original stack check code. | 135 // unconditionally call replacement_code. |
| 138 static void RevertStackCheckCode(RelocInfo* rinfo, Code* check_code); | 136 static void PatchStackCheckCode(Code* unoptimized_code, |
| 137 Code* check_code, |
| 138 Code* replacement_code); |
| 139 |
| 140 // Patch stack guard check at instruction before pc_after in |
| 141 // the unoptimized code to unconditionally call replacement_code. |
| 142 static void PatchStackCheckCodeAt(Address pc_after, |
| 143 Code* check_code, |
| 144 Code* replacement_code); |
| 145 |
| 146 // Change all patched stack guard checks in the unoptimized code |
| 147 // back to a normal stack guard check. |
| 148 static void RevertStackCheckCode(Code* unoptimized_code, |
| 149 Code* check_code, |
| 150 Code* replacement_code); |
| 151 |
| 152 // Change all patched stack guard checks in the unoptimized code |
| 153 // back to a normal stack guard check. |
| 154 static void RevertStackCheckCodeAt(Address pc_after, |
| 155 Code* check_code, |
| 156 Code* replacement_code); |
| 139 | 157 |
| 140 ~Deoptimizer(); | 158 ~Deoptimizer(); |
| 141 | 159 |
| 142 void InsertHeapNumberValues(int index, JavaScriptFrame* frame); | 160 void InsertHeapNumberValues(int index, JavaScriptFrame* frame); |
| 143 | 161 |
| 144 static void ComputeOutputFrames(Deoptimizer* deoptimizer); | 162 static void ComputeOutputFrames(Deoptimizer* deoptimizer); |
| 145 | 163 |
| 146 static Address GetDeoptimizationEntry(int id, BailoutType type); | 164 static Address GetDeoptimizationEntry(int id, BailoutType type); |
| 147 static int GetDeoptimizationId(Address addr, BailoutType type); | 165 static int GetDeoptimizationId(Address addr, BailoutType type); |
| 148 static int GetOutputInfo(DeoptimizationOutputData* data, | 166 static int GetOutputInfo(DeoptimizationOutputData* data, |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 Handle<Code> code_; | 520 Handle<Code> code_; |
| 503 | 521 |
| 504 // Next pointer for linked list. | 522 // Next pointer for linked list. |
| 505 DeoptimizingCodeListNode* next_; | 523 DeoptimizingCodeListNode* next_; |
| 506 }; | 524 }; |
| 507 | 525 |
| 508 | 526 |
| 509 } } // namespace v8::internal | 527 } } // namespace v8::internal |
| 510 | 528 |
| 511 #endif // V8_DEOPTIMIZER_H_ | 529 #endif // V8_DEOPTIMIZER_H_ |
| OLD | NEW |