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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/deoptimizer.h" | 8 #include "src/deoptimizer.h" |
9 #include "src/full-codegen/full-codegen.h" | 9 #include "src/full-codegen/full-codegen.h" |
10 #include "src/register-configuration.h" | 10 #include "src/register-configuration.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // jump if space is short. The absolute jumps are put in a table just | 59 // jump if space is short. The absolute jumps are put in a table just |
60 // before the safepoint table (space was allocated there when the Code | 60 // before the safepoint table (space was allocated there when the Code |
61 // object was created, if necessary). | 61 // object was created, if necessary). |
62 | 62 |
63 Address instruction_start = code->instruction_start(); | 63 Address instruction_start = code->instruction_start(); |
64 #ifdef DEBUG | 64 #ifdef DEBUG |
65 Address prev_call_address = NULL; | 65 Address prev_call_address = NULL; |
66 #endif | 66 #endif |
67 DeoptimizationInputData* deopt_data = | 67 DeoptimizationInputData* deopt_data = |
68 DeoptimizationInputData::cast(code->deoptimization_data()); | 68 DeoptimizationInputData::cast(code->deoptimization_data()); |
69 deopt_data->SetSharedFunctionInfo(Smi::FromInt(0)); | 69 deopt_data->SetSharedFunctionInfo(Smi::kZero); |
70 // For each LLazyBailout instruction insert a call to the corresponding | 70 // For each LLazyBailout instruction insert a call to the corresponding |
71 // deoptimization entry. | 71 // deoptimization entry. |
72 for (int i = 0; i < deopt_data->DeoptCount(); i++) { | 72 for (int i = 0; i < deopt_data->DeoptCount(); i++) { |
73 if (deopt_data->Pc(i)->value() == -1) continue; | 73 if (deopt_data->Pc(i)->value() == -1) continue; |
74 // Position where Call will be patched in. | 74 // Position where Call will be patched in. |
75 Address call_address = instruction_start + deopt_data->Pc(i)->value(); | 75 Address call_address = instruction_start + deopt_data->Pc(i)->value(); |
76 // There is room enough to write a long call instruction because we pad | 76 // There is room enough to write a long call instruction because we pad |
77 // LLazyBailout instructions with nops if necessary. | 77 // LLazyBailout instructions with nops if necessary. |
78 CodePatcher patcher(isolate, call_address, Assembler::kCallSequenceLength); | 78 CodePatcher patcher(isolate, call_address, Assembler::kCallSequenceLength); |
79 patcher.masm()->Call(GetDeoptimizationEntry(isolate, i, LAZY), | 79 patcher.masm()->Call(GetDeoptimizationEntry(isolate, i, LAZY), |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 } | 333 } |
334 | 334 |
335 | 335 |
336 #undef __ | 336 #undef __ |
337 | 337 |
338 | 338 |
339 } // namespace internal | 339 } // namespace internal |
340 } // namespace v8 | 340 } // namespace v8 |
341 | 341 |
342 #endif // V8_TARGET_ARCH_X64 | 342 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |