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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // jump if space is short. The absolute jumps are put in a table just | 76 // jump if space is short. The absolute jumps are put in a table just |
77 // before the safepoint table (space was allocated there when the Code | 77 // before the safepoint table (space was allocated there when the Code |
78 // object was created, if necessary). | 78 // object was created, if necessary). |
79 | 79 |
80 Address instruction_start = code->instruction_start(); | 80 Address instruction_start = code->instruction_start(); |
81 #ifdef DEBUG | 81 #ifdef DEBUG |
82 Address prev_call_address = NULL; | 82 Address prev_call_address = NULL; |
83 #endif | 83 #endif |
84 DeoptimizationInputData* deopt_data = | 84 DeoptimizationInputData* deopt_data = |
85 DeoptimizationInputData::cast(code->deoptimization_data()); | 85 DeoptimizationInputData::cast(code->deoptimization_data()); |
| 86 SharedFunctionInfo* shared = |
| 87 SharedFunctionInfo::cast(deopt_data->SharedFunctionInfo()); |
| 88 shared->EvictFromOptimizedCodeMap(code, "deoptimized code"); |
| 89 deopt_data->SetSharedFunctionInfo(Smi::FromInt(0)); |
| 90 // For each LLazyBailout instruction insert a call to the corresponding |
| 91 // deoptimization entry. |
86 for (int i = 0; i < deopt_data->DeoptCount(); i++) { | 92 for (int i = 0; i < deopt_data->DeoptCount(); i++) { |
87 if (deopt_data->Pc(i)->value() == -1) continue; | 93 if (deopt_data->Pc(i)->value() == -1) continue; |
88 // Position where Call will be patched in. | 94 // Position where Call will be patched in. |
89 Address call_address = instruction_start + deopt_data->Pc(i)->value(); | 95 Address call_address = instruction_start + deopt_data->Pc(i)->value(); |
90 // There is room enough to write a long call instruction because we pad | 96 // There is room enough to write a long call instruction because we pad |
91 // LLazyBailout instructions with nops if necessary. | 97 // LLazyBailout instructions with nops if necessary. |
92 CodePatcher patcher(call_address, Assembler::kCallSequenceLength); | 98 CodePatcher patcher(call_address, Assembler::kCallSequenceLength); |
93 patcher.masm()->Call(GetDeoptimizationEntry(isolate, i, LAZY), | 99 patcher.masm()->Call(GetDeoptimizationEntry(isolate, i, LAZY), |
94 Assembler::RelocInfoNone()); | 100 Assembler::RelocInfoNone()); |
95 ASSERT(prev_call_address == NULL || | 101 ASSERT(prev_call_address == NULL || |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 SetFrameSlot(offset, value); | 360 SetFrameSlot(offset, value); |
355 } | 361 } |
356 | 362 |
357 | 363 |
358 #undef __ | 364 #undef __ |
359 | 365 |
360 | 366 |
361 } } // namespace v8::internal | 367 } } // namespace v8::internal |
362 | 368 |
363 #endif // V8_TARGET_ARCH_X64 | 369 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |