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

Side by Side Diff: src/compiler.cc

Issue 13811014: Fix OSR for nested loops. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years, 8 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/arm/full-codegen-arm.cc ('k') | src/deoptimizer.h » ('j') | 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 940 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 isolate->heap()->CollectGarbage(NEW_SPACE, "parallel recompile"); 951 isolate->heap()->CollectGarbage(NEW_SPACE, "parallel recompile");
952 isolate->optimizing_compiler_thread()->QueueForOptimization(compiler); 952 isolate->optimizing_compiler_thread()->QueueForOptimization(compiler);
953 } else if (status == OptimizingCompiler::BAILED_OUT) { 953 } else if (status == OptimizingCompiler::BAILED_OUT) {
954 isolate->clear_pending_exception(); 954 isolate->clear_pending_exception();
955 InstallFullCode(*info); 955 InstallFullCode(*info);
956 } 956 }
957 } 957 }
958 } 958 }
959 } 959 }
960 960
961 if (shared->code()->stack_check_patched_for_osr()) { 961 if (shared->code()->back_edges_patched_for_osr()) {
962 // At this point we either put the function on recompilation queue or 962 // At this point we either put the function on recompilation queue or
963 // aborted optimization. In either case we want to continue executing 963 // aborted optimization. In either case we want to continue executing
964 // the unoptimized code without running into OSR. If the unoptimized 964 // the unoptimized code without running into OSR. If the unoptimized
965 // code has been patched for OSR, unpatch it. 965 // code has been patched for OSR, unpatch it.
966 InterruptStub interrupt_stub; 966 InterruptStub interrupt_stub;
967 Handle<Code> check_code = interrupt_stub.GetCode(isolate); 967 Handle<Code> interrupt_code = interrupt_stub.GetCode(isolate);
968 Handle<Code> replacement_code = 968 Handle<Code> replacement_code =
969 isolate->builtins()->OnStackReplacement(); 969 isolate->builtins()->OnStackReplacement();
970 Deoptimizer::RevertStackCheckCode(shared->code(), 970 Deoptimizer::RevertInterruptCode(shared->code(),
971 *check_code, 971 *interrupt_code,
972 *replacement_code); 972 *replacement_code);
973 } 973 }
974 974
975 if (isolate->has_pending_exception()) isolate->clear_pending_exception(); 975 if (isolate->has_pending_exception()) isolate->clear_pending_exception();
976 } 976 }
977 977
978 978
979 void Compiler::InstallOptimizedCode(OptimizingCompiler* optimizing_compiler) { 979 void Compiler::InstallOptimizedCode(OptimizingCompiler* optimizing_compiler) {
980 SmartPointer<CompilationInfo> info(optimizing_compiler->info()); 980 SmartPointer<CompilationInfo> info(optimizing_compiler->info());
981 // The function may have already been optimized by OSR. Simply continue. 981 // The function may have already been optimized by OSR. Simply continue.
982 // Except when OSR already disabled optimization for some reason. 982 // Except when OSR already disabled optimization for some reason.
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 } 1159 }
1160 } 1160 }
1161 1161
1162 GDBJIT(AddCode(Handle<String>(shared->DebugName()), 1162 GDBJIT(AddCode(Handle<String>(shared->DebugName()),
1163 Handle<Script>(info->script()), 1163 Handle<Script>(info->script()),
1164 Handle<Code>(info->code()), 1164 Handle<Code>(info->code()),
1165 info)); 1165 info));
1166 } 1166 }
1167 1167
1168 } } // namespace v8::internal 1168 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/deoptimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698