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

Side by Side Diff: src/compiler.cc

Issue 184923002: Clear optimized code cache in shared function info when code gets deoptimized (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix assert Created 6 years, 9 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
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 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 if (FLAG_trace_opt) { 1063 if (FLAG_trace_opt) {
1064 PrintF("[found optimized code for "); 1064 PrintF("[found optimized code for ");
1065 function->ShortPrint(); 1065 function->ShortPrint();
1066 if (!osr_ast_id.IsNone()) { 1066 if (!osr_ast_id.IsNone()) {
1067 PrintF(" at OSR AST id %d", osr_ast_id.ToInt()); 1067 PrintF(" at OSR AST id %d", osr_ast_id.ToInt());
1068 } 1068 }
1069 PrintF("]\n"); 1069 PrintF("]\n");
1070 } 1070 }
1071 FixedArray* literals = shared->GetLiteralsFromOptimizedCodeMap(index); 1071 FixedArray* literals = shared->GetLiteralsFromOptimizedCodeMap(index);
1072 if (literals != NULL) function->set_literals(literals); 1072 if (literals != NULL) function->set_literals(literals);
1073 Handle<Code> code(shared->GetCodeFromOptimizedCodeMap(index)); 1073 return Handle<Code>(shared->GetCodeFromOptimizedCodeMap(index));
1074 if (!code->marked_for_deoptimization()) return code;
1075 shared->EvictFromOptimizedCodeMap(function->context()->native_context(),
1076 "code was already marked for deopt");
1077 } 1074 }
1078 } 1075 }
1079 return Handle<Code>::null(); 1076 return Handle<Code>::null();
1080 } 1077 }
1081 1078
1082 1079
1083 static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) { 1080 static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) {
1084 Handle<Code> code = info->code(); 1081 Handle<Code> code = info->code();
1085 if (code->kind() != Code::OPTIMIZED_FUNCTION) return; // Nothing to do. 1082 if (code->kind() != Code::OPTIMIZED_FUNCTION) return; // Nothing to do.
1086 1083
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 AllowHandleDereference allow_deref; 1308 AllowHandleDereference allow_deref;
1312 bool tracing_on = info()->IsStub() 1309 bool tracing_on = info()->IsStub()
1313 ? FLAG_trace_hydrogen_stubs 1310 ? FLAG_trace_hydrogen_stubs
1314 : (FLAG_trace_hydrogen && 1311 : (FLAG_trace_hydrogen &&
1315 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); 1312 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter));
1316 return (tracing_on && 1313 return (tracing_on &&
1317 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); 1314 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL);
1318 } 1315 }
1319 1316
1320 } } // namespace v8::internal 1317 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/deoptimizer.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698