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

Side by Side Diff: src/runtime/runtime-test.cc

Issue 1082183003: Revert of Reland "Remove support for thread-based recompilation" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/runtime/runtime-compiler.cc ('k') | tools/gyp/v8.gyp » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/deoptimizer.h" 8 #include "src/deoptimizer.h"
9 #include "src/full-codegen.h" 9 #include "src/full-codegen.h"
10 #include "src/runtime/runtime-utils.h" 10 #include "src/runtime/runtime-utils.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 if (args.length() == 2) { 168 if (args.length() == 2) {
169 CONVERT_ARG_HANDLE_CHECKED(String, sync, 1); 169 CONVERT_ARG_HANDLE_CHECKED(String, sync, 1);
170 if (sync->IsOneByteEqualTo(STATIC_CHAR_VECTOR("no sync"))) { 170 if (sync->IsOneByteEqualTo(STATIC_CHAR_VECTOR("no sync"))) {
171 sync_with_compiler_thread = false; 171 sync_with_compiler_thread = false;
172 } 172 }
173 } 173 }
174 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); 174 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
175 if (isolate->concurrent_recompilation_enabled() && 175 if (isolate->concurrent_recompilation_enabled() &&
176 sync_with_compiler_thread) { 176 sync_with_compiler_thread) {
177 while (function->IsInOptimizationQueue()) { 177 while (function->IsInOptimizationQueue()) {
178 isolate->optimizing_compile_dispatcher()->InstallOptimizedFunctions(); 178 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions();
179 base::OS::Sleep(50); 179 base::OS::Sleep(50);
180 } 180 }
181 } 181 }
182 if (FLAG_always_opt) { 182 if (FLAG_always_opt) {
183 // We may have always opt, but that is more best-effort than a real 183 // We may have always opt, but that is more best-effort than a real
184 // promise, so we still say "no" if it is not optimized. 184 // promise, so we still say "no" if it is not optimized.
185 return function->IsOptimized() ? Smi::FromInt(3) // 3 == "always". 185 return function->IsOptimized() ? Smi::FromInt(3) // 3 == "always".
186 : Smi::FromInt(2); // 2 == "no". 186 : Smi::FromInt(2); // 2 == "no".
187 } 187 }
188 if (FLAG_deopt_every_n_times) { 188 if (FLAG_deopt_every_n_times) {
189 return Smi::FromInt(6); // 6 == "maybe deopted". 189 return Smi::FromInt(6); // 6 == "maybe deopted".
190 } 190 }
191 if (function->IsOptimized() && function->code()->is_turbofanned()) { 191 if (function->IsOptimized() && function->code()->is_turbofanned()) {
192 return Smi::FromInt(7); // 7 == "TurboFan compiler". 192 return Smi::FromInt(7); // 7 == "TurboFan compiler".
193 } 193 }
194 return function->IsOptimized() ? Smi::FromInt(1) // 1 == "yes". 194 return function->IsOptimized() ? Smi::FromInt(1) // 1 == "yes".
195 : Smi::FromInt(2); // 2 == "no". 195 : Smi::FromInt(2); // 2 == "no".
196 } 196 }
197 197
198 198
199 RUNTIME_FUNCTION(Runtime_UnblockConcurrentRecompilation) { 199 RUNTIME_FUNCTION(Runtime_UnblockConcurrentRecompilation) {
200 DCHECK(args.length() == 0); 200 DCHECK(args.length() == 0);
201 RUNTIME_ASSERT(FLAG_block_concurrent_recompilation); 201 RUNTIME_ASSERT(FLAG_block_concurrent_recompilation);
202 RUNTIME_ASSERT(isolate->concurrent_recompilation_enabled()); 202 RUNTIME_ASSERT(isolate->concurrent_recompilation_enabled());
203 isolate->optimizing_compile_dispatcher()->Unblock(); 203 isolate->optimizing_compiler_thread()->Unblock();
204 return isolate->heap()->undefined_value(); 204 return isolate->heap()->undefined_value();
205 } 205 }
206 206
207 207
208 RUNTIME_FUNCTION(Runtime_GetOptimizationCount) { 208 RUNTIME_FUNCTION(Runtime_GetOptimizationCount) {
209 HandleScope scope(isolate); 209 HandleScope scope(isolate);
210 DCHECK(args.length() == 1); 210 DCHECK(args.length() == 1);
211 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); 211 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
212 return Smi::FromInt(function->shared()->opt_count()); 212 return Smi::FromInt(function->shared()->opt_count());
213 } 213 }
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \ 484 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \
485 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ 485 CONVERT_ARG_CHECKED(JSObject, obj, 0); \
486 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \ 486 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \
487 } 487 }
488 488
489 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION) 489 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION)
490 490
491 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION 491 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION
492 } 492 }
493 } // namespace v8::internal 493 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime-compiler.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698