38 static LChunk* OptimizeGraph(HGraph* graph) {
45 if (!graph->Optimize(&bailout_reason)) {
60 arguments_length_(
NULL),
71 ASSERT(parameter < descriptor_->register_param_count_);
72 return parameters_[parameter];
77 return arguments_length_;
120 HValue* BuildArraySingleArgumentConstructor(JSArrayBuilder* builder);
121 HValue* BuildArrayNArgumentsConstructor(JSArrayBuilder* builder,
125 HValue* arguments_length_;
136 if (FLAG_trace_hydrogen_stubs) {
137 const char*
name = CodeStub::MajorName(
stub()->MajorKey(),
false);
138 PrintF(
"-----------------------------------------------------------\n");
139 PrintF(
"Compiling stub %s using hydrogen\n", name);
144 HEnvironment* start_environment =
graph()->start_environment();
152 for (
int i = 0; i < param_count; ++i) {
156 HParameter* param = Add<HParameter>(i, HParameter::REGISTER_PARAMETER, r);
157 start_environment->Bind(i, param);
158 parameters_[i] = param;
160 param->set_type(HType::Smi());
161 stack_parameter_count = param;
162 arguments_length_ = stack_parameter_count;
166 ASSERT(!runtime_stack_params || arguments_length_ !=
NULL);
167 if (!runtime_stack_params) {
168 stack_parameter_count =
graph()->GetConstantMinus1();
169 arguments_length_ =
graph()->GetConstant0();
172 context_ = Add<HContext>();
173 start_environment->BindContext(context_);
177 NoObservableSideEffectsScope no_effects(
this);
185 if (!stack_parameter_count->IsConstant() &&
188 stack_pop_count = AddUncasted<HAdd>(stack_parameter_count, constant_one);
194 stack_pop_count = Add<HConstant>(count);
199 HReturn* hreturn_instruction = New<HReturn>(return_value,
207 template <
class Stub>
229 HValue* undefined =
graph()->GetConstantUndefined();
230 IfBuilder builder(
this);
233 builder.ElseDeopt(
"Forced deopt to runtime");
249 isolate->
counters()->code_stubs()->Increment();
254 GenerateLightweightMiss(&masm);
268 desc, flags, masm.
CodeObject(), NeedsImmovableCode());
273 template <
class Stub>
275 CodeStub::Major major_key =
280 stub->InitializeInterfaceDescriptor(isolate, descriptor);
288 return stub->GenerateLightweightMissCode(isolate);
291 if (FLAG_profile_hydrogen_code_stub_compilation) {
294 CodeStubGraphBuilder<Stub> builder(isolate, stub);
295 LChunk* chunk = OptimizeGraph(builder.CreateGraph());
296 Handle<Code>
code = chunk->Codegen();
297 if (FLAG_profile_hydrogen_code_stub_compilation) {
298 double ms = timer.Elapsed().InMillisecondsF();
299 PrintF(
"[Lazy compilation of %s took %0.3f ms]\n",
300 stub->GetName().get(), ms);
308 HValue* value = GetParameter(0);
311 IfBuilder if_number(
this);
312 if_number.If<HIsSmiAndBranch>(value);
313 if_number.OrIf<HCompareMap>(value, isolate()->
factory()->heap_number_map());
322 HValue*
function = AddLoadJSBuiltin(Builtins::TO_NUMBER);
323 Add<HPushArgument>(value);
324 Push(Add<HInvokeFunction>(
function, 1));
333 return DoGenerateCode(isolate,
this);
339 info()->MarkAsSavesCallerDoubles();
340 HValue* number = GetParameter(NumberToStringStub::kNumber);
341 return BuildNumberToString(number, Type::Number(zone()));
346 return DoGenerateCode(isolate,
this);
353 HValue* undefined = graph()->GetConstantUndefined();
356 int length = casted_stub()->length();
358 HInstruction* allocation_site = Add<HLoadKeyed>(GetParameter(0),
362 IfBuilder checker(
this);
367 HObjectAccess access = HObjectAccess::ForAllocationSiteOffset(
370 allocation_site,
static_cast<HValue*
>(
NULL), access);
373 HValue* elements = AddLoadElements(boilerplate);
375 IfBuilder if_fixed_cow(
this);
376 if_fixed_cow.If<HCompareMap>(elements, factory->fixed_cow_array_map());
378 push_value = BuildCloneShallowArray(boilerplate,
383 environment()->Push(push_value);
386 IfBuilder if_fixed(
this);
387 if_fixed.If<HCompareMap>(elements, factory->fixed_array_map());
389 push_value = BuildCloneShallowArray(boilerplate,
394 environment()->Push(push_value);
396 push_value = BuildCloneShallowArray(boilerplate,
401 environment()->Push(push_value);
403 ElementsKind elements_kind = casted_stub()->ComputeElementsKind();
404 push_value = BuildCloneShallowArray(boilerplate,
409 environment()->Push(push_value);
412 checker.ElseDeopt(
"Uninitialized boilerplate literals");
415 return environment()->Pop();
420 return DoGenerateCode(isolate,
this);
426 HValue* undefined = graph()->GetConstantUndefined();
428 HInstruction* allocation_site = Add<HLoadKeyed>(GetParameter(0),
433 IfBuilder checker(
this);
438 HObjectAccess access = HObjectAccess::ForAllocationSiteOffset(
441 allocation_site,
static_cast<HValue*
>(
NULL), access);
444 int object_size =
size;
445 if (FLAG_allocation_site_pretenuring) {
449 HValue* boilerplate_map = Add<HLoadNamedField>(
451 HObjectAccess::ForMap());
452 HValue* boilerplate_size = Add<HLoadNamedField>(
454 HObjectAccess::ForMapInstanceSize());
462 HInstruction*
object = Add<HAllocate>(size_in_bytes, HType::JSObject(),
466 HObjectAccess access = HObjectAccess::ForObservableJSObjectOffset(i);
467 Add<HStoreNamedField>(
468 object, access, Add<HLoadNamedField>(
469 boilerplate,
static_cast<HValue*
>(
NULL), access));
472 ASSERT(FLAG_allocation_site_pretenuring || (size == object_size));
473 if (FLAG_allocation_site_pretenuring) {
474 BuildCreateAllocationMemento(
475 object, Add<HConstant>(object_size), allocation_site);
478 environment()->Push(
object);
479 checker.ElseDeopt(
"Uninitialized boilerplate in fast clone");
482 return environment()->Pop();
487 return DoGenerateCode(isolate,
this);
499 AddStoreMapConstant(
object, allocation_site_map);
503 Add<HStoreNamedField>(object,
504 HObjectAccess::ForAllocationSiteOffset(
506 initial_elements_kind);
509 Add<HStoreNamedField>(object,
510 HObjectAccess::ForAllocationSiteOffset(
512 graph()->GetConstant0());
515 Add<HStoreNamedField>(object,
516 HObjectAccess::ForAllocationSiteOffset(
518 graph()->GetConstant0());
521 Add<HStoreNamedField>(object,
522 HObjectAccess::ForAllocationSiteOffset(
524 graph()->GetConstant0());
527 HConstant* empty_fixed_array =
528 Add<HConstant>(isolate()->
factory()->empty_fixed_array());
529 HStoreNamedField* store = Add<HStoreNamedField>(
531 HObjectAccess::ForAllocationSiteOffset(
536 HValue* site_list = Add<HConstant>(
537 ExternalReference::allocation_sites_list_address(isolate()));
538 HValue* site = Add<HLoadNamedField>(
540 HObjectAccess::ForAllocationSiteList());
541 store = Add<HStoreNamedField>(object,
544 store->SkipWriteBarrier();
545 Add<HStoreNamedField>(site_list, HObjectAccess::ForAllocationSiteList(),
550 Add<HStoreKeyed>(feedback_vector, slot, object,
FAST_ELEMENTS,
552 return feedback_vector;
557 return DoGenerateCode(isolate,
this);
563 HInstruction* load = BuildUncheckedMonomorphicElementAccess(
564 GetParameter(0), GetParameter(1),
NULL,
565 casted_stub()->is_js_array(), casted_stub()->elements_kind(),
572 return DoGenerateCode(isolate,
this);
581 HObjectAccess access = is_inobject
582 ? HObjectAccess::ForObservableJSObjectOffset(offset, representation)
583 : HObjectAccess::ForBackingStoreOffset(offset, representation);
586 object = Add<HLoadNamedField>(
590 access = HObjectAccess::ForHeapNumberValue();
592 return Add<HLoadNamedField>(object,
static_cast<HValue*
>(
NULL), access);
598 return BuildLoadNamedField(GetParameter(0),
599 casted_stub()->representation(),
600 casted_stub()->offset(),
601 casted_stub()->is_inobject());
606 return DoGenerateCode(isolate,
this);
612 HValue*
string = BuildLoadNamedField(
614 return BuildLoadNamedField(
620 return DoGenerateCode(isolate,
this);
626 BuildUncheckedMonomorphicElementAccess(
627 GetParameter(0), GetParameter(1), GetParameter(2),
628 casted_stub()->is_js_array(), casted_stub()->elements_kind(),
631 return GetParameter(2);
636 return DoGenerateCode(isolate,
this);
642 info()->MarkAsSavesCallerDoubles();
644 BuildTransitionElementsKind(GetParameter(0),
646 casted_stub()->from_kind(),
647 casted_stub()->to_kind(),
648 casted_stub()->is_js_array());
650 return GetParameter(0);
655 return DoGenerateCode(isolate,
this);
664 JSArrayBuilder array_builder(
this, kind, alloc_site, constructor,
667 switch (argument_class) {
669 result = array_builder.AllocateEmptyArray();
672 result = BuildArraySingleArgumentConstructor(&array_builder);
675 result = BuildArrayNArgumentsConstructor(&array_builder, kind);
687 JSArrayBuilder array_builder(
this, kind, constructor);
690 switch (argument_class) {
692 result = array_builder.AllocateEmptyArray();
695 result = BuildArraySingleArgumentConstructor(&array_builder);
698 result = BuildArrayNArgumentsConstructor(&array_builder, kind);
705 HValue* CodeStubGraphBuilderBase::BuildArraySingleArgumentConstructor(
706 JSArrayBuilder* array_builder) {
711 HInstruction* elements = Add<HArgumentsElements>(
false);
713 elements, constant_one, constant_zero);
719 HValue* CodeStubGraphBuilderBase::BuildArrayNArgumentsConstructor(
726 HConstant* max_alloc_length =
728 HValue* checked_length = Add<HBoundsCheck>(length, max_alloc_length);
739 ? JSArrayBuilder::FILL_WITH_HOLE
740 : JSArrayBuilder::DONT_FILL_WITH_HOLE;
741 HValue* new_object = array_builder->AllocateArray(checked_length,
744 HValue* elements = array_builder->GetElementsLocation();
748 LoopBuilder builder(
this,
750 LoopBuilder::kPostIncrement);
751 HValue* start =
graph()->GetConstant0();
752 HValue* key = builder.BeginBody(start, checked_length, Token::LT);
753 HInstruction* argument_elements = Add<HArgumentsElements>(
false);
754 HInstruction* argument = Add<HAccessArgumentsAt>(
755 argument_elements, checked_length, key);
757 Add<HStoreKeyed>(elements, key, argument, kind);
767 return BuildArrayConstructor(kind, override_mode,
NONE);
772 return DoGenerateCode(isolate,
this);
781 return BuildArrayConstructor(kind, override_mode, SINGLE);
787 return DoGenerateCode(isolate,
this);
795 return BuildArrayConstructor(kind, override_mode, MULTIPLE);
800 return DoGenerateCode(isolate,
this);
808 return BuildInternalArrayConstructor(kind,
NONE);
814 return DoGenerateCode(isolate,
this);
822 return BuildInternalArrayConstructor(kind, SINGLE);
828 return DoGenerateCode(isolate,
this);
836 return BuildInternalArrayConstructor(kind, MULTIPLE);
842 return DoGenerateCode(isolate,
this);
848 Isolate* isolate = graph()->isolate();
850 HIfContinuation continuation;
853 BuildCompareNil(GetParameter(0), type, &continuation);
854 IfBuilder if_nil(
this, &continuation);
856 if (continuation.IsFalseReachable()) {
858 if_nil.Return(graph()->GetConstant0());
861 return continuation.IsTrueReachable()
862 ? graph()->GetConstant1()
863 : graph()->GetConstantUndefined();
868 return DoGenerateCode(isolate,
this);
879 Type* left_type = state.GetLeftType(zone());
880 Type* right_type = state.GetRightType(zone());
881 Type* result_type = state.GetResultType(zone());
884 (state.HasSideEffects() || !result_type->
Is(
Type::None())));
889 (left_type->
Maybe(Type::String()) || right_type->
Maybe(Type::String())) &&
890 !left_type->
Is(Type::String()) && !right_type->
Is(Type::String())) {
893 if (left_type->
Maybe(Type::String())) {
894 IfBuilder if_leftisstring(
this);
895 if_leftisstring.If<HIsStringAndBranch>(left);
896 if_leftisstring.Then();
898 Push(BuildBinaryOperation(
899 state.op(), left, right,
900 Type::String(zone()), right_type,
901 result_type, state.fixed_right_arg(),
904 if_leftisstring.Else();
906 Push(BuildBinaryOperation(
907 state.op(), left, right,
908 left_type, right_type, result_type,
909 state.fixed_right_arg(), allocation_mode));
911 if_leftisstring.End();
914 IfBuilder if_rightisstring(
this);
915 if_rightisstring.If<HIsStringAndBranch>(right);
916 if_rightisstring.Then();
918 Push(BuildBinaryOperation(
919 state.op(), left, right,
920 left_type, Type::String(zone()),
921 result_type, state.fixed_right_arg(),
924 if_rightisstring.Else();
926 Push(BuildBinaryOperation(
927 state.op(), left, right,
928 left_type, right_type, result_type,
929 state.fixed_right_arg(), allocation_mode));
931 if_rightisstring.End();
935 result = BuildBinaryOperation(
936 state.op(), left, right,
937 left_type, right_type, result_type,
938 state.fixed_right_arg(), allocation_mode);
943 if (!state.HasSideEffects()) {
944 if (result_type->
Is(Type::SignedSmall())) {
945 if (state.op() == Token::SHR) {
949 IfBuilder if_of(
this);
951 Add<HConstant>(
static_cast<int>(SmiValuesAre32Bits()
952 ? 0x80000000 : 0x40000000)), Token::EQ_STRICT);
954 if_of.ElseDeopt(
"UInt->Smi oveflow");
958 result = EnforceNumberType(result, result_type);
963 if (state.CanReuseDoubleBox()) {
965 IfBuilder if_heap_number(
this);
966 if_heap_number.IfNot<HIsSmiAndBranch>(operand);
967 if_heap_number.Then();
968 Add<HStoreNamedField>(operand, HObjectAccess::ForHeapNumberValue(), result);
970 if_heap_number.Else();
972 if_heap_number.End();
981 return DoGenerateCode(isolate,
this);
989 HValue* allocation_site = GetParameter(
990 BinaryOpWithAllocationSiteStub::kAllocationSite);
991 HValue* left = GetParameter(BinaryOpWithAllocationSiteStub::kLeft);
992 HValue* right = GetParameter(BinaryOpWithAllocationSiteStub::kRight);
994 Type* left_type = state.GetLeftType(zone());
995 Type* right_type = state.GetRightType(zone());
996 Type* result_type = state.GetResultType(zone());
997 HAllocationMode allocation_mode(allocation_site);
999 return BuildBinaryOperation(state.op(), left, right,
1000 left_type, right_type, result_type,
1001 state.fixed_right_arg(), allocation_mode);
1006 return DoGenerateCode(isolate,
this);
1012 StringAddStub* stub = casted_stub();
1016 HValue* left = GetParameter(StringAddStub::kLeft);
1017 HValue* right = GetParameter(StringAddStub::kRight);
1021 left = BuildCheckString(left);
1024 right = BuildCheckString(right);
1027 return BuildStringAdd(left, right, HAllocationMode(pretenure_flag));
1032 return DoGenerateCode(isolate,
this);
1040 IfBuilder if_true(
this);
1041 if_true.If<HBranch>(GetParameter(0), stub->
GetTypes());
1043 if_true.Return(graph()->GetConstant1());
1046 return graph()->GetConstant0();
1051 return DoGenerateCode(isolate,
this);
1058 Handle<Object> hole(isolate()->heap()->the_hole_value(), isolate());
1063 HParameter* value = GetParameter(2);
1069 HValue* global = Add<HConstant>(
1071 Add<HCheckMaps>(global, placeholder_map, top_info());
1074 HValue* cell = Add<HConstant>(placeholder_cell);
1075 HObjectAccess access(HObjectAccess::ForCellPayload(isolate()));
1076 HValue* cell_contents = Add<HLoadNamedField>(
1080 IfBuilder builder(
this);
1083 builder.ElseDeopt(
"Unexpected cell contents in constant global store");
1089 IfBuilder builder(
this);
1090 HValue* hole_value = Add<HConstant>(hole);
1093 builder.Deopt(
"Unexpected cell contents in global store");
1095 Add<HStoreNamedField>(cell, access, value);
1104 return DoGenerateCode(isolate,
this);
1110 HValue* value = GetParameter(0);
1112 HValue* key = GetParameter(2);
1113 HValue*
object = GetParameter(3);
1115 if (FLAG_trace_elements_transitions) {
1119 info()->MarkAsSavesCallerDoubles();
1121 BuildTransitionElementsKind(
object, map,
1122 casted_stub()->from_kind(),
1123 casted_stub()->to_kind(),
1124 casted_stub()->is_jsarray());
1126 BuildUncheckedMonomorphicElementAccess(
object, key, value,
1127 casted_stub()->is_jsarray(),
1128 casted_stub()->to_kind(),
1130 casted_stub()->store_mode());
1138 return DoGenerateCode(isolate,
this);
1169 Add<HStoreCodeEntry>(js_function, code_object);
1170 Add<HStoreNamedField>(js_function, HObjectAccess::ForLiteralsPointer(),
1174 HValue* optimized_functions_list = Add<HLoadNamedField>(
1177 Add<HStoreNamedField>(js_function,
1178 HObjectAccess::ForNextFunctionLinkPointer(),
1179 optimized_functions_list);
1182 Add<HStoreNamedField>(native_context,
1192 Add<HStoreNamedField>(js_function,
1193 HObjectAccess::ForNextFunctionLinkPointer(),
1194 graph()->GetConstantUndefined());
1195 HValue* code_object = Add<HLoadNamedField>(
1196 shared_info,
static_cast<HValue*
>(
NULL), HObjectAccess::ForCodeOffset());
1197 Add<HStoreCodeEntry>(js_function, code_object);
1208 HValue* field_slot = iterator;
1209 if (field_offset > 0) {
1210 HValue* field_offset_value = Add<HConstant>(field_offset);
1211 field_slot = AddUncasted<HAdd>(iterator, field_offset_value);
1213 HInstruction* field_entry = Add<HLoadKeyed>(optimized_map, field_slot,
1222 HValue* native_context) {
1224 IfBuilder is_optimized(
this);
1227 HObjectAccess::ForOptimizedCodeMap());
1228 HValue* null_constant = Add<HConstant>(0);
1230 is_optimized.Then();
1234 is_optimized.Else();
1240 HValue* first_entry_index =
1242 IfBuilder already_in(
this);
1244 optimized_map, first_entry_index);
1253 HValue* shared_function_entry_length =
1255 LoopBuilder loop_builder(
this,
1257 LoopBuilder::kPostDecrement,
1258 shared_function_entry_length);
1259 HValue* array_length = Add<HLoadNamedField>(
1261 HObjectAccess::ForFixedArrayLength());
1262 HValue* start_pos = AddUncasted<HSub>(array_length,
1263 shared_function_entry_length);
1264 HValue* slot_iterator = loop_builder.BeginBody(start_pos,
1268 IfBuilder done_check(
this);
1274 loop_builder.Break();
1276 loop_builder.EndBody();
1280 IfBuilder no_optimized_code_check(
this);
1282 slot_iterator, first_entry_index,
Token::EQ);
1283 no_optimized_code_check.Then();
1298 Add<HConstant>(factory->empty_fixed_array());
1299 HValue* shared_info = GetParameter(0);
1301 AddIncrementCounter(counters->fast_new_closure_total());
1309 casted_stub()->is_generator());
1313 HInstruction* native_context = BuildGetNativeContext();
1316 HObjectAccess::ForContextSlot(map_index));
1317 Add<HStoreNamedField>(js_function, HObjectAccess::ForMap(), map_slot_value);
1320 Add<HStoreNamedField>(js_function, HObjectAccess::ForPropertiesPointer(),
1322 Add<HStoreNamedField>(js_function, HObjectAccess::ForElementsPointer(),
1324 Add<HStoreNamedField>(js_function, HObjectAccess::ForLiteralsPointer(),
1326 Add<HStoreNamedField>(js_function, HObjectAccess::ForPrototypeOrInitialMap(),
1327 graph()->GetConstantHole());
1328 Add<HStoreNamedField>(js_function,
1329 HObjectAccess::ForSharedFunctionInfoPointer(),
1331 Add<HStoreNamedField>(js_function, HObjectAccess::ForFunctionContextPointer(),
1337 if (FLAG_cache_optimized_code) {
1338 BuildInstallFromOptimizedCodeMap(js_function, shared_info, native_context);
1340 BuildInstallCode(js_function, shared_info);
1348 return DoGenerateCode(isolate,
this);
1357 HParameter*
function = GetParameter(FastNewContextStub::kFunction);
1360 HAllocate* function_context = Add<HAllocate>(
1365 AddStoreMapConstant(function_context,
1366 isolate()->factory()->function_context_map());
1367 Add<HStoreNamedField>(function_context,
1368 HObjectAccess::ForFixedArrayLength(),
1369 Add<HConstant>(length));
1372 Add<HStoreNamedField>(function_context,
1375 Add<HStoreNamedField>(function_context,
1378 Add<HStoreNamedField>(function_context,
1380 graph()->GetConstant0());
1383 HValue* global_object = Add<HLoadNamedField>(
1386 Add<HStoreNamedField>(function_context,
1387 HObjectAccess::ForContextSlot(
1393 Add<HStoreNamedField>(function_context,
1394 HObjectAccess::ForContextSlot(i),
1395 graph()->GetConstantUndefined());
1398 return function_context;
1403 return DoGenerateCode(isolate,
this);
1409 HValue* receiver = GetParameter(0);
1410 HValue* key = GetParameter(1);
1412 Add<HCheckSmi>(key);
1414 return BuildUncheckedDictionaryElementLoad(receiver, key);
1419 return DoGenerateCode(isolate,
this);
1426 HValue* length = GetParameter(RegExpConstructResultStub::kLength);
1427 HValue* index = GetParameter(RegExpConstructResultStub::kIndex);
1428 HValue* input = GetParameter(RegExpConstructResultStub::kInput);
1430 return BuildRegExpConstructResult(length, index, input);
1435 return DoGenerateCode(isolate,
this);
virtual Handle< Code > GenerateCode(Isolate *isolate)
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
bool check_global() const
virtual Handle< Code > GenerateCode(Isolate *isolate)
bool IsParameterCountRegister(int index)
void PrintF(const char *format,...)
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 map
virtual Handle< Code > GenerateCode(Isolate *isolate)
static int FunctionMapIndex(StrictMode strict_mode, bool is_generator)
Handle< PropertyCell > NewPropertyCell(Handle< Object > value)
virtual Handle< Code > GenerateCode(Isolate *isolate)
Type * GetType(Zone *zone, Handle< Map > map=Handle< Map >())
int register_param_count_
virtual Handle< Code > GenerateCode(Isolate *isolate)
static Smi * FromInt(int value)
static const int kConstructor
static const int kContextOffset
void AddIncrementCounter(StatsCounter *counter)
virtual HValue * BuildCodeUninitializedStub()
virtual Code::Kind GetCodeKind() const
static Representation Integer32()
static BailoutId StubEntry()
virtual Handle< Code > GenerateCode(Isolate *isolate)
HydrogenCodeStub * stub()
virtual Handle< Code > GenerateCode(Isolate *isolate)
PerThreadAssertScopeDebugOnly< HANDLE_DEREFERENCE_ASSERT, false > DisallowHandleDereference
CodeStubInterfaceDescriptor * code_stub_interface_descriptor(int index)
AllocationSiteOverrideMode
virtual Handle< Code > GenerateCode(Isolate *isolate)
Isolate * isolate() const
static const int kConstructor
#define ASSERT(condition)
HBasicBlock * current_block() const
const int kPointerSizeLog2
HLoadNamedField * BuildLoadNamedField(HValue *object, Representation representation, int offset, bool is_inobject)
virtual Handle< Code > GenerateCode(Isolate *isolate)
virtual Handle< Code > GenerateCode(Isolate *isolate)
virtual Handle< Code > GenerateCode(Isolate *isolate) V8_OVERRIDE
bool Maybe(TypeImpl *that)
static const int kDependentCodeOffset
static const int kOsrAstIdOffset
virtual HValue * BuildCodeStub()
Handle< Object > CodeObject()
static const int kPretenureCreateCountOffset
StubFunctionMode function_mode_
virtual Handle< Code > GenerateCode(Isolate *isolate)
static const int kNestedSiteOffset
static const int kPretenureDataOffset
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
static const int kLengthOffset
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 only print modified registers Don t break for ASM_UNIMPLEMENTED_BREAK macros print stack trace when an illegal exception is thrown randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot testing_bool_flag testing_int_flag string flag tmp file in which to serialize heap Print the time it takes to lazily compile hydrogen code stubs concurrent_recompilation concurrent_sweeping Print usage including flags
virtual Handle< Code > GenerateCode(Isolate *isolate) V8_OVERRIDE
void GetCode(CodeDesc *desc)
static const int kTransitionInfoOffset
void set_current_block(HBasicBlock *block)
HValue * BuildArrayConstructor(ElementsKind kind, AllocationSiteOverrideMode override_mode, ArgumentClass argument_class)
PerThreadAssertScopeDebugOnly< HANDLE_ALLOCATION_ASSERT, false > DisallowHandleAllocation
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
CodeStubGraphBuilder(Isolate *isolate, Stub *stub)
virtual Handle< Code > GenerateCode(Isolate *isolate)
static LChunk * NewChunk(HGraph *graph)
static const int kAllocationSite
bool IsFastSmiElementsKind(ElementsKind kind)
static const int kCachedCodeOffset
HValue * BuildAllocateArrayFromLength(JSArrayBuilder *array_builder, HValue *length_argument)
Handle< Code > GenerateLightweightMissCode(Isolate *isolate)
virtual Handle< Code > GenerateCode(Isolate *isolate)
static const int kHeaderSize
HydrogenCodeStub * code_stub() const
static const int kEntriesStart
const char * GetBailoutReason(BailoutReason reason)
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
virtual Handle< Code > GenerateCode(Isolate *isolate)
ElementsKind GetInitialFastElementsKind()
static Flags ComputeFlags(Kind kind, InlineCacheState ic_state=UNINITIALIZED, ExtraICState extra_ic_state=kNoExtraICState, StubType type=NORMAL, InlineCacheHolderFlag holder=OWN_MAP)
virtual HValue * BuildCodeInitializedStub()
HBasicBlock * CreateBasicBlock(HEnvironment *env)
Handle< Code > NewCode(const CodeDesc &desc, Code::Flags flags, Handle< Object > self_reference, bool immovable=false, bool crankshafted=false, int prologue_offset=Code::kPrologueOffsetNotSet)
void BuildInstallCode(HValue *js_function, HValue *shared_info)
CodeStubInterfaceDescriptor * GetInterfaceDescriptor(Isolate *isolate)
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
void set_generating_stub(bool value)
static const int kHeaderSize
virtual Handle< Code > GenerateCode(Isolate *isolate)
HValue * BuildInternalArrayConstructor(ElementsKind kind, ArgumentClass argument_class)
static const int kEntryLength
void BuildCheckAndInstallOptimizedCode(HValue *js_function, HValue *native_context, IfBuilder *builder, HValue *optimized_map, HValue *map_index)
static Handle< HeapObject > global_placeholder(Isolate *isolate)
Register stack_parameter_count_
static const int kWeakNextOffset
HValue * GetArgumentsLength()
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 kValueOffset
HParameter * GetParameter(int parameter)
virtual bool BuildGraph()
static Representation Tagged()
virtual Handle< Code > GenerateCode(Isolate *isolate)
CodeStubGraphBuilderBase(Isolate *isolate, HydrogenCodeStub *stub)
void BuildInstallFromOptimizedCodeMap(HValue *js_function, HValue *shared_info, HValue *native_context)
void FinishCurrentBlock(HControlInstruction *last)
virtual HValue * BuildCodeStub()=0
static const int kInitialMaxFastElementArray
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
virtual Handle< Code > GenerateCode(Isolate *isolate)
static const int kLiteralsOffset
virtual Handle< Code > GenerateCode(Isolate *isolate)
virtual Handle< Code > GenerateCode(Isolate *isolate)
HInstruction * LoadFromOptimizedCodeMap(HValue *optimized_map, HValue *iterator, int field_offset)
void Goto(HBasicBlock *from, HBasicBlock *target, FunctionState *state=NULL, bool add_simulate=true)
int hint_stack_parameter_count_
virtual Handle< Code > GenerateCode(Isolate *isolate)