| 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_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 8 | 8 |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // jump if space is short. The absolute jumps are put in a table just | 53 // jump if space is short. The absolute jumps are put in a table just |
| 54 // before the safepoint table (space was allocated there when the Code | 54 // before the safepoint table (space was allocated there when the Code |
| 55 // object was created, if necessary). | 55 // object was created, if necessary). |
| 56 | 56 |
| 57 Address instruction_start = code->instruction_start(); | 57 Address instruction_start = code->instruction_start(); |
| 58 #ifdef DEBUG | 58 #ifdef DEBUG |
| 59 Address prev_call_address = NULL; | 59 Address prev_call_address = NULL; |
| 60 #endif | 60 #endif |
| 61 DeoptimizationInputData* deopt_data = | 61 DeoptimizationInputData* deopt_data = |
| 62 DeoptimizationInputData::cast(code->deoptimization_data()); | 62 DeoptimizationInputData::cast(code->deoptimization_data()); |
| 63 SharedFunctionInfo* shared = | |
| 64 SharedFunctionInfo::cast(deopt_data->SharedFunctionInfo()); | |
| 65 shared->EvictFromOptimizedCodeMap(code, "deoptimized code"); | |
| 66 deopt_data->SetSharedFunctionInfo(Smi::FromInt(0)); | 63 deopt_data->SetSharedFunctionInfo(Smi::FromInt(0)); |
| 67 // For each LLazyBailout instruction insert a call to the corresponding | 64 // For each LLazyBailout instruction insert a call to the corresponding |
| 68 // deoptimization entry. | 65 // deoptimization entry. |
| 69 for (int i = 0; i < deopt_data->DeoptCount(); i++) { | 66 for (int i = 0; i < deopt_data->DeoptCount(); i++) { |
| 70 if (deopt_data->Pc(i)->value() == -1) continue; | 67 if (deopt_data->Pc(i)->value() == -1) continue; |
| 71 // Position where Call will be patched in. | 68 // Position where Call will be patched in. |
| 72 Address call_address = instruction_start + deopt_data->Pc(i)->value(); | 69 Address call_address = instruction_start + deopt_data->Pc(i)->value(); |
| 73 // There is room enough to write a long call instruction because we pad | 70 // There is room enough to write a long call instruction because we pad |
| 74 // LLazyBailout instructions with nops if necessary. | 71 // LLazyBailout instructions with nops if necessary. |
| 75 CodePatcher patcher(call_address, Assembler::kCallSequenceLength); | 72 CodePatcher patcher(call_address, Assembler::kCallSequenceLength); |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 UNREACHABLE(); | 343 UNREACHABLE(); |
| 347 } | 344 } |
| 348 | 345 |
| 349 | 346 |
| 350 #undef __ | 347 #undef __ |
| 351 | 348 |
| 352 | 349 |
| 353 } } // namespace v8::internal | 350 } } // namespace v8::internal |
| 354 | 351 |
| 355 #endif // V8_TARGET_ARCH_X64 | 352 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |