| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
| 8 | 8 |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 Address reloc_end_address = reloc_info->address() + reloc_info->Size(); | 121 Address reloc_end_address = reloc_info->address() + reloc_info->Size(); |
| 122 RelocInfoWriter reloc_info_writer(reloc_end_address, code_start_address); | 122 RelocInfoWriter reloc_info_writer(reloc_end_address, code_start_address); |
| 123 | 123 |
| 124 // Since the call is a relative encoding, write new | 124 // Since the call is a relative encoding, write new |
| 125 // reloc info. We do not need any of the existing reloc info because the | 125 // reloc info. We do not need any of the existing reloc info because the |
| 126 // existing code will not be used again (we zap it in debug builds). | 126 // existing code will not be used again (we zap it in debug builds). |
| 127 // | 127 // |
| 128 // Emit call to lazy deoptimization at all lazy deopt points. | 128 // Emit call to lazy deoptimization at all lazy deopt points. |
| 129 DeoptimizationInputData* deopt_data = | 129 DeoptimizationInputData* deopt_data = |
| 130 DeoptimizationInputData::cast(code->deoptimization_data()); | 130 DeoptimizationInputData::cast(code->deoptimization_data()); |
| 131 SharedFunctionInfo* shared = | |
| 132 SharedFunctionInfo::cast(deopt_data->SharedFunctionInfo()); | |
| 133 shared->EvictFromOptimizedCodeMap(code, "deoptimized code"); | |
| 134 #ifdef DEBUG | 131 #ifdef DEBUG |
| 135 Address prev_call_address = NULL; | 132 Address prev_call_address = NULL; |
| 136 #endif | 133 #endif |
| 137 // For each LLazyBailout instruction insert a call to the corresponding | 134 // For each LLazyBailout instruction insert a call to the corresponding |
| 138 // deoptimization entry. | 135 // deoptimization entry. |
| 139 for (int i = 0; i < deopt_data->DeoptCount(); i++) { | 136 for (int i = 0; i < deopt_data->DeoptCount(); i++) { |
| 140 if (deopt_data->Pc(i)->value() == -1) continue; | 137 if (deopt_data->Pc(i)->value() == -1) continue; |
| 141 // Patch lazy deoptimization entry. | 138 // Patch lazy deoptimization entry. |
| 142 Address call_address = code_start_address + deopt_data->Pc(i)->value(); | 139 Address call_address = code_start_address + deopt_data->Pc(i)->value(); |
| 143 CodePatcher patcher(call_address, patch_size()); | 140 CodePatcher patcher(call_address, patch_size()); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 UNREACHABLE(); | 394 UNREACHABLE(); |
| 398 } | 395 } |
| 399 | 396 |
| 400 | 397 |
| 401 #undef __ | 398 #undef __ |
| 402 | 399 |
| 403 | 400 |
| 404 } } // namespace v8::internal | 401 } } // namespace v8::internal |
| 405 | 402 |
| 406 #endif // V8_TARGET_ARCH_X87 | 403 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |