59 : flags_(StrictModeField::encode(
SLOPPY)),
64 optimization_id_(-1) {
65 Initialize(script->GetIsolate(), BASE,
zone);
71 : flags_(StrictModeField::encode(
SLOPPY) | IsLazy::encode(
true)),
72 shared_info_(shared_info),
77 optimization_id_(-1) {
78 Initialize(script_->GetIsolate(), BASE,
zone);
84 : flags_(StrictModeField::encode(
SLOPPY) | IsLazy::encode(
true)),
88 context_(closure->context()),
92 optimization_id_(-1) {
93 Initialize(script_->GetIsolate(), BASE,
zone);
100 : flags_(StrictModeField::encode(
SLOPPY) | IsLazy::encode(
true)),
103 this_has_uses_(
true),
104 optimization_id_(-1) {
105 Initialize(isolate, STUB, zone);
110 void CompilationInfo::Initialize(
Isolate* isolate,
116 global_scope_ =
NULL;
121 deferred_handles_ =
NULL;
125 no_frame_ranges_ = isolate->
cpu_profiler()->is_profiling()
128 dependencies_[i] =
NULL;
135 abort_due_to_dependency_ =
false;
139 if (!shared_info_.is_null()) {
148 delete deferred_handles_;
149 delete no_frame_ranges_;
163 if (group_objects ==
NULL)
continue;
164 ASSERT(!object_wrapper_.is_null());
165 for (
int j = 0; j < group_objects->length(); j++) {
172 dependencies_[i] =
NULL;
181 if (group_objects ==
NULL)
continue;
182 for (
int j = 0; j < group_objects->length(); j++) {
189 dependencies_[i] =
NULL;
196 ASSERT(parameter_count_ > 0);
197 return parameter_count_;
227 bool is_optimizable_closure =
228 FLAG_optimize_closures &&
229 closure_.is_null() &&
233 SetMode(is_optimizable_closure ? BASE : NONOPT);
241 return FLAG_crankshaft &&
243 !
function()->dont_optimize() &&
252 function()->ProcessFeedbackSlots(isolate_);
262 #define DEF_VISIT(type) \
263 virtual void Visit##type(type* node) V8_OVERRIDE { \
264 if (node->position() != RelocInfo::kNoPosition) { \
265 SetSourcePosition(node->position()); \
267 HOptimizedGraphBuilder::Visit##type(node); \
272 #define DEF_VISIT(type) \
273 virtual void Visit##type(type* node) V8_OVERRIDE { \
274 if (node->position() != RelocInfo::kNoPosition) { \
275 SetSourcePosition(node->position()); \
277 HOptimizedGraphBuilder::Visit##type(node); \
282 #define DEF_VISIT(type) \
283 virtual void Visit##type(type* node) V8_OVERRIDE { \
284 HOptimizedGraphBuilder::Visit##type(node); \
300 static bool IsDebuggerActive(Isolate* isolate) {
301 #ifdef ENABLE_DEBUGGER_SUPPORT
302 return isolate->use_crankshaft() ?
303 isolate->debug()->has_break_points() :
304 isolate->debugger()->IsDebuggerActive();
322 ASSERT(!
info()->shared_info()->optimization_disabled());
332 const int kMaxOptCount =
333 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000;
334 if (
info()->opt_count() > kMaxOptCount) {
352 if (
info()->is_osr() &&
358 if (!
info()->closure()->PassesFilter(FLAG_hydrogen_filter)) {
366 bool should_recompile = !
info()->
shared_info()->has_deoptimization_support();
367 if (should_recompile || FLAG_hydrogen_stats) {
369 if (FLAG_hydrogen_stats) {
380 if (should_recompile) {
381 if (!succeeded)
return SetLastStatus(
FAILED);
383 shared->EnableDeoptimizationSupport(*unoptimized.
code());
386 Logger::LAZY_COMPILE_TAG, &unoptimized, shared);
388 if (FLAG_hydrogen_stats) {
398 ASSERT(FLAG_always_opt ||
info()->shared_info()->
code()->optimizable());
399 ASSERT(
info()->shared_info()->has_deoptimization_support());
401 if (FLAG_trace_hydrogen) {
403 PrintF(
"-----------------------------------------------------------\n");
404 PrintF(
"Compiling method %s using hydrogen\n", name->ToCString().get());
411 graph_builder_ = FLAG_hydrogen_track_positions
415 Timer t(
this, &time_taken_to_create_graph_);
419 if (
isolate()->has_pending_exception()) {
420 return SetLastStatus(
FAILED);
427 if (graph_ ==
NULL) {
435 if (
info()->HasAbortedDueToDependencyChange()) {
450 Timer t(
this, &time_taken_to_optimize_);
454 if (graph_->Optimize(&bailout_reason)) {
457 }
else if (bailout_reason != kNoReason) {
458 graph_builder_->
Bailout(bailout_reason);
467 ASSERT(!
info()->HasAbortedDueToDependencyChange());
470 Timer timer(
this, &time_taken_to_codegen_);
479 if (optimized_code.
is_null()) {
487 RecordOptimizationStats();
494 void OptimizedCompileJob::RecordOptimizationStats() {
496 if (!function->IsOptimized()) {
498 int opt_count =
function->shared()->opt_count();
499 function->shared()->set_opt_count(opt_count + 1);
501 double ms_creategraph = time_taken_to_create_graph_.InMillisecondsF();
502 double ms_optimize = time_taken_to_optimize_.InMillisecondsF();
503 double ms_codegen = time_taken_to_codegen_.InMillisecondsF();
504 if (FLAG_trace_opt) {
506 function->ShortPrint();
507 PrintF(
" - took %0.3f, %0.3f, %0.3f ms]\n", ms_creategraph, ms_optimize,
510 if (FLAG_trace_opt_stats) {
511 static double compilation_time = 0.0;
512 static int compiled_functions = 0;
513 static int code_size = 0;
515 compilation_time += (ms_creategraph + ms_optimize + ms_codegen);
516 compiled_functions++;
517 code_size +=
function->shared()->SourceSize();
518 PrintF(
"Compiled: %d functions with %d byte source size in %fms.\n",
523 if (FLAG_hydrogen_stats) {
525 time_taken_to_optimize_,
526 time_taken_to_codegen_);
535 if (shared->live_objects_may_exist())
return;
539 if (estimate == 0) estimate = 2;
546 }
else if (FLAG_clever_optimizations) {
554 shared->set_expected_nof_properties(estimate);
558 static void UpdateSharedFunctionInfo(CompilationInfo*
info) {
567 shared->set_scope_info(*scope_info);
575 FunctionLiteral* lit = info->function();
576 int expected = lit->expected_property_count();
582 shared->set_dont_inline(lit->flags()->Contains(
kDontInline));
592 static void SetFunctionInfo(Handle<SharedFunctionInfo> function_info,
593 FunctionLiteral* lit,
595 Handle<Script> script) {
596 function_info->set_length(lit->parameter_count());
597 function_info->set_formal_parameter_count(lit->parameter_count());
598 function_info->set_script(*script);
599 function_info->set_function_token_position(lit->function_token_position());
600 function_info->set_start_position(lit->start_position());
601 function_info->set_end_position(lit->end_position());
602 function_info->set_is_expression(lit->is_expression());
603 function_info->set_is_anonymous(lit->is_anonymous());
604 function_info->set_is_toplevel(is_toplevel);
605 function_info->set_inferred_name(*lit->inferred_name());
606 function_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation());
607 function_info->set_allows_lazy_compilation_without_context(
608 lit->AllowsLazyCompilationWithoutContext());
609 function_info->set_strict_mode(lit->strict_mode());
610 function_info->set_uses_arguments(lit->scope()->arguments() !=
NULL);
611 function_info->set_has_duplicate_parameters(lit->has_duplicate_parameters());
612 function_info->set_ast_node_count(lit->ast_node_count());
613 function_info->set_is_function(lit->is_function());
614 function_info->set_dont_optimize_reason(lit->dont_optimize_reason());
615 function_info->set_dont_inline(lit->flags()->Contains(
kDontInline));
616 function_info->set_dont_cache(lit->flags()->Contains(
kDontCache));
617 function_info->set_is_generator(lit->is_generator());
621 static bool CompileUnoptimizedCode(CompilationInfo* info) {
628 Isolate* isolate = info->isolate();
629 if (!isolate->has_pending_exception()) isolate->
StackOverflow();
636 static Handle<Code> GetUnoptimizedCodeCommon(CompilationInfo* info) {
637 VMState<COMPILER> state(info->isolate());
638 PostponeInterruptsScope postpone(info->isolate());
640 info->SetStrictMode(info->function()->strict_mode());
642 if (!CompileUnoptimizedCode(info))
return Handle<Code>::null();
644 Logger::LAZY_COMPILE_TAG, info, info->shared_info());
645 UpdateSharedFunctionInfo(info);
646 ASSERT_EQ(Code::FUNCTION, info->code()->kind());
652 ASSERT(!function->GetIsolate()->has_pending_exception());
653 ASSERT(!function->is_compiled());
654 if (function->shared()->is_compiled()) {
662 if (FLAG_always_opt &&
669 if (!opt_code.
is_null()) result = opt_code;
677 ASSERT(!shared->GetIsolate()->has_pending_exception());
678 ASSERT(!shared->is_compiled());
689 if (function->is_compiled())
return true;
693 function->GetIsolate()->clear_pending_exception();
697 function->ReplaceCode(*code);
698 ASSERT(function->is_compiled());
719 ASSERT(old_code->kind() == Code::FUNCTION);
720 ASSERT(!old_code->has_debug_break_slots());
723 if (old_code->is_compiled_optimizable()) {
728 Handle<Code> new_code = GetUnoptimizedCodeCommon(&info);
732 ASSERT_EQ(old_code->is_compiled_optimizable(),
733 new_code->is_compiled_optimizable());
739 #ifdef ENABLE_DEBUGGER_SUPPORT
743 PostponeInterruptsScope postpone(info.isolate());
748 info.SetStrictMode(info.function()->strict_mode());
751 if (!CompileUnoptimizedCode(&info))
return;
752 if (!info.shared_info().is_null()) {
755 info.shared_info()->set_scope_info(*scope_info);
757 tracker.RecordRootFunctionInfo(info.code());
762 static bool DebuggerWantsEagerCompilation(CompilationInfo* info,
763 bool allow_lazy_without_ctx =
false) {
765 (info->isolate()->DebuggerHasBreakPoints() && !allow_lazy_without_ctx);
769 static Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
770 Isolate* isolate = info->isolate();
771 PostponeInterruptsScope postpone(isolate);
772 ASSERT(!isolate->native_context().is_null());
773 Handle<Script> script = info->script();
776 FixedArray* array = isolate->native_context()->embedder_data();
777 script->set_context_data(array->get(0));
779 #ifdef ENABLE_DEBUGGER_SUPPORT
780 isolate->debugger()->OnBeforeCompile(script);
783 ASSERT(info->is_eval() || info->is_global());
785 bool parse_allow_lazy =
787 String::cast(script->source())->length() > FLAG_min_preparse_length) &&
788 !DebuggerWantsEagerCompilation(info);
790 if (!parse_allow_lazy && info->cached_data_mode() !=
NO_CACHED_DATA) {
800 Handle<SharedFunctionInfo> result;
802 { VMState<COMPILER> state(info->isolate());
807 FunctionLiteral* lit = info->function();
808 LiveEditFunctionTracker live_edit_tracker(isolate, lit);
813 HistogramTimer* rate = info->is_eval()
814 ? info->isolate()->counters()->compile_eval()
815 : info->isolate()->counters()->compile();
816 HistogramTimerScope timer(rate);
819 if (!CompileUnoptimizedCode(info)) {
824 ASSERT(!info->code().is_null());
825 result = isolate->factory()->NewSharedFunctionInfo(
827 lit->materialized_literal_count(),
832 ASSERT_EQ(RelocInfo::kNoPosition, lit->function_token_position());
833 SetFunctionInfo(result, lit,
true, script);
835 Handle<String> script_name = script->name()->IsString()
837 : isolate->factory()->empty_string();
840 : Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script);
842 PROFILE(isolate, CodeCreateEvent(
843 log_tag, *info->code(), *result,
info, *script_name));
844 GDBJIT(AddCode(script_name, script, info->code(),
info));
850 lit->expected_property_count());
854 live_edit_tracker.RecordFunctionInfo(result, lit, info->zone());
857 #ifdef ENABLE_DEBUGGER_SUPPORT
858 isolate->debugger()->OnAfterCompile(script, Debugger::NO_AFTER_COMPILE_FLAGS);
869 int scope_position) {
870 Isolate* isolate = source->GetIsolate();
871 int source_length = source->length();
872 isolate->
counters()->total_eval_size()->Increment(source_length);
873 isolate->
counters()->total_compile_size()->Increment(source_length);
877 source, context, strict_mode, scope_position);
888 #if ENABLE_DEBUGGER_SUPPORT
889 Debug::RecordEvalCaller(script);
890 #endif // ENABLE_DEBUGGER_SUPPORT
892 shared_info = CompileToplevel(&info);
899 shared_info->DisableOptimization(kEval);
903 if (!shared_info->dont_cache()) {
905 source, context, shared_info, scope_position);
922 bool is_shared_cross_origin,
931 ASSERT(cached_data && !*cached_data);
934 ASSERT(cached_data && *cached_data);
936 Isolate* isolate = source->GetIsolate();
937 int source_length = source->length();
938 isolate->
counters()->total_load_size()->Increment(source_length);
939 isolate->
counters()->total_compile_size()->Increment(source_length);
945 if (extension ==
NULL) {
950 is_shared_cross_origin,
969 if (!script_name.is_null()) {
970 script->set_name(*script_name);
974 script->set_is_shared_cross_origin(is_shared_cross_origin);
983 result = CompileToplevel(&info);
984 if (extension ==
NULL && !result.
is_null() && !result->dont_cache()) {
985 compilation_cache->
PutScript(source, context, result);
1016 bool allow_lazy_without_ctx = literal->AllowsLazyCompilationWithoutContext();
1017 bool allow_lazy = literal->AllowsLazyCompilation() &&
1018 !DebuggerWantsEagerCompilation(&info, allow_lazy_without_ctx);
1022 if (FLAG_lazy && allow_lazy && !literal->is_parenthesized()) {
1036 literal->materialized_literal_count(),
1037 literal->is_generator(),
1040 SetFunctionInfo(result, literal,
false, script);
1042 result->set_allows_lazy_compilation(allow_lazy);
1043 result->set_allows_lazy_compilation_without_context(allow_lazy_without_ctx);
1048 literal->expected_property_count());
1056 if (FLAG_cache_optimized_code) {
1060 function->context()->native_context(), osr_ast_id);
1062 if (FLAG_trace_opt) {
1063 PrintF(
"[found optimized code for ");
1064 function->ShortPrint();
1065 if (!osr_ast_id.
IsNone()) {
1071 if (literals !=
NULL)
function->set_literals(literals);
1079 static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) {
1080 Handle<Code> code = info->code();
1081 if (code->kind() != Code::OPTIMIZED_FUNCTION)
return;
1084 if (FLAG_cache_optimized_code) {
1085 Handle<JSFunction>
function = info->closure();
1086 Handle<SharedFunctionInfo> shared(function->shared());
1087 Handle<FixedArray>
literals(function->literals());
1088 Handle<Context> native_context(function->context()->native_context());
1090 shared, native_context, code, literals, info->osr_ast_id());
1095 static bool CompileOptimizedPrologue(CompilationInfo* info) {
1097 info->SetStrictMode(info->function()->strict_mode());
1106 static bool GetOptimizedCodeNow(CompilationInfo* info) {
1107 if (!CompileOptimizedPrologue(info))
return false;
1109 Logger::TimerEventScope timer(
1112 OptimizedCompileJob job(info);
1118 ASSERT(!info->isolate()->has_pending_exception());
1119 InsertCodeIntoOptimizedCodeMap(info);
1121 Logger::LAZY_COMPILE_TAG, info, info->shared_info());
1126 static bool GetOptimizedCodeLater(CompilationInfo* info) {
1127 Isolate* isolate = info->isolate();
1128 if (!isolate->optimizing_compiler_thread()->IsQueueAvailable()) {
1129 if (FLAG_trace_concurrent_recompilation) {
1130 PrintF(
" ** Compilation queue full, will retry optimizing ");
1131 info->closure()->PrintName();
1137 CompilationHandleScope handle_scope(info);
1138 if (!CompileOptimizedPrologue(info))
return false;
1139 info->SaveHandles();
1141 Logger::TimerEventScope timer(
1144 OptimizedCompileJob* job =
new(info->zone()) OptimizedCompileJob(info);
1147 isolate->optimizing_compiler_thread()->QueueForOptimization(job);
1149 if (FLAG_trace_concurrent_recompilation) {
1151 info->closure()->PrintName();
1152 if (info->is_osr()) {
1153 PrintF(
" for concurrent OSR at %d.\n", info->osr_ast_id().ToInt());
1155 PrintF(
" for concurrent optimization.\n");
1166 Handle<Code> cached_code = GetCodeFromOptimizedCodeMap(
function, osr_ast_id);
1167 if (!cached_code.
is_null())
return cached_code;
1170 Isolate* isolate = info->isolate();
1173 PostponeInterruptsScope postpone(isolate);
1177 int compiled_size = shared->end_position() - shared->start_position();
1178 isolate->
counters()->total_compile_size()->Increment(compiled_size);
1179 current_code->set_profiler_ticks(0);
1181 info->SetOptimizing(osr_ast_id, current_code);
1184 if (GetOptimizedCodeLater(info.
get())) {
1186 return isolate->
builtins()->InOptimizationQueue();
1189 if (GetOptimizedCodeNow(info.
get()))
return info->code();
1193 if (FLAG_trace_opt) {
1194 PrintF(
"[failed to optimize ");
1195 function->PrintName();
1208 Isolate* isolate = info->isolate();
1215 shared->code()->set_profiler_ticks(0);
1224 shared->optimization_disabled() ||
1225 info->HasAbortedDueToDependencyChange() ||
1226 isolate->DebuggerHasBreakPoints()) {
1235 Logger::LAZY_COMPILE_TAG, info.get(), shared);
1236 if (info->shared_info()->SearchOptimizedCodeMap(
1237 info->context()->native_context(), info->osr_ast_id()) == -1) {
1238 InsertCodeIntoOptimizedCodeMap(info.get());
1241 if (FLAG_trace_concurrent_recompilation) {
1242 PrintF(
" ** Optimized code for ");
1243 info->closure()->PrintName();
1264 if (code.is_identical_to(info->
isolate()->
builtins()->CompileUnoptimized()))
1270 String* script_name = script->name()->IsString()
1275 log_tag, *code, *shared, info, script_name, line_num, column_num));
1286 : name_(name), info_(info), zone_(info->isolate()) {
1287 if (FLAG_hydrogen_stats) {
1294 CompilationPhase::~CompilationPhase() {
1295 if (FLAG_hydrogen_stats) {
1297 size += info_->zone()->allocation_size() - info_zone_start_allocation_size_;
1298 isolate()->GetHStatistics()->SaveTiming(name_, timer_.Elapsed(),
size);
1303 bool CompilationPhase::ShouldProduceTraceOutput()
const {
1307 bool tracing_on =
info()->IsStub()
1308 ? FLAG_trace_hydrogen_stubs
1309 : (FLAG_trace_hydrogen &&
1310 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter));
1311 return (tracing_on &&
1312 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) !=
NULL);
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
Failure * StackOverflow()
BailoutReason bailout_reason() const
static DependentCode * ForObject(Handle< HeapObject > object, DependencyGroup group)
Handle< JSFunction > NewFunctionFromSharedFunctionInfo(Handle< SharedFunctionInfo > function_info, Handle< Context > context, PretenureFlag pretenure=TENURED)
static bool IsActive(Isolate *isolate)
#define PROFILE(IsolateGetter, Call)
static Handle< SharedFunctionInfo > CompileScript(Handle< String > source, Handle< Object > script_name, int line_offset, int column_offset, bool is_shared_cross_origin, Handle< Context > context, v8::Extension *extension, ScriptDataImpl **cached_data, CachedDataMode cached_data_mode, NativesFlag is_natives_code)
void MarkCompilingForDebugging()
static Handle< Code > GetCodeForDebugging(Handle< JSFunction > function)
void PrepareForCompilation(Scope *scope)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths true
CompilationCache * compilation_cache()
void SetParseRestriction(ParseRestriction restriction)
void PrintF(const char *format,...)
static String * cast(Object *obj)
void SetCode(Handle< Code > code)
static Smi * FromInt(int value)
static bool MakeCode(CompilationInfo *info)
static Handle< Code > GetUnoptimizedCode(Handle< JSFunction > function)
Handle< Script > NewScript(Handle< String > source)
static Handle< JSFunction > GetFunctionFromEval(Handle< String > source, Handle< Context > context, StrictMode strict_mode, ParseRestriction restriction, int scope_position)
Handle< Script > script() const
static bool Analyze(CompilationInfo *info)
void EnableDeoptimizationSupport()
MUST_USE_RESULT Status AbortOptimization(BailoutReason reason=kNoReason)
Handle< SharedFunctionInfo > LookupScript(Handle< String > source, Handle< Object > name, int line_offset, int column_offset, bool is_shared_cross_origin, Handle< Context > context)
bool is_logging_code_events()
void set_this_has_uses(bool has_no_uses)
void set_bailout_reason(BailoutReason reason)
HOptimizedGraphBuilderWithPositions(CompilationInfo *info)
Handle< SharedFunctionInfo > LookupEval(Handle< String > source, Handle< Context > context, StrictMode strict_mode, int scope_position)
static ScopeInfo * Empty(Isolate *isolate)
Isolate * isolate() const
static bool EnsureCompiled(Handle< JSFunction > function, ClearExceptionFlag flag)
#define ASSERT(condition)
void set_optimizable(bool value)
void clear_pending_exception()
void SetExtension(v8::Extension *extension)
int GetScriptColumnNumber(Handle< Script > script, int code_pos)
MUST_USE_RESULT MaybeObject * AddToOptimizedCodeMap(Context *native_context, Code *code, FixedArray *literals, BailoutId osr_ast_id)
int num_parameters() const
void SetExpectedNofPropertiesFromEstimate(Handle< SharedFunctionInfo > shared, int estimate)
static const int kMaxFixedSlotIndex
#define STATEMENT_NODE_LIST(V)
static Handle< ScopeInfo > Create(Scope *scope, Zone *zone)
void PutScript(Handle< String > source, Handle< Context > context, Handle< SharedFunctionInfo > function_info)
kInstanceClassNameOffset flag
bool HasTrivialOuterContext() const
void DisableOptimization()
bool AllowsLazyCompilation() const
Code * GetCodeFromOptimizedCodeMap(int index)
Handle< SharedFunctionInfo > NewSharedFunctionInfo(Handle< String > name, int number_of_literals, bool is_generator, Handle< Code > code, Handle< ScopeInfo > scope_info)
void Bailout(BailoutReason reason)
static Handle< Code > GetConcurrentlyOptimizedCode(OptimizedCompileJob *job)
void RemoveCompilationInfo(DependentCode::DependencyGroup group, CompilationInfo *info)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV 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 mode(MIPS only)") DEFINE_string(expose_natives_as
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object size
void ReportPendingMessages()
void PutEval(Handle< String > source, Handle< Context > context, Handle< SharedFunctionInfo > function_info, int scope_position)
Status last_status() const
void ReplaceCode(Code *code)
int num_stack_slots() const
Handle< Code > code() const
FunctionLiteral * function() const
static Handle< Code > GetOptimizedCode(Handle< JSFunction > function, Handle< Code > current_code, ConcurrencyMode mode, BailoutId osr_ast_id=BailoutId::None())
bool ShouldSelfOptimize()
Code::Flags flags() const
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
static LChunk * NewChunk(HGraph *graph)
int num_parameters() const
bool has_pending_exception()
CompilationInfo * info() const
Handle< JSFunction > closure() const
bool use_crankshaft() const
int num_heap_slots() const
void RecordFunctionInfo(Handle< SharedFunctionInfo > info, FunctionLiteral *lit, Zone *zone)
void set_dont_optimize_reason(BailoutReason reason)
int GetScriptLineNumber(Handle< Script > script, int code_pos)
void MarkNonOptimizable()
void SetContext(Handle< Context > context)
HydrogenCodeStub * code_stub() const
int num_heap_slots() const
const char * GetBailoutReason(BailoutReason reason)
Isolate * isolate() const
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function info
Handle< Context > context() const
CpuProfiler * cpu_profiler() const
void CommitDependencies(Handle< Code > code)
void SetStrictMode(StrictMode strict_mode)
static Flags ComputeFlags(Kind kind, InlineCacheState ic_state=UNINITIALIZED, ExtraICState extra_ic_state=kNoExtraICState, StubType type=NORMAL, InlineCacheHolderFlag holder=OWN_MAP)
FixedArray * GetLiteralsFromOptimizedCodeMap(int index)
static const char * v8_recompile_synchronous
Handle< SharedFunctionInfo > shared_info() const
static const int kPrologueOffsetNotSet
bool DebuggerHasBreakPoints()
void set_strict_mode(StrictMode strict_mode)
MUST_USE_RESULT Status GenerateCode()
static Handle< T > null()
#define MODULE_NODE_LIST(V)
MUST_USE_RESULT Status CreateGraph()
#define ASSERT_EQ(v1, v2)
static Handle< SharedFunctionInfo > BuildFunctionInfo(FunctionLiteral *node, Handle< Script > script)
HStatistics * GetHStatistics()
#define ASSERT_NE(v1, v2)
#define DECLARATION_NODE_LIST(V)
kSerializedDataOffset kPrototypeTemplateOffset kIndexedPropertyHandlerOffset kInstanceCallHandlerOffset kInternalFieldCountOffset dependent_code
bool outer_scope_calls_sloppy_eval() const
unsigned allocation_size()
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric literals(0o77, 0b11)") DEFINE_bool(harmony_strings
static const int kMinFixedSlotIndex
void SetCachedData(ScriptDataImpl **cached_data, CachedDataMode cached_data_mode)
int SearchOptimizedCodeMap(Context *native_context, BailoutId osr_ast_id)
PerThreadAssertScopeDebugOnly< HANDLE_DEREFERENCE_ASSERT, true > AllowHandleDereference
#define EXPRESSION_NODE_LIST(V)
virtual ~CompilationInfo()
void set_ast_node_count(int count)
void UpdateToFinishedCode(DependencyGroup group, CompilationInfo *info, Code *code)
static void RecordFunctionCompilation(Logger::LogEventsAndTags tag, CompilationInfo *info, Handle< SharedFunctionInfo > shared)
CompilationInfo(Handle< JSFunction > closure, Zone *zone)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV 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 expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in name
StrictMode strict_mode() const
void SetFunction(FunctionLiteral *literal)
void RollbackDependencies()
static bool Rewrite(CompilationInfo *info)
MUST_USE_RESULT Status AbortAndDisableOptimization(BailoutReason reason=kNoReason)
static char * StrChr(char *str, int c)
MUST_USE_RESULT Status OptimizeGraph()
static void Run(CompilationInfo *info)