OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |