Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: src/x64/deoptimizer-x64.cc

Issue 14604007: Only flush SharedFunctionInfo optimized code cache when necessary (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix bug Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 void Deoptimizer::DeoptimizeFunctionWithPreparedFunctionList( 49 void Deoptimizer::DeoptimizeFunctionWithPreparedFunctionList(
50 JSFunction* function) { 50 JSFunction* function) {
51 Isolate* isolate = function->GetIsolate(); 51 Isolate* isolate = function->GetIsolate();
52 HandleScope scope(isolate); 52 HandleScope scope(isolate);
53 AssertNoAllocation no_allocation; 53 AssertNoAllocation no_allocation;
54 54
55 ASSERT(function->IsOptimized()); 55 ASSERT(function->IsOptimized());
56 ASSERT(function->FunctionsInFunctionListShareSameCode()); 56 ASSERT(function->FunctionsInFunctionListShareSameCode());
57 57
58 // The optimized code is going to be patched, so we cannot use it
59 // any more. Play safe and reset the whole cache.
60 function->shared()->ClearOptimizedCodeMap("deoptimized function");
61
62 // Get the optimized code. 58 // Get the optimized code.
63 Code* code = function->code(); 59 Code* code = function->code();
64 60
61 // The optimized code is going to be patched, so we cannot use it any more.
62 function->shared()->EvictFromOptimizedCodeMap(code, "deoptimized function");
63
65 // Invalidate the relocation information, as it will become invalid by the 64 // Invalidate the relocation information, as it will become invalid by the
66 // code patching below, and is not needed any more. 65 // code patching below, and is not needed any more.
67 code->InvalidateRelocation(); 66 code->InvalidateRelocation();
68 67
69 // For each LLazyBailout instruction insert a absolute call to the 68 // For each LLazyBailout instruction insert a absolute call to the
70 // corresponding deoptimization entry, or a short call to an absolute 69 // corresponding deoptimization entry, or a short call to an absolute
71 // jump if space is short. The absolute jumps are put in a table just 70 // jump if space is short. The absolute jumps are put in a table just
72 // before the safepoint table (space was allocated there when the Code 71 // before the safepoint table (space was allocated there when the Code
73 // object was created, if necessary). 72 // object was created, if necessary).
74 73
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 } 783 }
785 __ bind(&done); 784 __ bind(&done);
786 } 785 }
787 786
788 #undef __ 787 #undef __
789 788
790 789
791 } } // namespace v8::internal 790 } } // namespace v8::internal
792 791
793 #endif // V8_TARGET_ARCH_X64 792 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698