OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 | 47 |
48 void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) { | 48 void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) { |
49 // Invalidate the relocation information, as it will become invalid by the | 49 // Invalidate the relocation information, as it will become invalid by the |
50 // code patching below, and is not needed any more. | 50 // code patching below, and is not needed any more. |
51 code->InvalidateRelocation(); | 51 code->InvalidateRelocation(); |
52 | 52 |
53 // TODO(jkummerow): if (FLAG_zap_code_space), make the code object's | 53 // TODO(jkummerow): if (FLAG_zap_code_space), make the code object's |
54 // entry sequence unusable (see other architectures). | 54 // entry sequence unusable (see other architectures). |
55 | 55 |
56 // For each LLazyBailout instruction insert a call to the corresponding | |
57 // deoptimization entry. | |
58 DeoptimizationInputData* deopt_data = | 56 DeoptimizationInputData* deopt_data = |
59 DeoptimizationInputData::cast(code->deoptimization_data()); | 57 DeoptimizationInputData::cast(code->deoptimization_data()); |
| 58 SharedFunctionInfo* shared = |
| 59 SharedFunctionInfo::cast(deopt_data->SharedFunctionInfo()); |
| 60 shared->EvictFromOptimizedCodeMap(code, "deoptimized code"); |
60 Address code_start_address = code->instruction_start(); | 61 Address code_start_address = code->instruction_start(); |
61 #ifdef DEBUG | 62 #ifdef DEBUG |
62 Address prev_call_address = NULL; | 63 Address prev_call_address = NULL; |
63 #endif | 64 #endif |
64 | 65 // For each LLazyBailout instruction insert a call to the corresponding |
| 66 // deoptimization entry. |
65 for (int i = 0; i < deopt_data->DeoptCount(); i++) { | 67 for (int i = 0; i < deopt_data->DeoptCount(); i++) { |
66 if (deopt_data->Pc(i)->value() == -1) continue; | 68 if (deopt_data->Pc(i)->value() == -1) continue; |
67 | 69 |
68 Address call_address = code_start_address + deopt_data->Pc(i)->value(); | 70 Address call_address = code_start_address + deopt_data->Pc(i)->value(); |
69 Address deopt_entry = GetDeoptimizationEntry(isolate, i, LAZY); | 71 Address deopt_entry = GetDeoptimizationEntry(isolate, i, LAZY); |
70 | 72 |
71 PatchingAssembler patcher(call_address, patch_size() / kInstructionSize); | 73 PatchingAssembler patcher(call_address, patch_size() / kInstructionSize); |
72 patcher.LoadLiteral(ip0, 2 * kInstructionSize); | 74 patcher.LoadLiteral(ip0, 2 * kInstructionSize); |
73 patcher.blr(ip0); | 75 patcher.blr(ip0); |
74 patcher.dc64(reinterpret_cast<intptr_t>(deopt_entry)); | 76 patcher.dc64(reinterpret_cast<intptr_t>(deopt_entry)); |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 | 372 |
371 | 373 |
372 void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) { | 374 void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) { |
373 SetFrameSlot(offset, value); | 375 SetFrameSlot(offset, value); |
374 } | 376 } |
375 | 377 |
376 | 378 |
377 #undef __ | 379 #undef __ |
378 | 380 |
379 } } // namespace v8::internal | 381 } } // namespace v8::internal |
OLD | NEW |