OLD | NEW |
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 8079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8090 } | 8090 } |
8091 } else if (type->IsOneByteEqualTo(STATIC_ASCII_VECTOR("parallel"))) { | 8091 } else if (type->IsOneByteEqualTo(STATIC_ASCII_VECTOR("parallel"))) { |
8092 function->MarkForParallelRecompilation(); | 8092 function->MarkForParallelRecompilation(); |
8093 } | 8093 } |
8094 } | 8094 } |
8095 | 8095 |
8096 return isolate->heap()->undefined_value(); | 8096 return isolate->heap()->undefined_value(); |
8097 } | 8097 } |
8098 | 8098 |
8099 | 8099 |
8100 RUNTIME_FUNCTION(MaybeObject*, Runtime_WaitUntilOptimized) { | 8100 RUNTIME_FUNCTION(MaybeObject*, Runtime_CompleteOptimization) { |
8101 HandleScope scope(isolate); | 8101 HandleScope scope(isolate); |
8102 ASSERT(args.length() == 1); | 8102 ASSERT(args.length() == 1); |
8103 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 8103 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
8104 if (FLAG_parallel_recompilation) { | 8104 if (FLAG_parallel_recompilation && V8::UseCrankshaft()) { |
8105 if (V8::UseCrankshaft() && function->IsOptimizable()) { | 8105 // While function is in optimization pipeline, it is marked with builtins. |
8106 while (!function->IsOptimized()) OS::Sleep(50); | 8106 while (function->code()->kind() == Code::BUILTIN) { |
| 8107 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); |
| 8108 OS::Sleep(50); |
8107 } | 8109 } |
8108 } | 8110 } |
8109 return isolate->heap()->undefined_value(); | 8111 return isolate->heap()->undefined_value(); |
8110 } | 8112 } |
8111 | 8113 |
8112 | 8114 |
8113 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) { | 8115 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) { |
8114 HandleScope scope(isolate); | 8116 HandleScope scope(isolate); |
8115 ASSERT(args.length() == 1); | 8117 ASSERT(args.length() == 1); |
8116 // The least significant bit (after untagging) indicates whether the | 8118 // The least significant bit (after untagging) indicates whether the |
(...skipping 5516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13633 // Handle last resort GC and make sure to allow future allocations | 13635 // Handle last resort GC and make sure to allow future allocations |
13634 // to grow the heap without causing GCs (if possible). | 13636 // to grow the heap without causing GCs (if possible). |
13635 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13637 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13636 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13638 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13637 "Runtime::PerformGC"); | 13639 "Runtime::PerformGC"); |
13638 } | 13640 } |
13639 } | 13641 } |
13640 | 13642 |
13641 | 13643 |
13642 } } // namespace v8::internal | 13644 } } // namespace v8::internal |
OLD | NEW |