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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 | 46 |
47 void Deoptimizer::DeoptimizeFunctionWithPreparedFunctionList( | 47 void Deoptimizer::DeoptimizeFunctionWithPreparedFunctionList( |
48 JSFunction* function) { | 48 JSFunction* function) { |
49 Isolate* isolate = function->GetIsolate(); | 49 Isolate* isolate = function->GetIsolate(); |
50 HandleScope scope(isolate); | 50 HandleScope scope(isolate); |
51 AssertNoAllocation no_allocation; | 51 AssertNoAllocation no_allocation; |
52 | 52 |
53 ASSERT(function->IsOptimized()); | 53 ASSERT(function->IsOptimized()); |
54 ASSERT(function->FunctionsInFunctionListShareSameCode()); | 54 ASSERT(function->FunctionsInFunctionListShareSameCode()); |
55 | 55 |
56 // The optimized code is going to be patched, so we cannot use it | |
57 // any more. Play safe and reset the whole cache. | |
58 function->shared()->ClearOptimizedCodeMap("deoptimized function"); | |
59 | |
60 // Get the optimized code. | 56 // Get the optimized code. |
61 Code* code = function->code(); | 57 Code* code = function->code(); |
62 Address code_start_address = code->instruction_start(); | 58 Address code_start_address = code->instruction_start(); |
63 | 59 |
60 // The optimized code is going to be patched, so we cannot use it | |
61 // any more. Play safe and reset the whole cache. | |
Michael Starzinger
2013/05/13 14:26:46
The second sentence of the comment is out-dated, l
danno
2013/05/13 15:23:10
Done.
| |
62 function->shared()->EvictFromOptimizedCodeMap(code, "deoptimized function"); | |
63 | |
64 // Invalidate the relocation information, as it will become invalid by the | 64 // Invalidate the relocation information, as it will become invalid by the |
65 // code patching below, and is not needed any more. | 65 // code patching below, and is not needed any more. |
66 code->InvalidateRelocation(); | 66 code->InvalidateRelocation(); |
67 | 67 |
68 // For each LLazyBailout instruction insert a call to the corresponding | 68 // For each LLazyBailout instruction insert a call to the corresponding |
69 // deoptimization entry. | 69 // deoptimization entry. |
70 DeoptimizationInputData* deopt_data = | 70 DeoptimizationInputData* deopt_data = |
71 DeoptimizationInputData::cast(code->deoptimization_data()); | 71 DeoptimizationInputData::cast(code->deoptimization_data()); |
72 #ifdef DEBUG | 72 #ifdef DEBUG |
73 Address prev_call_address = NULL; | 73 Address prev_call_address = NULL; |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
824 __ push(ip); | 824 __ push(ip); |
825 __ b(&done); | 825 __ b(&done); |
826 ASSERT(masm()->pc_offset() - start == table_entry_size_); | 826 ASSERT(masm()->pc_offset() - start == table_entry_size_); |
827 } | 827 } |
828 __ bind(&done); | 828 __ bind(&done); |
829 } | 829 } |
830 | 830 |
831 #undef __ | 831 #undef __ |
832 | 832 |
833 } } // namespace v8::internal | 833 } } // namespace v8::internal |
OLD | NEW |