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

Side by Side Diff: src/runtime.cc

Issue 12488006: Parallel recompilation: remove interrupt for code generation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 7727 matching lines...) Expand 10 before | Expand all | Expand 10 after
7738 function->ReplaceCode(function->shared()->code()); 7738 function->ReplaceCode(function->shared()->code());
7739 return function->code(); 7739 return function->code();
7740 } 7740 }
7741 function->shared()->code()->set_profiler_ticks(0); 7741 function->shared()->code()->set_profiler_ticks(0);
7742 ASSERT(FLAG_parallel_recompilation); 7742 ASSERT(FLAG_parallel_recompilation);
7743 Compiler::RecompileParallel(function); 7743 Compiler::RecompileParallel(function);
7744 return isolate->heap()->undefined_value(); 7744 return isolate->heap()->undefined_value();
7745 } 7745 }
7746 7746
7747 7747
7748 RUNTIME_FUNCTION(MaybeObject*, Runtime_ForceParallelRecompile) {
7749 if (!V8::UseCrankshaft()) return isolate->heap()->undefined_value();
7750 HandleScope handle_scope(isolate);
7751 ASSERT(FLAG_parallel_recompilation && FLAG_manual_parallel_recompilation);
7752 if (!isolate->optimizing_compiler_thread()->IsQueueAvailable()) {
7753 return isolate->Throw(*isolate->factory()->InternalizeOneByteString(
7754 STATIC_ASCII_VECTOR("Recompile queue is full.")));
7755 }
7756 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0);
7757 fun->ReplaceCode(isolate->builtins()->builtin(Builtins::kParallelRecompile));
7758 Compiler::RecompileParallel(fun);
7759 return isolate->heap()->undefined_value();
7760 }
7761
7762
7763 RUNTIME_FUNCTION(MaybeObject*, Runtime_InstallRecompiledCode) { 7748 RUNTIME_FUNCTION(MaybeObject*, Runtime_InstallRecompiledCode) {
7764 if (!V8::UseCrankshaft()) return isolate->heap()->undefined_value(); 7749 if (!V8::UseCrankshaft()) return isolate->heap()->undefined_value();
7765 HandleScope handle_scope(isolate); 7750 HandleScope handle_scope(isolate);
7766 ASSERT(FLAG_parallel_recompilation && FLAG_manual_parallel_recompilation); 7751 ASSERT(FLAG_parallel_recompilation);
7767 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); 7752 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
Sven Panne 2013/03/12 15:44:51 Can we please move the argument access macros (and
Yang 2013/03/12 18:03:38 Done.
7768 OptimizingCompilerThread* opt_thread = isolate->optimizing_compiler_thread(); 7753 OptimizingCompilerThread* opt_thread = isolate->optimizing_compiler_thread();
7769 Handle<SharedFunctionInfo> shared(fun->shared()); 7754 opt_thread->InstallOptimizedFunctions();
7770 while (*opt_thread->InstallNextOptimizedFunction() != *shared) { } 7755 return function->code();
7771 return isolate->heap()->undefined_value();
7772 } 7756 }
7773 7757
7774 7758
7775 class ActivationsFinder : public ThreadVisitor { 7759 class ActivationsFinder : public ThreadVisitor {
7776 public: 7760 public:
7777 explicit ActivationsFinder(JSFunction* function) 7761 explicit ActivationsFinder(JSFunction* function)
7778 : function_(function), has_activations_(false) {} 7762 : function_(function), has_activations_(false) {}
7779 7763
7780 void VisitThread(Isolate* isolate, ThreadLocalTop* top) { 7764 void VisitThread(Isolate* isolate, ThreadLocalTop* top) {
7781 if (has_activations_) return; 7765 if (has_activations_) return;
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
7930 Code::kMaxLoopNestingMarker); 7914 Code::kMaxLoopNestingMarker);
7931 } else if (type->IsOneByteEqualTo(STATIC_ASCII_VECTOR("parallel"))) { 7915 } else if (type->IsOneByteEqualTo(STATIC_ASCII_VECTOR("parallel"))) {
7932 function->MarkForParallelRecompilation(); 7916 function->MarkForParallelRecompilation();
7933 } 7917 }
7934 } 7918 }
7935 7919
7936 return isolate->heap()->undefined_value(); 7920 return isolate->heap()->undefined_value();
7937 } 7921 }
7938 7922
7939 7923
7924 RUNTIME_FUNCTION(MaybeObject*, Runtime_WaitUntilOptimized) {
7925 RUNTIME_ASSERT(args.length() == 1);
7926 if (FLAG_parallel_recompilation) {
7927 HandleScope scope(isolate);
7928 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
Sven Panne 2013/03/12 15:44:51 Same as above.
Yang 2013/03/12 18:03:38 Done.
7929 if (V8::UseCrankshaft() && function->IsOptimizable()) {
7930 while (!function->IsOptimized()) OS::Sleep(50);
7931 }
7932 }
7933 return isolate->heap()->undefined_value();
7934 }
7935
7936
7940 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) { 7937 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) {
7941 HandleScope scope(isolate); 7938 HandleScope scope(isolate);
7942 ASSERT(args.length() == 1); 7939 ASSERT(args.length() == 1);
7943 // The least significant bit (after untagging) indicates whether the 7940 // The least significant bit (after untagging) indicates whether the
7944 // function is currently optimized, regardless of reason. 7941 // function is currently optimized, regardless of reason.
7945 if (!V8::UseCrankshaft()) { 7942 if (!V8::UseCrankshaft()) {
7946 return Smi::FromInt(4); // 4 == "never". 7943 return Smi::FromInt(4); // 4 == "never".
7947 } 7944 }
7948 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); 7945 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
7949 if (FLAG_parallel_recompilation) { 7946 if (FLAG_parallel_recompilation) {
(...skipping 5401 matching lines...) Expand 10 before | Expand all | Expand 10 after
13351 // Handle last resort GC and make sure to allow future allocations 13348 // Handle last resort GC and make sure to allow future allocations
13352 // to grow the heap without causing GCs (if possible). 13349 // to grow the heap without causing GCs (if possible).
13353 isolate->counters()->gc_last_resort_from_js()->Increment(); 13350 isolate->counters()->gc_last_resort_from_js()->Increment();
13354 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13351 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13355 "Runtime::PerformGC"); 13352 "Runtime::PerformGC");
13356 } 13353 }
13357 } 13354 }
13358 13355
13359 13356
13360 } } // namespace v8::internal 13357 } } // namespace v8::internal
OLDNEW
« src/optimizing-compiler-thread.cc ('K') | « src/runtime.h ('k') | src/runtime-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698