24 : native_context_(native_context), zone_(zone) {
44 if (value->IsCell()) {
45 Cell* cell = Cell::cast(value);
56 DCHECK(slot >= 0 && slot < feedback_vector_->length());
58 if (!obj->IsJSFunction() ||
68 if (maybe_code->IsCode()) {
70 return code->is_inline_cache_stub() && code->ic_state() ==
UNINITIALIZED;
78 if (!maybe_code->IsCode())
return false;
86 if (maybe_code->IsCode()) {
88 return code->is_keyed_store_stub() &&
97 return value->IsAllocationSite() || value->IsJSFunction();
103 return FLAG_pretenuring_call_new
104 ? info->IsJSFunction()
105 : info->IsAllocationSite() || info->IsJSFunction();
111 return value.is_identical_to(
113 ? ForInStatement::FAST_FOR_IN
114 : ForInStatement::SLOW_FOR_IN;
121 if (maybe_code->IsCode()) {
123 if (code->kind() == Code::KEYED_STORE_IC) {
133 if (info->IsAllocationSite()) {
143 if (FLAG_pretenuring_call_new || info->IsJSFunction()) {
147 DCHECK(info->IsAllocationSite());
154 if (info->IsAllocationSite()) {
163 if (FLAG_pretenuring_call_new || info->IsAllocationSite()) {
179 Type** combined_type) {
181 if (!info->IsCode()) {
189 Map* raw_map = code->FindFirstMap();
190 if (raw_map !=
NULL) {
197 if (code->is_compare_ic_stub()) {
202 }
else if (code->is_compare_nil_ic_stub()) {
218 if (!object->IsCode()) {
221 DCHECK(op < BinaryOpICState::FIRST_TOKEN ||
222 op > BinaryOpICState::LAST_TOKEN);
229 DCHECK_EQ(Code::BINARY_OP_IC, code->kind());
230 BinaryOpICState state(
isolate(), code->extra_ic_state());
233 *left = state.GetLeftType(
zone());
234 *right = state.GetRightType(
zone());
235 *result = state.GetResultType(
zone());
236 *fixed_right_arg = state.fixed_right_arg();
238 AllocationSite* first_allocation_site = code->FindFirstAllocationSite();
239 if (first_allocation_site !=
NULL) {
240 *allocation_site =
handle(first_allocation_site);
251 DCHECK_EQ(Code::BINARY_OP_IC, code->kind());
252 BinaryOpICState state(
isolate(), code->extra_ic_state());
253 return state.GetLeftType(
zone());
259 SmallMapList* receiver_types) {
260 receiver_types->Clear();
267 TypeFeedbackId id, SmallMapList* receiver_types,
bool* is_string) {
268 receiver_types->Clear();
280 receiver_types->Clear();
289 receiver_types->Clear();
296 SmallMapList* receiver_types) {
297 receiver_types->Clear();
305 SmallMapList* types) {
307 if (object->IsUndefined() || object->IsSmi())
return;
312 if (FLAG_collect_megamorphic_maps_from_stub_cache &&
314 types->Reserve(4,
zone());
329 while (!
map->prototype()->IsNull()) {
330 constructor =
map->constructor();
331 if (!constructor->IsNull()) {
334 if (!constructor->IsJSFunction())
return true;
341 map = HeapObject::cast(
map->prototype())->map();
343 constructor =
map->constructor();
344 if (constructor->IsNull())
return false;
345 JSFunction*
function = JSFunction::cast(constructor);
352 return function->context()->global_object() != native_context->
global_object()
353 &&
function->context()->global_object() != native_context->
builtins();
358 SmallMapList* types) {
360 if (!object->IsCode())
return;
364 Map*
map = code->FindFirstMap();
367 code->FindAllMaps(&maps);
371 types->Reserve(maps.length(),
zone());
372 for (
int i = 0;
i < maps.length();
i++) {
375 types->AddMapIfMissing(
map,
zone());
407 infos->
Add(*it.rinfo(),
zone());
415 Code* old_code = *code;
424 for (
int i = 0;
i < infos->length();
i++) {
434 for (
int i = 0;
i < infos->length();
i++) {
436 Address target_address = reloc_entry.target_address();
440 switch (target->
kind()) {
443 case Code::KEYED_LOAD_IC:
444 case Code::KEYED_STORE_IC:
445 case Code::BINARY_OP_IC:
446 case Code::COMPARE_IC:
447 case Code::TO_BOOLEAN_IC:
448 case Code::COMPARE_NIL_IC:
Code * builtin(Name name)
static Flags ComputeHandlerFlags(Kind handler_kind, StubType type=NORMAL, CacheHolderFlag holder=kCacheOnReceiver)
static Code * GetCodeFromTargetAddress(Address address)
byte * instruction_start()
static Type * StateToType(Zone *zone, State state, Handle< Map > map=Handle< Map >())
CompareICState::State state() const
CompareICState::State left() const
CompareICState::State right() const
Type * GetInputType(Zone *zone, Handle< Map > map)
Type * GetType(Zone *zone, Handle< Map > map=Handle< Map >())
JSBuiltinsObject * builtins()
GlobalObject * global_object()
static MUST_USE_RESULT Handle< UnseededNumberDictionary > New(Isolate *isolate, int at_least_space_for, PretenureFlag pretenure=NOT_TENURED)
Handle< T > CloseAndEscape(Handle< T > handle_value)
static Handle< T > cast(Handle< S > that)
static Handle< T > null()
static const int kNotFound
static KeyedAccessStoreMode GetKeyedAccessStoreMode(ExtraICState extra_state)
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
static MaybeHandle< Map > TryUpdate(Handle< Map > map) WARN_UNUSED_RESULT
static int ModeMask(Mode mode)
void set_host(Code *host)
void CollectMatchingMaps(SmallMapList *types, Handle< Name > name, Code::Flags flags, Handle< Context > native_context, Zone *zone)
bool LoadIsUninitialized(TypeFeedbackId id)
bool LoadIsBuiltin(TypeFeedbackId id, Builtins::Name builtin_id)
void KeyedPropertyReceiverTypes(TypeFeedbackId id, SmallMapList *receiver_types, bool *is_string)
void CollectReceiverTypes(TypeFeedbackId id, SmallMapList *types)
void CompareType(TypeFeedbackId id, Type **left, Type **right, Type **combined)
Handle< Context > native_context_
void ProcessRelocInfos(ZoneList< RelocInfo > *infos)
Handle< TypeFeedbackVector > feedback_vector_
void BinaryType(TypeFeedbackId id, Type **left, Type **right, Type **result, Maybe< int > *fixed_right_arg, Handle< AllocationSite > *allocation_site, Token::Value operation)
Handle< Object > GetInfo(TypeFeedbackId id)
KeyedAccessStoreMode GetStoreMode(TypeFeedbackId id)
Handle< JSFunction > GetCallTarget(int slot)
void BuildDictionary(Handle< Code > code)
void CreateDictionary(Handle< Code > code, ZoneList< RelocInfo > *infos)
void CountReceiverTypes(TypeFeedbackId id, SmallMapList *receiver_types)
Handle< AllocationSite > GetCallNewAllocationSite(int slot)
byte ToBooleanTypes(TypeFeedbackId id)
bool StoreIsUninitialized(TypeFeedbackId id)
void RelocateRelocInfos(ZoneList< RelocInfo > *infos, Code *old_code, Code *new_code)
Handle< AllocationSite > GetCallAllocationSite(int slot)
Handle< JSFunction > GetCallNewTarget(int slot)
void GetRelocInfos(Handle< Code > code, ZoneList< RelocInfo > *infos)
Handle< UnseededNumberDictionary > dictionary_
byte ForInType(int feedback_vector_slot)
void SetInfo(TypeFeedbackId id, Object *target)
bool CallNewIsMonomorphic(int slot)
void PropertyReceiverTypes(TypeFeedbackId id, Handle< String > name, SmallMapList *receiver_types)
Isolate * isolate() const
void KeyedAssignmentReceiverTypes(TypeFeedbackId id, SmallMapList *receiver_types, KeyedAccessStoreMode *store_mode)
bool StoreIsKeyedPolymorphic(TypeFeedbackId id)
Type * CountType(TypeFeedbackId id)
static bool CanRetainOtherContext(Map *map, Context *native_context)
void AssignmentReceiverTypes(TypeFeedbackId id, Handle< String > name, SmallMapList *receiver_types)
TypeFeedbackOracle(Handle< Code > code, Handle< TypeFeedbackVector > feedback_vector, Handle< Context > native_context, Zone *zone)
bool CallIsMonomorphic(int slot)
static Handle< Object > UninitializedSentinel(Isolate *isolate)
static Handle< TypeFeedbackVector > Copy(Isolate *isolate, Handle< TypeFeedbackVector > vector)
static MUST_USE_RESULT Handle< UnseededNumberDictionary > AtNumberPut(Handle< UnseededNumberDictionary > dictionary, uint32_t key, Handle< Object > 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 map
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 expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in name
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)
#define DCHECK_EQ(v1, v2)
static uint32_t IdToKey(TypeFeedbackId ast_id)
Handle< T > handle(T *t, Isolate *isolate)
Debugger support for the V8 JavaScript engine.