18 DCHECK(args.length() == 1);
20 if (!function->IsOptimized())
return isolate->heap()->undefined_value();
23 if (function->code()->is_turbofanned() && !FLAG_turbo_deoptimization) {
24 return isolate->heap()->undefined_value();
29 return isolate->heap()->undefined_value();
34 SealHandleScope shs(isolate);
35 DCHECK(args.length() == 0);
36 #if defined(USE_SIMULATOR)
37 return isolate->heap()->true_value();
39 return isolate->heap()->false_value();
45 SealHandleScope shs(isolate);
46 DCHECK(args.length() == 0);
47 return isolate->heap()->ToBoolean(
48 isolate->concurrent_recompilation_enabled());
60 (function->code()->kind() == Code::FUNCTION &&
61 function->code()->optimizable()));
64 if (function->IsOptimized())
return isolate->heap()->undefined_value();
66 function->MarkForOptimization();
68 Code* unoptimized =
function->shared()->code();
69 if (args.length() == 2 && unoptimized->
kind() == Code::FUNCTION) {
73 DCHECK(BackEdgeTable::Verify(isolate, unoptimized));
74 isolate->runtime_profiler()->AttemptOnStackReplacement(
77 isolate->concurrent_recompilation_enabled()) {
78 function->MarkForConcurrentOptimization();
82 return isolate->heap()->undefined_value();
88 DCHECK(args.length() == 1);
90 function->shared()->set_optimization_disabled(
true);
91 return isolate->heap()->undefined_value();
98 if (!isolate->use_crankshaft()) {
101 bool sync_with_compiler_thread =
true;
102 if (args.length() == 2) {
105 sync_with_compiler_thread =
false;
109 if (isolate->concurrent_recompilation_enabled() &&
110 sync_with_compiler_thread) {
111 while (function->IsInOptimizationQueue()) {
112 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions();
116 if (FLAG_always_opt) {
122 if (FLAG_deopt_every_n_times) {
125 if (function->IsOptimized() && function->code()->is_turbofanned()) {
134 DCHECK(args.length() == 0);
137 isolate->optimizing_compiler_thread()->Unblock();
138 return isolate->heap()->undefined_value();
144 DCHECK(args.length() == 1);
152 DCHECK(args.length() == 1);
154 function->shared()->ClearTypeFeedbackInfo();
155 Code* unoptimized =
function->shared()->code();
156 if (unoptimized->
kind() == Code::FUNCTION) {
159 return isolate->heap()->undefined_value();
165 DCHECK(args.length() == 0);
166 isolate->heap()->NotifyContextDisposed();
167 return isolate->heap()->undefined_value();
172 SealHandleScope shs(isolate);
173 DCHECK(args.length() == 2 || args.length() == 3);
177 isolate->heap()->set_allocation_timeout(timeout);
178 FLAG_gc_interval = interval;
179 if (args.length() == 3) {
182 if (inline_allocation) {
183 isolate->heap()->EnableInlineAllocation();
185 isolate->heap()->DisableInlineAllocation();
189 return isolate->heap()->undefined_value();
194 SealHandleScope shs(isolate);
195 DCHECK(args.length() == 1);
199 if (args[0]->IsString()) {
202 JavaScriptFrameIterator it(isolate);
204 os <<
"fp = " << frame->fp() <<
", sp = " << frame->sp()
205 <<
", caller_sp = " << frame->caller_sp() <<
": ";
207 os <<
"DebugPrint: ";
210 if (args[0]->IsHeapObject()) {
212 HeapObject::cast(args[0])->map()->Print(os);
216 os <<
Brief(args[0]);
225 SealHandleScope shs(isolate);
226 DCHECK(args.length() == 0);
227 isolate->PrintStack(stdout);
228 return isolate->heap()->undefined_value();
235 SealHandleScope shs(isolate);
236 DCHECK(args.length() == 1);
250 SealHandleScope shs(isolate);
251 DCHECK(args.length() == 0);
253 return isolate->heap()->undefined_value();
259 SealHandleScope shs(isolate);
260 DCHECK(args.length() == 1);
265 return isolate->heap()->undefined_value();
270 SealHandleScope shs(isolate);
271 DCHECK(args.length() == 1);
273 const char* message =
276 isolate->PrintStack(stderr);
285 DCHECK(args.length() == 1);
288 isolate->PrintStack(stderr);
296 SealHandleScope shs(isolate);
297 DCHECK(args.length() == 2);
300 return isolate->heap()->ToBoolean(obj1->map() == obj2->map());
304 #define ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(Name) \
305 RUNTIME_FUNCTION(Runtime_Has##Name) { \
306 CONVERT_ARG_CHECKED(JSObject, obj, 0); \
307 return isolate->heap()->ToBoolean(obj->Has##Name()); \
321 #undef ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION
static void Sleep(const int milliseconds)
static void PrintError(const char *format,...)
static const int kMaxLoopNestingMarker
static void DeoptimizeFunction(JSFunction *function)
static int SetFlagsFromString(const char *str, int len)
static Smi * FromInt(int value)
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define DCHECK(condition)
OStream & endl(OStream &os)
@ ROBUST_STRING_TRAVERSAL
const char * GetBailoutReason(BailoutReason reason)
void PrintF(const char *format,...)
int StrLength(const char *string)
Debugger support for the V8 JavaScript engine.
#define ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(Name)
#define CONVERT_BOOLEAN_ARG_CHECKED(name, index)
#define CONVERT_ARG_CHECKED(Type, name, index)
#define RUNTIME_ASSERT(value)
#define CONVERT_ARG_HANDLE_CHECKED(Type, name, index)
#define CONVERT_SMI_ARG_CHECKED(name, index)
#define STATIC_CHAR_VECTOR(x)