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

Side by Side Diff: src/runtime.cc

Issue 17099012: Use mutex instead of busy wait when installing optimized function. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fixed Created 7 years, 6 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/optimizing-compiler-thread.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 7894 matching lines...) Expand 10 before | Expand all | Expand 10 after
7905 Compiler::RecompileParallel(function); 7905 Compiler::RecompileParallel(function);
7906 return isolate->heap()->undefined_value(); 7906 return isolate->heap()->undefined_value();
7907 } 7907 }
7908 7908
7909 7909
7910 RUNTIME_FUNCTION(MaybeObject*, Runtime_InstallRecompiledCode) { 7910 RUNTIME_FUNCTION(MaybeObject*, Runtime_InstallRecompiledCode) {
7911 HandleScope handle_scope(isolate); 7911 HandleScope handle_scope(isolate);
7912 ASSERT(args.length() == 1); 7912 ASSERT(args.length() == 1);
7913 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); 7913 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
7914 ASSERT(V8::UseCrankshaft() && FLAG_parallel_recompilation); 7914 ASSERT(V8::UseCrankshaft() && FLAG_parallel_recompilation);
7915 OptimizingCompilerThread* opt_thread = isolate->optimizing_compiler_thread(); 7915 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions();
7916 do {
7917 // The function could have been marked for installing, but not queued just
7918 // yet. In this case, retry until installed.
7919 opt_thread->InstallOptimizedFunctions();
7920 } while (function->IsMarkedForInstallingRecompiledCode());
7921 return function->code(); 7916 return function->code();
7922 } 7917 }
7923 7918
7924 7919
7925 class ActivationsFinder : public ThreadVisitor { 7920 class ActivationsFinder : public ThreadVisitor {
7926 public: 7921 public:
7927 explicit ActivationsFinder(JSFunction* function) 7922 explicit ActivationsFinder(JSFunction* function)
7928 : function_(function), has_activations_(false) {} 7923 : function_(function), has_activations_(false) {}
7929 7924
7930 void VisitThread(Isolate* isolate, ThreadLocalTop* top) { 7925 void VisitThread(Isolate* isolate, ThreadLocalTop* top) {
(...skipping 5704 matching lines...) Expand 10 before | Expand all | Expand 10 after
13635 // Handle last resort GC and make sure to allow future allocations 13630 // Handle last resort GC and make sure to allow future allocations
13636 // to grow the heap without causing GCs (if possible). 13631 // to grow the heap without causing GCs (if possible).
13637 isolate->counters()->gc_last_resort_from_js()->Increment(); 13632 isolate->counters()->gc_last_resort_from_js()->Increment();
13638 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13633 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13639 "Runtime::PerformGC"); 13634 "Runtime::PerformGC");
13640 } 13635 }
13641 } 13636 }
13642 13637
13643 13638
13644 } } // namespace v8::internal 13639 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/optimizing-compiler-thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698